[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56808] trunk/blender/source/gameengine/ Ketsji: BGE: A little bit of cleanup:
Mitchell Stokes
mogurijin at gmail.com
Wed May 15 00:52:10 CEST 2013
Revision: 56808
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56808
Author: moguri
Date: 2013-05-14 22:52:10 +0000 (Tue, 14 May 2013)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp
trunk/blender/source/gameengine/Ketsji/KX_Scene.h
Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp 2013-05-14 22:51:11 UTC (rev 56807)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp 2013-05-14 22:52:10 UTC (rev 56808)
@@ -165,7 +165,6 @@
if (m_actionManager)
{
- KX_GetActiveScene()->RemoveAnimatedObject(this);
delete m_actionManager;
}
@@ -413,7 +412,7 @@
// 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 @@
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();
Modified: trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp 2013-05-14 22:51:11 UTC (rev 56807)
+++ trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp 2013-05-14 22:52:10 UTC (rev 56808)
@@ -1558,11 +1558,6 @@
m_animatedlist->Add(gameobj);
}
-void KX_Scene::RemoveAnimatedObject(CValue* gameobj)
-{
- m_animatedlist->RemoveValue(gameobj);
-}
-
void KX_Scene::UpdateAnimations(double curtime)
{
// Update any animations
Modified: trunk/blender/source/gameengine/Ketsji/KX_Scene.h
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_Scene.h 2013-05-14 22:51:11 UTC (rev 56807)
+++ trunk/blender/source/gameengine/Ketsji/KX_Scene.h 2013-05-14 22:52:10 UTC (rev 56808)
@@ -339,7 +339,6 @@
void* meshob, bool use_gfx, bool use_phys);
void AddAnimatedObject(CValue* gameobj);
- void RemoveAnimatedObject(CValue* gameobj);
/**
* \section Logic stuff
More information about the Bf-blender-cvs
mailing list