diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/GameLogic/SCA_TimeEventManager.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_TimeEventManager.h | 1 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 10 |
3 files changed, 17 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp index 8b99fd669a9..ac4aa7eba6d 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.cpp +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.cpp @@ -109,3 +109,9 @@ void SCA_TimeEventManager::RemoveTimeProperty(CValue* timeval) } } } + +vector<CValue*> SCA_TimeEventManager::GetTimeValues() +{ + return m_timevalues; +} + diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h index b2a2eb5fe5d..a3aa994ea37 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.h +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h @@ -49,6 +49,7 @@ public: void AddTimeProperty(CValue* timeval); void RemoveTimeProperty(CValue* timeval); + vector<CValue*> GetTimeValues(); #ifdef WITH_CXX_GUARDEDALLOC public: diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 87cb46e65a9..721d2013e05 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1857,6 +1857,16 @@ bool KX_Scene::MergeScene(KX_Scene *other) /* when merging objects sensors are moved across into the new manager, dont need to do this here */ } + + /* grab any timer properties from the other scene */ + SCA_TimeEventManager *timemgr= GetTimeEventManager(); + SCA_TimeEventManager *timemgr_other= other->GetTimeEventManager(); + vector<CValue*> times = timemgr_other->GetTimeValues(); + + for(unsigned int i= 0; i < times.size(); i++) { + timemgr->AddTimeProperty(times[i]); + } + } return true; } |