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:
authorCampbell Barton <ideasman42@gmail.com>2009-04-22 16:16:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-22 16:16:41 +0400
commita8592d09d0173bab0e3eb66a315146e164cf14a4 (patch)
treef73a0f025a2a673ad3d9f22273d02f72225e1e52 /source/gameengine/Ketsji
parentc09b1a985c29e59736eef619e2dae1a1dcf2d73a (diff)
BGE C++ API
Some functions used ProcessReplica(replica); others replica->ProcessReplica() Use the second method everywhere so the PyObjectPlus's ProcessReplica() can be called from its subclasses. Note that PyObjectPlus's ProcessReplica isnt used yet.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_Camera.cpp7
-rw-r--r--source/gameengine/Ketsji/KX_Camera.h9
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp20
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h4
-rw-r--r--source/gameengine/Ketsji/KX_Light.cpp2
5 files changed, 13 insertions, 29 deletions
diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp
index f84ce23b7dd..e1784a4cd37 100644
--- a/source/gameengine/Ketsji/KX_Camera.cpp
+++ b/source/gameengine/Ketsji/KX_Camera.cpp
@@ -72,15 +72,10 @@ CValue* KX_Camera::GetReplica()
// this will copy properties and so on...
CValue::AddDataToReplica(replica);
- ProcessReplica(replica);
+ replica->ProcessReplica();
return replica;
}
-
-void KX_Camera::ProcessReplica(KX_Camera* replica)
-{
- KX_GameObject::ProcessReplica(replica);
-}
MT_Transform KX_Camera::GetWorldToCamera() const
{
diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h
index 6f818cb2c57..d570fac213a 100644
--- a/source/gameengine/Ketsji/KX_Camera.h
+++ b/source/gameengine/Ketsji/KX_Camera.h
@@ -146,15 +146,6 @@ public:
virtual CValue*
GetReplica(
);
-
- /**
- * Inherited from CValue -- Makes sure any internal
- * data owned by this class is deep copied. Called internally
- */
- virtual void
- ProcessReplica(
- KX_Camera* replica
- );
MT_Transform GetWorldToCamera() const;
MT_Transform GetCameraToWorld() const;
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index eb20cfa1131..fe7f96d9fac 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -331,16 +331,16 @@ void KX_GameObject::RemoveParent(KX_Scene *scene)
}
}
-void KX_GameObject::ProcessReplica(KX_GameObject* replica)
-{
- replica->m_pPhysicsController1 = NULL;
- replica->m_pGraphicController = NULL;
- replica->m_pSGNode = NULL;
- replica->m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info);
- replica->m_pClient_info->m_gameobject = replica;
- replica->m_state = 0;
+void KX_GameObject::ProcessReplica()
+{
+ m_pPhysicsController1 = NULL;
+ m_pGraphicController = NULL;
+ m_pSGNode = NULL;
+ m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info);
+ m_pClient_info->m_gameobject = this;
+ m_state = 0;
if(m_attr_dict)
- replica->m_attr_dict= PyDict_Copy(m_attr_dict);
+ m_attr_dict= PyDict_Copy(m_attr_dict);
}
@@ -352,7 +352,7 @@ CValue* KX_GameObject::GetReplica()
// this will copy properties and so on...
CValue::AddDataToReplica(replica);
- ProcessReplica(replica);
+ replica->ProcessReplica();
return replica;
}
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index e81429dff5a..479a3c1b574 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -279,9 +279,7 @@ public:
* data owned by this class is deep copied. Called internally
*/
virtual void
- ProcessReplica(
- KX_GameObject* replica
- );
+ ProcessReplica();
/**
* Return the linear velocity of the game object.
diff --git a/source/gameengine/Ketsji/KX_Light.cpp b/source/gameengine/Ketsji/KX_Light.cpp
index c5189907714..a426953602b 100644
--- a/source/gameengine/Ketsji/KX_Light.cpp
+++ b/source/gameengine/Ketsji/KX_Light.cpp
@@ -85,7 +85,7 @@ CValue* KX_LightObject::GetReplica()
// this will copy properties and so on...
CValue::AddDataToReplica(replica);
- ProcessReplica(replica);
+ replica->ProcessReplica();
replica->m_lightobj.m_worldmatrix = replica->GetOpenGLMatrixPtr();
m_rendertools->AddLight(&replica->m_lightobj);