diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2013-06-18 08:15:27 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2013-06-18 08:15:27 +0400 |
commit | 1f785cc196632d0c1fea48507d44fb1b5843ae5d (patch) | |
tree | 0761293213f393493704ab69553486cf62f22813 /source/gameengine/Ketsji | |
parent | 5bd5e69e9819f22dc69a1a3aaf577e1ba8c32754 (diff) |
BGE: Fix for [#32218] "logic.addScene() Not Adding Scenes in Order" reported by Josiah Lane (solarlune).
Adding scenes now uses a vector instead of a set to maintain order. This fix is partly based off of patch #32297 by Pavel Sadikov (sigmat).
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 14 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.h | 9 |
2 files changed, 11 insertions, 12 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 01b726a8e3f..f02e842ad2e 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -1649,10 +1649,10 @@ void KX_KetsjiEngine::ConvertAndAddScene(const STR_String& scenename,bool overla } else { if (overlay) { - m_addingOverlayScenes.insert(scenename); + m_addingOverlayScenes.push_back(scenename); } else { - m_addingBackgroundScenes.insert(scenename); + m_addingBackgroundScenes.push_back(scenename); } } } @@ -1664,7 +1664,7 @@ void KX_KetsjiEngine::RemoveScene(const STR_String& scenename) { if (FindScene(scenename)) { - m_removingScenes.insert(scenename); + m_removingScenes.push_back(scenename); } else { @@ -1679,7 +1679,7 @@ void KX_KetsjiEngine::RemoveScheduledScenes() { if (m_removingScenes.size()) { - set<STR_String>::iterator scenenameit; + vector<STR_String>::iterator scenenameit; for (scenenameit=m_removingScenes.begin();scenenameit != m_removingScenes.end();scenenameit++) { STR_String scenename = *scenenameit; @@ -1725,7 +1725,7 @@ KX_Scene* KX_KetsjiEngine::CreateScene(const STR_String& scenename) void KX_KetsjiEngine::AddScheduledScenes() { - set<STR_String>::iterator scenenameit; + vector<STR_String>::iterator scenenameit; if (m_addingOverlayScenes.size()) { @@ -1761,7 +1761,7 @@ void KX_KetsjiEngine::AddScheduledScenes() void KX_KetsjiEngine::ReplaceScene(const STR_String& oldscene,const STR_String& newscene) { - m_replace_scenes.insert(std::make_pair(oldscene,newscene)); + m_replace_scenes.push_back(std::make_pair(oldscene,newscene)); } // replace scene is not the same as removing and adding because the @@ -1772,7 +1772,7 @@ void KX_KetsjiEngine::ReplaceScheduledScenes() { if (m_replace_scenes.size()) { - set<pair<STR_String,STR_String> >::iterator scenenameit; + vector<pair<STR_String,STR_String> >::iterator scenenameit; for (scenenameit = m_replace_scenes.begin(); scenenameit != m_replace_scenes.end(); diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 0d7e41d7568..3cba3558db3 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -41,7 +41,6 @@ #include "KX_Python.h" #include "KX_WorldInfo.h" #include <vector> -#include <set> class KX_TimeCategoryLogger; @@ -88,13 +87,13 @@ private: class KX_Dome* m_dome; // dome stereo mode /** Lists of scenes scheduled to be removed at the end of the frame. */ - std::set<STR_String> m_removingScenes; + std::vector<STR_String> m_removingScenes; /** Lists of overley scenes scheduled to be added at the end of the frame. */ - std::set<STR_String> m_addingOverlayScenes; + std::vector<STR_String> m_addingOverlayScenes; /** Lists of background scenes scheduled to be added at the end of the frame. */ - std::set<STR_String> m_addingBackgroundScenes; + std::vector<STR_String> m_addingBackgroundScenes; /** Lists of scenes scheduled to be replaced at the end of the frame. */ - std::set<std::pair<STR_String,STR_String> > m_replace_scenes; + std::vector<std::pair<STR_String,STR_String> > m_replace_scenes; /* The current list of scenes. */ KX_SceneList m_scenes; |