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:
authorMitchell Stokes <mogurijin@gmail.com>2013-05-15 02:52:10 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-05-15 02:52:10 +0400
commitbb7b04bd94ee167e9561fe8b8914e3f126dd8abf (patch)
tree8832aa91513fbce98e59a0a5378ddcdf3da9d56f /source/gameengine
parent50c46fb9b3d1c6c423c0e6bf90a1bbc2e571c4bd (diff)
BGE: A little bit of cleanup:
* Removing KX_Scene::RemoveAnimatedObject() since KX_Scene::NewRemoveObject() is already handling this. * Don't create a new BL_ActionManager when replicating an object. Just set m_actionManager to NULL and let KX_GameObject::GetActionManager() allocate a new BL_ActionManager when one is needed. * Use KX_GameObject::GetScene() instead of KX_GetActiveScene() in KX_GameObject::GetActionManager() to make sure we're using the object's scene instead of one where Python might currently be running from. This could avoid potential issues with playing actions for objects in other scenes.
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h1
3 files changed, 2 insertions, 10 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index f52ee0c42c3..91488eb684a 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -165,7 +165,6 @@ KX_GameObject::~KX_GameObject()
if (m_actionManager)
{
- KX_GetActiveScene()->RemoveAnimatedObject(this);
delete m_actionManager;
}
@@ -413,7 +412,7 @@ BL_ActionManager* KX_GameObject::GetActionManager()
// We only want to create an action manager if we need it
if (!m_actionManager)
{
- KX_GetActiveScene()->AddAnimatedObject(this);
+ GetScene()->AddAnimatedObject(this);
m_actionManager = new BL_ActionManager(this);
}
return m_actionManager;
@@ -482,8 +481,7 @@ void KX_GameObject::ProcessReplica()
m_pSGNode = NULL;
m_pClient_info = new KX_ClientObjectInfo(*m_pClient_info);
m_pClient_info->m_gameobject = this;
- if (m_actionManager)
- m_actionManager = new BL_ActionManager(this);
+ m_actionManager = NULL;
m_state = 0;
KX_Scene* scene = KX_GetActiveScene();
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index adc0aa194af..8bb9eaeef10 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1558,11 +1558,6 @@ void KX_Scene::AddAnimatedObject(CValue* gameobj)
m_animatedlist->Add(gameobj);
}
-void KX_Scene::RemoveAnimatedObject(CValue* gameobj)
-{
- m_animatedlist->RemoveValue(gameobj);
-}
-
void KX_Scene::UpdateAnimations(double curtime)
{
// Update any animations
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 29473949535..632e1bf9b50 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -339,7 +339,6 @@ public:
void* meshob, bool use_gfx, bool use_phys);
void AddAnimatedObject(CValue* gameobj);
- void RemoveAnimatedObject(CValue* gameobj);
/**
* \section Logic stuff