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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-12-27 13:53:50 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-12-27 14:00:33 +0300
commit3fcf535d2e003ad939fa1f1c7aa4d5da1b38aef7 (patch)
tree0cc5b044cdc1f7b6fa58ad1d0c3c6cafc51a7759 /source/gameengine
parentec2ca11cba496294838bfb5fb76f7bfcef2fe8cc (diff)
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all. This change was also needed because we were getting short on ID flags, and future enhancement of 'user_one' ID behavior requires two new ones. id->flag remains for persistent data (fakeuser only, so far!), this also allows us 100% backward & forward compatibility. New id->tag is used for most flags. Though written in .blend files, its content is cleared at read time. Note that .blend file version was bumped, so that we can clear runtimeflags from old .blends, important in case we add new persistent flags in future. Also, behavior of tags (either status ones, or whether they need to be cleared before/after use) has been added as comments to their declaration. Reviewers: sergey, campbellbarton Differential Revision: https://developer.blender.org/D1683
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp6
-rw-r--r--source/gameengine/Ketsji/BL_ActionManager.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index 6cbb8e08cf5..ad1fdf2f06a 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -1438,18 +1438,18 @@ RAS_MeshObject *KX_BlenderSceneConverter::ConvertMeshSpecial(KX_Scene *kx_scene,
/* ensure all materials are tagged */
for (int i = 0; i < mesh->totcol; i++) {
if (mesh->mat[i])
- mesh->mat[i]->id.flag &= ~LIB_DOIT;
+ mesh->mat[i]->id.tag &= ~LIB_TAG_DOIT;
}
for (int i = 0; i < mesh->totcol; i++) {
Material *mat_old = mesh->mat[i];
/* if its tagged its a replaced material */
- if (mat_old && (mat_old->id.flag & LIB_DOIT) == 0) {
+ if (mat_old && (mat_old->id.tag & LIB_TAG_DOIT) == 0) {
Material *mat_old = mesh->mat[i];
Material *mat_new = BKE_material_copy(mat_old);
- mat_new->id.flag |= LIB_DOIT;
+ mat_new->id.tag |= LIB_TAG_DOIT;
id_us_min(&mat_old->id);
BLI_remlink(&G.main->mat, mat_new); // BKE_material_copy uses G.main, and there is no BKE_material_copy_ex
diff --git a/source/gameengine/Ketsji/BL_ActionManager.cpp b/source/gameengine/Ketsji/BL_ActionManager.cpp
index 491be035d66..35f605f1a5f 100644
--- a/source/gameengine/Ketsji/BL_ActionManager.cpp
+++ b/source/gameengine/Ketsji/BL_ActionManager.cpp
@@ -28,7 +28,7 @@
#include "BL_ActionManager.h"
#include "DNA_ID.h"
-#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))
+#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT))
BL_ActionManager::BL_ActionManager(class KX_GameObject *obj):
m_obj(obj),
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 046ad25c09c..c43b7be45dc 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -93,7 +93,7 @@ class KX_ObstacleSimulation;
#endif
/* for ID freeing */
-#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))
+#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT))
/**
* The KX_Scene holds all data for an independent scene. It relates