[#21261] Bugfix for dynamically loaded scenes' lights not mixing in multitexture

from Mitchell Stokes (moguri)
This commit is contained in:
Campbell Barton 2010-03-10 07:41:16 +00:00
parent f137c4535a
commit b9211135ef
2 changed files with 5 additions and 0 deletions

@ -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

@ -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);