diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-03-10 10:41:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-03-10 10:41:16 +0300 |
commit | b9211135ef9911678b776ed202f6ee4d0a73833b (patch) | |
tree | 9ddf13528fa12cd4a05f40978f6b2b6123695f6f /source/gameengine/Ketsji | |
parent | f137c4535a4bdc11b4d273fb9683ae4d35cd8dfd (diff) |
[#21261] Bugfix for dynamically loaded scenes' lights not mixing in multitexture
from Mitchell Stokes (moguri)
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_Light.h | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h index c31f33f26ae..334aed1995d 100644 --- a/source/gameengine/Ketsji/KX_Light.h +++ b/source/gameengine/Ketsji/KX_Light.h @@ -65,6 +65,8 @@ public: void UnbindShadowBuffer(class RAS_IRasterizer *ras); void Update(); + void UpdateScene(class KX_Scene *kxscene) {m_lightobj.m_scene = (void*)kxscene;} + virtual int GetGameObjectType() { return OBJ_LIGHT; } #ifndef DISABLE_PYTHON diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 3547a6db545..a5512c2e34a 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1754,6 +1754,9 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene phys_ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); } } + /* If the object is a light, update it's scene */ + if (gameobj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT) + ((KX_LightObject*)gameobj)->UpdateScene(to); /* Add the object to the scene's logic manager */ to->GetLogicManager()->RegisterGameObjectName(gameobj->GetName(), gameobj); |