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:
authorMitchell Stokes <mogurijin@gmail.com>2012-12-24 07:13:53 +0400
committerMitchell Stokes <mogurijin@gmail.com>2012-12-24 07:13:53 +0400
commita1c9241797b003979c1da747e217e875c497c775 (patch)
treef5be743fa99e6ea7236e848b0f1d04f5c5d5772a /source/gameengine/Converter/KX_BlenderSceneConverter.cpp
parent119665d5b7b61f1924b4f0bf89fe1cff00017eed (diff)
BGE: "Fix" for issue [#33663] "Objects Share Materials / Textures When Grouped In SingleTexture / MultiTexture Mode" reported by Josiah Lane (solarlune).
This commit adds a UI option in the Render properties to enable the new material caching in the converter. This caching can cause problems with Singletexture and Multitexture materials when texface is being used to handle materials. By default this option is enabled and users with broken games have two options: 1) Fix up their materials so they are properly using textures 2) Disable the material caching and take a speed hit during conversion time Regardless of the setting, caching is always enabled for GLSL materials.
Diffstat (limited to 'source/gameengine/Converter/KX_BlenderSceneConverter.cpp')
-rw-r--r--source/gameengine/Converter/KX_BlenderSceneConverter.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
index ceaa0a5f5a8..5524612f707 100644
--- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
+++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
@@ -131,7 +131,8 @@ KX_BlenderSceneConverter::KX_BlenderSceneConverter(
m_ketsjiEngine(engine),
m_alwaysUseExpandFraming(false),
m_usemat(false),
- m_useglslmat(false)
+ m_useglslmat(false),
+ m_use_mat_cache(true)
{
tag_main(maggie, 0); /* avoid re-tagging later on */
m_newfilename = "";
@@ -488,6 +489,11 @@ void KX_BlenderSceneConverter::SetGLSLMaterials(bool val)
m_useglslmat = val;
}
+void KX_BlenderSceneConverter::SetCacheMaterials(bool val)
+{
+ m_use_mat_cache = val;
+}
+
bool KX_BlenderSceneConverter::GetMaterials()
{
return m_usemat;
@@ -498,6 +504,11 @@ bool KX_BlenderSceneConverter::GetGLSLMaterials()
return m_useglslmat;
}
+bool KX_BlenderSceneConverter::GetCacheMaterials()
+{
+ return m_use_mat_cache;
+}
+
void KX_BlenderSceneConverter::RegisterBlenderMaterial(BL_Material *mat)
{
// First make sure we don't register the material twice