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>2019-02-02 06:01:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-02 06:01:48 +0300
commitd46c910b1a105287bccccd651056a9a0a73b3936 (patch)
tree1058930380845d6c6008eab3f639529a405cc8d3 /source/blender/blenkernel
parentafcbf7cf1357723f59eca8e118a0ca9ef6cf6555 (diff)
Cleanup: match logic for merging G.f & G.fileflags on load
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_global.h8
-rw-r--r--source/blender/blenkernel/intern/blendfile.c6
2 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 75eb5a327de..17baab1f579 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -116,6 +116,10 @@ enum {
G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET = (1 << 16),
};
+/** Don't overwrite these flags when reading a file. */
+#define G_FLAG_ALL_RUNTIME \
+ (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF)
+
/** #Global.debug */
enum {
G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
@@ -173,7 +177,9 @@ enum {
/* #define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28) */ /* deprecated */
};
-#define G_FILE_FLAGS_RUNTIME (G_FILE_NO_UI | G_FILE_RELATIVE_REMAP | G_FILE_SAVE_COPY)
+/** Don't overwrite these flags when reading a file. */
+#define G_FILE_FLAG_ALL_RUNTIME \
+ (G_FILE_NO_UI | G_FILE_RELATIVE_REMAP | G_FILE_SAVE_COPY)
/** ENDIAN_ORDER: indicates what endianness the platform where the file was written had. */
#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index 164b0a2bd30..075d05eebe8 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -270,8 +270,8 @@ static void setup_app_data(
}
/* Keep state from preferences. */
- const int fileflags_skip = G_FILE_FLAGS_RUNTIME;
- G.fileflags = (G.fileflags & fileflags_skip) | (bfd->fileflags & ~fileflags_skip);
+ const int fileflags_keep = G_FILE_FLAG_ALL_RUNTIME;
+ G.fileflags = (G.fileflags & fileflags_keep) | (bfd->fileflags & ~fileflags_keep);
/* this can happen when active scene was lib-linked, and doesn't exist anymore */
if (CTX_data_scene(C) == NULL) {
@@ -291,7 +291,7 @@ static void setup_app_data(
/* special cases, override loaded flags: */
if (G.f != bfd->globalf) {
- const int flags_keep = (G_FLAG_SCRIPT_AUTOEXEC | G_FLAG_SCRIPT_OVERRIDE_PREF);
+ const int flags_keep = G_FLAG_ALL_RUNTIME;
bfd->globalf = (bfd->globalf & ~flags_keep) | (G.f & flags_keep);
}