diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-05-20 13:42:23 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-05-20 13:42:23 +0300 |
commit | 5f195acd1ee9a01872b6b5154bf120da23e0d2d5 (patch) | |
tree | b40474506e3082531887c7e3b265629622dbb9a9 /source/gameengine | |
parent | fe0025f2abd70ea8afa1b17307351df000fb86c5 (diff) | |
parent | 8c6a9b9edcd0cdfe00b5d20f3f4d1918467edea8 (diff) |
Merge branch 'master' into gooseberry
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 16 | ||||
-rw-r--r-- | source/gameengine/Expressions/PyObjectPlus.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_WorldInfo.cpp | 16 |
3 files changed, 27 insertions, 11 deletions
diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 1a489c301e2..9e53d9e1569 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -903,7 +903,7 @@ KX_LibLoadStatus *KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openl *err_str = err_local; return NULL; } - + main_newlib = BKE_main_new(); BKE_reports_init(&reports, RPT_STORE); @@ -1218,6 +1218,8 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie) bmat = bl_mat->GetBlenderMaterial(); if (IS_TAGGED(bmat)) { + // Remove the poly material coresponding to this Blender Material. + m_polymat_cache[polymit->first].erase(bmat); delete (*polymit).second; *polymit = m_polymaterials.back(); m_polymaterials.pop_back(); @@ -1233,6 +1235,8 @@ bool KX_BlenderSceneConverter::FreeBlendFile(Main *maggie) for (i = 0, matit = m_materials.begin(); i < size; ) { BL_Material *mat = (*matit).second; if (IS_TAGGED(mat->material)) { + // Remove the bl material coresponding to this Blender Material. + m_mat_cache[matit->first].erase(mat->material); delete (*matit).second; *matit = m_materials.back(); m_materials.pop_back(); @@ -1354,6 +1358,16 @@ bool KX_BlenderSceneConverter::MergeScene(KX_Scene *to, KX_Scene *from) } } + MaterialCache::iterator matcacheit = m_mat_cache.find(from); + // Merge cached BL_Material map. + m_mat_cache[to].insert(matcacheit->second.begin(), matcacheit->second.end()); + m_mat_cache.erase(matcacheit); + + PolyMaterialCache::iterator polymatcacheit = m_polymat_cache.find(from); + // Merge cached RAS_IPolyMaterial map. + m_polymat_cache[to].insert(polymatcacheit->second.begin(), polymatcacheit->second.end()); + m_polymat_cache.erase(polymatcacheit); + return true; } diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index d475152f83e..31a17bd0cbf 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -158,7 +158,8 @@ PyObject *PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject PyObjectPlus_Proxy *base = (PyObjectPlus_Proxy *)PyTuple_GET_ITEM(args, 0); - /* the 'base' PyObject may be subclassed (multiple times even) + /** + * the 'base' PyObject may be subclassed (multiple times even) * we need to find the first C++ defined class to check 'type' * is a subclass of the base arguments type. * @@ -167,12 +168,13 @@ PyObject *PyObjectPlus::py_base_new(PyTypeObject *type, PyObject *args, PyObject * eg. * * # CustomOb is called 'type' in this C code + * \code{.py} * class CustomOb(GameTypes.KX_GameObject): * pass * * # this calls py_base_new(...), the type of 'CustomOb' is checked to be a subclass of the 'cont.owner' type * ob = CustomOb(cont.owner) - * + * \endcode * */ base_type= Py_TYPE(base); while (base_type && !BGE_PROXY_CHECK_TYPE(base_type)) diff --git a/source/gameengine/Ketsji/KX_WorldInfo.cpp b/source/gameengine/Ketsji/KX_WorldInfo.cpp index 21e72504a2b..f6caaf03066 100644 --- a/source/gameengine/Ketsji/KX_WorldInfo.cpp +++ b/source/gameengine/Ketsji/KX_WorldInfo.cpp @@ -232,17 +232,17 @@ PyMethodDef KX_WorldInfo::Methods[] = { }; PyAttributeDef KX_WorldInfo::Attributes[] = { - KX_PYATTRIBUTE_BOOL_RW("mist_enable", KX_WorldInfo, m_hasmist), - KX_PYATTRIBUTE_FLOAT_RW("mist_start", 0.0f, 10000.0f, KX_WorldInfo, m_miststart), - KX_PYATTRIBUTE_FLOAT_RW("mist_distance", 0.001f, 10000.0f, KX_WorldInfo, m_mistdistance), - KX_PYATTRIBUTE_FLOAT_RW("mist_intensity", 0.0f, 1.0f, KX_WorldInfo, m_mistintensity), - KX_PYATTRIBUTE_SHORT_RW("mist_type", 0, 2, true, KX_WorldInfo, m_misttype), + KX_PYATTRIBUTE_BOOL_RW("mistEnable", KX_WorldInfo, m_hasmist), + KX_PYATTRIBUTE_FLOAT_RW("mistStart", 0.0f, 10000.0f, KX_WorldInfo, m_miststart), + KX_PYATTRIBUTE_FLOAT_RW("mistDistance", 0.001f, 10000.0f, KX_WorldInfo, m_mistdistance), + KX_PYATTRIBUTE_FLOAT_RW("mistIntensity", 0.0f, 1.0f, KX_WorldInfo, m_mistintensity), + KX_PYATTRIBUTE_SHORT_RW("mistType", 0, 2, true, KX_WorldInfo, m_misttype), KX_PYATTRIBUTE_RO_FUNCTION("KX_MIST_QUADRATIC", KX_WorldInfo, pyattr_get_mist_typeconst), KX_PYATTRIBUTE_RO_FUNCTION("KX_MIST_LINEAR", KX_WorldInfo, pyattr_get_mist_typeconst), KX_PYATTRIBUTE_RO_FUNCTION("KX_MIST_INV_QUADRATIC", KX_WorldInfo, pyattr_get_mist_typeconst), - KX_PYATTRIBUTE_RW_FUNCTION("mist_color", KX_WorldInfo, pyattr_get_mist_color, pyattr_set_mist_color), - KX_PYATTRIBUTE_RW_FUNCTION("background_color", KX_WorldInfo, pyattr_get_back_color, pyattr_set_back_color), - KX_PYATTRIBUTE_RW_FUNCTION("ambient_color", KX_WorldInfo, pyattr_get_ambient_color, pyattr_set_ambient_color), + KX_PYATTRIBUTE_RW_FUNCTION("mistColor", KX_WorldInfo, pyattr_get_mist_color, pyattr_set_mist_color), + KX_PYATTRIBUTE_RW_FUNCTION("backgroundColor", KX_WorldInfo, pyattr_get_back_color, pyattr_set_back_color), + KX_PYATTRIBUTE_RW_FUNCTION("ambientColor", KX_WorldInfo, pyattr_get_ambient_color, pyattr_set_ambient_color), { NULL } /* Sentinel */ }; |