Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-23 17:14:06 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-23 17:14:06 +0300
commit0e9b664fce0ab0c3d5bbf9042c76ffdff8c60fbc (patch)
tree943ca96ca1edb78117fabb5a874121fbd7b05156 /source/blender/blenkernel/intern/unit.c
parent4aeeee88198b97ede58b09188f588746b0dfe8f1 (diff)
Changes to the ortho grid drawing based on discussion with Ton.
- ortho grid now draws scaled by the view3d 'Scale' setting, venomgfx noticed this was missing. - so as not to confuse add scale next to unit display text, so rather then "Metres" it shows "Metres x 1.5" otherwise its confusing that grid lines are not in exact units. - changed grid spacing to grid scale (needed for more logical behavior with units) - when units are enabled grey out subdivisions.
Diffstat (limited to 'source/blender/blenkernel/intern/unit.c')
-rw-r--r--source/blender/blenkernel/intern/unit.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 4cb59a2ee86..54ecef75108 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -69,13 +69,13 @@
/* define a single unit */
typedef struct bUnitDef {
- char *name;
- char *name_plural; /* abused a bit for the display name */
- char *name_short; /* this is used for display*/
- char *name_alt; /* keyboard-friendly ASCII-only version of name_short, can be NULL */
+ const char *name;
+ const char *name_plural; /* abused a bit for the display name */
+ const char *name_short; /* this is used for display*/
+ const char *name_alt; /* keyboard-friendly ASCII-only version of name_short, can be NULL */
/* if name_short has non-ASCII chars, name_alt should be present */
- char *name_display; /* can be NULL */
+ const char *name_display; /* can be NULL */
double scalar;
double bias; /* not used yet, needed for converting temperature */
@@ -421,7 +421,7 @@ void bUnit_AsString(char *str, int len_max, double value, int prec, int system,
}
-static char *unit_find_str(char *str, char *substr)
+static char *unit_find_str(char *str, const char *substr)
{
char *str_found;
@@ -476,7 +476,7 @@ static int ch_is_op(char op)
}
}
-static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, char *replace_str)
+static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pref, bUnitDef *unit, const char *replace_str)
{
char *str_found;
@@ -755,11 +755,11 @@ void bUnit_GetSystem(void **usys_pt, int *len, int system, int type)
*len= usys->length;
}
-char *bUnit_GetName(void *usys_pt, int index)
+const char *bUnit_GetName(void *usys_pt, int index)
{
return ((bUnitCollection *)usys_pt)->units[index].name;
}
-char *bUnit_GetNameDisplay(void *usys_pt, int index)
+const char *bUnit_GetNameDisplay(void *usys_pt, int index)
{
return ((bUnitCollection *)usys_pt)->units[index].name_display;
}