From f6d27e73eee3cfdbe090bb1d34372d976ba079bb Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Wed, 22 Apr 2009 16:58:04 +0000 Subject: [PATCH] BGE: some more cleanup, remove useless ReplicaSetName(), move code to ProcessReplica. --- source/gameengine/Expressions/Value.cpp | 2 -- source/gameengine/Expressions/Value.h | 9 ++++----- source/gameengine/GameLogic/SCA_ILogicBrick.cpp | 8 -------- source/gameengine/GameLogic/SCA_ILogicBrick.h | 1 - source/gameengine/Ketsji/KX_GameObject.cpp | 15 --------------- source/gameengine/Ketsji/KX_GameObject.h | 8 -------- source/gameengine/Ketsji/KX_MeshProxy.cpp | 1 - source/gameengine/Ketsji/KX_MeshProxy.h | 1 - source/gameengine/Ketsji/KX_PolyProxy.cpp | 2 -- source/gameengine/Ketsji/KX_PolyProxy.h | 1 - source/gameengine/Ketsji/KX_VertexProxy.cpp | 2 -- source/gameengine/Ketsji/KX_VertexProxy.h | 1 - 12 files changed, 4 insertions(+), 47 deletions(-) diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index b5aca518e88..b86fbe0b163 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -524,8 +524,6 @@ void CValue::ProcessReplica() /* was AddDataToReplica in 2.48 */ m_ValFlags.RefCountDisabled = false; - ReplicaSetName(GetName()); - /* copy all props */ if (m_pNamedPropertyArray) { diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index cc791351d8a..065fe62d978 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -294,7 +294,6 @@ public: virtual STR_String GetName() = 0; // Retrieve the name of the value virtual void SetName(STR_String name) = 0; // Set the name of the value - virtual void ReplicaSetName(STR_String name) = 0; /** Sets the value to this cvalue. * @attention this particular function should never be called. Why not abstract? */ virtual void SetValue(CValue* newval); @@ -410,10 +409,10 @@ public: if (name.Length()) m_pstrNewName = new STR_String(name); } - virtual void ReplicaSetName(STR_String name) { - m_pstrNewName=NULL; - if (name.Length()) - m_pstrNewName = new STR_String(name); + virtual void ProcessReplica() { + CValue::ProcessReplica(); + if (m_pstrNewName) + m_pstrNewName = new STR_String(*m_pstrNewName); } virtual STR_String GetName() { diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 02a25916299..ec3651ddd1f 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -143,14 +143,6 @@ void SCA_ILogicBrick::SetName(STR_String name) } - -void SCA_ILogicBrick::ReplicaSetName(STR_String name) -{ - m_name = name; -} - - - bool SCA_ILogicBrick::IsActive() { return m_bActive; diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index f2353741d39..b8c6772fe8d 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -72,7 +72,6 @@ public: virtual double GetNumber(); virtual STR_String GetName(); virtual void SetName(STR_String name); - virtual void ReplicaSetName(STR_String name); bool IsActive(); void SetActive(bool active) ; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 8bd1e008336..ecc887eb567 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -199,26 +199,11 @@ void KX_GameObject::SetName(STR_String name) m_name = name; }; // Set the name of the value - - -void KX_GameObject::ReplicaSetName(STR_String name) -{ -} - - - - - - KX_IPhysicsController* KX_GameObject::GetPhysicsController() { return m_pPhysicsController1; } - - - - KX_GameObject* KX_GameObject::GetParent() { KX_GameObject* result = NULL; diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 479a3c1b574..2ca4fc6a63f 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -257,14 +257,6 @@ public: STR_String name ); - /** - * Inherited from CValue -- does nothing. - */ - void - ReplicaSetName( - STR_String name - ); - /** * Inherited from CValue -- return a new copy of this * instance allocated on the heap. Ownership of the new diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index 65b163106c9..75e46da072e 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -138,7 +138,6 @@ double KX_MeshProxy::GetNumber() { return -1;} STR_String KX_MeshProxy::GetName() { return m_meshobj->GetName();} void KX_MeshProxy::SetName(STR_String name) { }; CValue* KX_MeshProxy::GetReplica() { return NULL;} -void KX_MeshProxy::ReplicaSetName(STR_String name) {}; // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index ce9e8fc39c5..f775c963c1e 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -53,7 +53,6 @@ public: virtual RAS_MeshObject* GetMesh() { return m_meshobj; } virtual STR_String GetName(); virtual void SetName(STR_String name); // Set the name of the value - virtual void ReplicaSetName(STR_String name); virtual CValue* GetReplica(); // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index fefea232e99..0ab55a86078 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -183,8 +183,6 @@ double KX_PolyProxy::GetNumber() { return -1;} STR_String KX_PolyProxy::GetName() { return sPolyName;} void KX_PolyProxy::SetName(STR_String) { }; CValue* KX_PolyProxy::GetReplica() { return NULL;} -void KX_PolyProxy::ReplicaSetName(STR_String) {}; - // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_PolyProxy.h b/source/gameengine/Ketsji/KX_PolyProxy.h index 88a06850ee0..223193ec519 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.h +++ b/source/gameengine/Ketsji/KX_PolyProxy.h @@ -48,7 +48,6 @@ public: double GetNumber(); STR_String GetName(); void SetName(STR_String name); // Set the name of the value - void ReplicaSetName(STR_String name); CValue* GetReplica(); diff --git a/source/gameengine/Ketsji/KX_VertexProxy.cpp b/source/gameengine/Ketsji/KX_VertexProxy.cpp index e5078bfa18b..6b2507b8b31 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.cpp +++ b/source/gameengine/Ketsji/KX_VertexProxy.cpp @@ -340,8 +340,6 @@ double KX_VertexProxy::GetNumber() { return -1;} STR_String KX_VertexProxy::GetName() { return sVertexName;} void KX_VertexProxy::SetName(STR_String) { }; CValue* KX_VertexProxy::GetReplica() { return NULL;} -void KX_VertexProxy::ReplicaSetName(STR_String) {}; - // stuff for python integration diff --git a/source/gameengine/Ketsji/KX_VertexProxy.h b/source/gameengine/Ketsji/KX_VertexProxy.h index 50fe6b27704..81dd0d222a7 100644 --- a/source/gameengine/Ketsji/KX_VertexProxy.h +++ b/source/gameengine/Ketsji/KX_VertexProxy.h @@ -49,7 +49,6 @@ public: double GetNumber(); STR_String GetName(); void SetName(STR_String name); // Set the name of the value - void ReplicaSetName(STR_String name); CValue* GetReplica();