[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19664] trunk/blender/source/gameengine/ Ketsji/KX_Scene.cpp: bugfix from Moguri, AddReplica wasnt setting the light layer from the parent

Campbell Barton ideasman42 at gmail.com
Sat Apr 11 17:59:12 CEST 2009


Revision: 19664
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19664
Author:   campbellbarton
Date:     2009-04-11 17:59:11 +0200 (Sat, 11 Apr 2009)

Log Message:
-----------
bugfix from Moguri, AddReplica wasnt setting the light layer from the parent

Modified Paths:
--------------
    trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp	2009-04-11 15:55:07 UTC (rev 19663)
+++ trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp	2009-04-11 15:59:11 UTC (rev 19664)
@@ -91,6 +91,8 @@
 #include "CcdPhysicsController.h"
 #endif
 
+#include "KX_Light.h"
+
 void* KX_SceneReplicationFunc(SG_IObject* node,void* gameobj,void* scene)
 {
 	KX_GameObject* replica = ((KX_Scene*)scene)->AddNodeReplicaObject(node,(KX_GameObject*)gameobj);
@@ -741,6 +743,12 @@
 		(*git)->Relink(&m_map_gameobject_to_replica);
 		// add the object in the layer of the parent
 		(*git)->SetLayer(groupobj->GetLayer());
+		// If the object was a light, we need to update it's RAS_LightObject as well
+		if ((*git)->IsLight())
+		{
+			KX_LightObject* lightobj = static_cast<KX_LightObject*>(*git);
+			lightobj->GetLightData()->m_layer = groupobj->GetLayer();
+		}
 	}
 
 	// replicate crosslinks etc. between logic bricks
@@ -841,6 +849,12 @@
 		(*git)->Relink(&m_map_gameobject_to_replica);
 		// add the object in the layer of the parent
 		(*git)->SetLayer(parentobj->GetLayer());
+		// If the object was a light, we need to update it's RAS_LightObject as well
+		if ((*git)->IsLight())
+		{
+			KX_LightObject* lightobj = static_cast<KX_LightObject*>(*git);
+			lightobj->GetLightData()->m_layer = parentobj->GetLayer();
+		}
 	}
 
 	// replicate crosslinks etc. between logic bricks





More information about the Bf-blender-cvs mailing list