diff options
author | Ton Roosendaal <ton@blender.org> | 2013-02-13 20:52:14 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2013-02-13 20:52:14 +0400 |
commit | da4711632c729d54dc3d425d905dec926966f79c (patch) | |
tree | 84b8d1c20493b7d727f1a581232448e13a2fca3c /source/blender/editors | |
parent | 909d64079a228dfa9cccf8ed718efc322a038e7e (diff) |
Fix for splitting startup and userpref:
The do-version handling for Userdef is outside file reading, which makes
it needed to store the file version in UserDef, so it gets the correct
version to handle.
Thanks Antonis R. for pointing at the omission!
Also removed the mindboggling define. If you do such, then make it
like "MAIN_VERSION_OLDER_THAN() or so.
In general version hacking could be limited much better... ask me
before even thinking to add one, most optimal is to do it in a way
it's not depending on a version ever - forward/backward compatible.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/resources.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index e3fbbc26d0d..d0a950fb3bc 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1322,7 +1322,6 @@ void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3] void init_userdef_do_versions(void) { Main *bmain = G.main; -// countall(); /* the UserDef struct is not corrected with do_versions() .... ugh! */ if (U.wheellinescroll == 0) U.wheellinescroll = 3; @@ -2096,7 +2095,8 @@ void init_userdef_do_versions(void) } } - if (bmain->versionfile < 266) { + /* NOTE!! from now on use U.versionfile and U.subversionfile */ + if (U.versionfile < 266) { bTheme *btheme; for (btheme = U.themes.first; btheme; btheme = btheme->next) { @@ -2108,7 +2108,7 @@ void init_userdef_do_versions(void) } } - if (!MAIN_VERSION_ATLEAST(bmain, 265, 4)) { + if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 4)) { bTheme *btheme; for (btheme = U.themes.first; btheme; btheme = btheme->next) { rgba_char_args_set(btheme->text.syntaxd, 50, 0, 140, 255); /* Decorator/Preprocessor Dir. Blue-purple */ @@ -2117,14 +2117,14 @@ void init_userdef_do_versions(void) } } - if (!MAIN_VERSION_ATLEAST(bmain, 265, 6)) { + if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 6)) { bTheme *btheme; for (btheme = U.themes.first; btheme; btheme = btheme->next) { copy_v4_v4_char(btheme->tv3d.gradients.high_gradient, btheme->tv3d.back); } } - if (!MAIN_VERSION_ATLEAST(bmain, 265, 9)) { + if (U.versionfile < 265 || (U.versionfile == 265 && U.subversionfile < 9)) { bTheme *btheme; for (btheme = U.themes.first; btheme; btheme = btheme->next) { rgba_char_args_test_set(btheme->tnode.syntaxs, 151, 116, 116, 255); /* matte nodes */ @@ -2132,6 +2132,9 @@ void init_userdef_do_versions(void) } } + /* NOTE!! from now on use U.versionfile and U.subversionfile */ + + if (U.pixelsize == 0.0f) U.pixelsize = 1.0f; |