- Timestamp:
- Jul 24, 2008, 10:40:22 PM (16 years ago)
- Location:
- code/branches/gui
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/Loader.cc
r1625 r1646 64 64 void Loader::add(const Level* level, const ClassTreeMask& mask) 65 65 { 66 if (!level) 67 return; 66 68 Loader::levels_s.insert(Loader::levels_s.end(), std::pair<const Level*, ClassTreeMask>(level, mask)); 67 69 } … … 69 71 void Loader::remove(const Level* level) 70 72 { 73 if (!level) 74 return; 71 75 for (std::vector<std::pair<const Level*, ClassTreeMask> >::iterator it = Loader::levels_s.begin(); it != Loader::levels_s.end(); ++it) 72 76 { … … 108 112 bool Loader::load(const Level* level, const ClassTreeMask& mask) 109 113 { 114 if (!level) 115 return false; 116 110 117 Loader::currentMask_s = level->getMask() * mask; 111 118 … … 165 172 void Loader::unload(const Level* level, const ClassTreeMask& mask) 166 173 { 174 if (!level) 175 return; 167 176 for (Iterator<BaseObject> it = ObjectList<BaseObject>::begin(); it; ) 168 177 { -
code/branches/gui/src/core/input/ExtendedInputState.h
r1642 r1646 47 47 class _CoreExport ExtendedInputState : public InputState 48 48 { 49 friend class InputManager; 50 friend class ClassFactory<ExtendedInputState>; 51 49 52 public: 50 ExtendedInputState();51 ~ExtendedInputState() { }52 53 53 bool addKeyHandler (KeyHandler* handler); 54 54 bool removeKeyHandler (KeyHandler* handler); … … 68 68 69 69 private: 70 ExtendedInputState(); 71 ~ExtendedInputState() { } 72 70 73 void tickInput(float dt); 71 74 void tickInput(float dt, unsigned int device); -
code/branches/gui/src/core/input/InputManager.cc
r1645 r1646 429 429 (*rit).second->onLeave(); 430 430 } 431 activeStates_.clear();432 _updateActiveStates();431 //activeStates_.clear(); 432 //_updateActiveStates(); 433 433 434 434 // destroy all input states … … 438 438 } 439 439 440 stateEmpty_ = 0;441 stateCalibrator_ = 0;442 stateDetector_ = 0;440 //stateEmpty_ = 0; 441 //stateCalibrator_ = 0; 442 //stateDetector_ = 0; 443 443 444 444 // destroy the devices … … 448 448 449 449 // 0 joy sticks now 450 _redimensionLists();450 //_redimensionLists(); 451 451 452 452 OIS::InputManager::destroyInputSystem(inputSystem_); 453 inputSystem_ = 0;453 //inputSystem_ = 0; 454 454 455 455 CCOUT(3) << "Destroying done." << std::endl; … … 509 509 { 510 510 assert(state); 511 std::map<int, InputState*>::iterator it = this->activeStates_.find(state->getPriority()); 512 if (it != this->activeStates_.end()) 513 { 514 this->activeStates_.erase(it); 515 _updateActiveStates(); 516 } 511 517 inputStatesByPriority_.erase(state->getPriority()); 512 518 inputStatesByName_.erase(state->getName()); -
code/branches/gui/src/core/input/InputState.h
r1642 r1646 51 51 52 52 public: 53 InputState() : priority_(0), executorOnEnter_(0), executorOnLeave_(0)54 { RegisterObject(InputState); }55 virtual ~InputState() { }56 57 53 const std::string& getName() const { return name_; } 58 54 int getPriority() const { return priority_; } … … 93 89 94 90 protected: 91 InputState() : priority_(0), executorOnEnter_(0), executorOnLeave_(0) 92 { RegisterObject(InputState); } 93 virtual ~InputState() { } 94 95 95 virtual void numberOfJoySticksChanged(unsigned int n) = 0; 96 96 void setInputDeviceEnabled(unsigned int device, bool bEnabled) -
code/branches/gui/src/core/input/SimpleInputState.h
r1642 r1646 45 45 class _CoreExport SimpleInputState : public InputState 46 46 { 47 friend class InputManager; 48 friend class ClassFactory<SimpleInputState>; 49 47 50 public: 48 SimpleInputState();49 ~SimpleInputState() { }50 51 51 void setKeyHandler (KeyHandler* handler) { keyHandler_ = handler; update(); } 52 52 void setMouseHandler (MouseHandler* handler) { mouseHandler_ = handler; update(); } … … 57 57 58 58 private: 59 SimpleInputState(); 60 ~SimpleInputState() { } 61 59 62 void tickInput(float dt); 60 63 void tickInput(float dt, unsigned int device); -
code/branches/gui/src/orxonox/Orxonox.cc
r1645 r1646 115 115 , inputManager_(0) 116 116 , radar_(0) 117 , console_(0) 118 , guiManager_(0) 117 119 { 118 120 RegisterRootObject(Orxonox); … … 142 144 if (this->radar_) 143 145 delete this->radar_; 146 147 if (this->guiManager_) 148 delete guiManager_; 144 149 145 150 //if (this->auMan_) … … 271 276 272 277 // load the CEGUI interface 273 GUIManager::getInstance().initialise(); 278 guiManager_ = new GUIManager(); 279 guiManager_->initialise(); 274 280 } 275 281 -
code/branches/gui/src/orxonox/Orxonox.h
r1642 r1646 103 103 Radar* radar_; //!< represents the Radar (not the HUD part) 104 104 InGameConsole* console_; 105 GUIManager* guiManager_; 105 106 106 107 static Orxonox *singletonRef_s; -
code/branches/gui/src/orxonox/OrxonoxPrereqs.h
r1625 r1646 118 118 class OverlayGroup; 119 119 class OverlayText; 120 121 //gui 122 class GUIManager; 120 123 } 121 124 -
code/branches/gui/src/orxonox/gui/GUIManager.cc
r1645 r1646 58 58 SetConsoleCommandShortcut(GUIManager, showGUI_s).setKeybindMode(KeybindMode::OnPress); 59 59 60 GUIManager* GUIManager::singletonRef_s = 0; 61 60 62 GUIManager::GUIManager() 61 63 //: emptySceneManager_(0) … … 71 73 , state_(Uninitialised) 72 74 { 75 assert(singletonRef_s == 0); 76 singletonRef_s = this; 73 77 } 74 78 75 79 GUIManager::~GUIManager() 76 80 { 77 // TODO: destruct at least something 81 if (backgroundCamera_) 82 backgroundSceneManager_->destroyCamera(backgroundCamera_); 83 84 if (backgroundSceneManager_) 85 Ogre::Root::getSingleton().destroySceneManager(backgroundSceneManager_); 86 87 InputManager::getInstance().destroyState("gui"); 88 89 if (guiSystem_) 90 delete guiSystem_; 91 92 if (scriptModule_) 93 { 94 // destroy our own tolua interfaces 95 //lua_pushnil(luaState_); 96 //lua_setglobal(luaState_, "Orxonox"); 97 //lua_pushnil(luaState_); 98 //lua_setglobal(luaState_, "Core"); 99 // TODO: deleting the script module fails an assertation. 100 // However there is not much we can do about it since it occurs too when 101 // we don't open Core or Orxonox. Might be a CEGUI issue. 102 // The memory leak is not a problem anyway.. 103 //delete scriptModule_; 104 } 105 106 if (guiRenderer_) 107 delete guiRenderer_; 108 109 singletonRef_s = 0; 78 110 } 79 111 … … 104 136 // setup scripting 105 137 this->scriptModule_ = new LuaScriptModule(); 138 this->luaState_ = this->scriptModule_->getLuaState(); 106 139 107 140 // create the CEGUI system singleton … … 267 300 268 301 269 /**270 @brief271 Returns a unique instance of GUIManager.272 @return273 The instance274 */275 GUIManager& GUIManager::getInstance()276 {277 static GUIManager instance;278 return instance;279 }280 281 302 inline CEGUI::MouseButton GUIManager::convertButton(MouseButton::Enum button) 282 303 { -
code/branches/gui/src/orxonox/gui/GUIManager.h
r1641 r1646 48 48 class LuaScriptModule; 49 49 } 50 struct lua_State; 50 51 51 52 namespace orxonox // tolua_export … … 68 69 }; 69 70 71 GUIManager(); 72 ~GUIManager(); 73 70 74 bool initialise(); 71 75 void tick(float dt); … … 75 79 Ogre::Camera* getCamera() { return this->backgroundCamera_; } 76 80 77 static GUIManager& getInstance(); // tolua_export78 81 static void showGUI_s(const std::string& name, Ogre::SceneManager* sceneManager)//bool showBackground) 79 82 { … … 81 84 } 82 85 86 static GUIManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; } // tolua_export 87 static GUIManager* getInstancePtr() { return singletonRef_s; } 88 83 89 private: 84 GUIManager();85 90 GUIManager(const GUIManager& instance); 86 ~GUIManager();87 91 88 92 void keyPressed (const KeyEvent& evt) … … 119 123 CEGUI::System* guiSystem_; 120 124 CEGUI::Imageset* backgroundImage_; 125 lua_State* luaState_; 121 126 122 127 State state_; 123 128 129 static CEGUI::MouseButton convertButton(MouseButton::Enum button); 124 130 125 static CEGUI::MouseButton convertButton(MouseButton::Enum button);131 static GUIManager* singletonRef_s; 126 132 }; // tolua_export 127 133 -
code/branches/gui/visual_studio/core_properties.vsprops
r1642 r1646 13 13 <Tool 14 14 Name="VCLinkerTool" 15 AdditionalDependencies="OgreMain$(CSS).lib lua-5.1.3$(CS).lib tcl85t.lib"15 AdditionalDependencies="OgreMain$(CSS).lib tcl85t.lib lua-5.1.3$(CS).lib" 16 16 /> 17 17 </VisualStudioPropertySheet> -
code/branches/gui/visual_studio/orxonox_vc8.sln
r1638 r1646 10 10 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tolua", "vc8\tolua.vcproj", "{35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}" 11 11 EndProject 12 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = " audio", "vc8\audio.vcproj", "{4733BD1A-E04C-458D-8BFB-5010250EA497}"12 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tolua_gen", "vc8\tolua_gen.vcproj", "{71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}" 13 13 ProjectSection(ProjectDependencies) = postProject 14 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86} 15 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC} 14 {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626} = {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626} 16 15 EndProjectSection 17 16 EndProject … … 23 22 EndProject 24 23 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "vc8\util.vcproj", "{2240ECD7-2F48-4431-8E1B-25466A384CCC}" 25 ProjectSection(ProjectDependencies) = postProject26 {F101C2F0-1CB9-4A57-827B-6C399A99B28F} = {F101C2F0-1CB9-4A57-827B-6C399A99B28F}27 EndProjectSection28 24 EndProject 29 25 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "vc8\core.vcproj", "{271715F3-5B90-4110-A552-70C788084A86}" 30 26 ProjectSection(ProjectDependencies) = postProject 27 {F101C2F0-1CB9-4A57-827B-6C399A99B28F} = {F101C2F0-1CB9-4A57-827B-6C399A99B28F} 28 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC} 29 {9CC704CB-4956-4479-BDEC-57CBC03F700E} = {9CC704CB-4956-4479-BDEC-57CBC03F700E} 30 {53C56131-E2AA-4A27-B460-7AC05D61A0E6} = {53C56131-E2AA-4A27-B460-7AC05D61A0E6} 31 31 {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626} = {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626} 32 {53C56131-E2AA-4A27-B460-7AC05D61A0E6} = {53C56131-E2AA-4A27-B460-7AC05D61A0E6} 33 {A0724246-CB7C-420B-BCF0-68EF205AFE34} = {A0724246-CB7C-420B-BCF0-68EF205AFE34} 34 {9CC704CB-4956-4479-BDEC-57CBC03F700E} = {9CC704CB-4956-4479-BDEC-57CBC03F700E} 32 EndProjectSection 33 EndProject 34 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "audio", "vc8\audio.vcproj", "{4733BD1A-E04C-458D-8BFB-5010250EA497}" 35 ProjectSection(ProjectDependencies) = postProject 36 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86} 35 37 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC} 36 {F101C2F0-1CB9-4A57-827B-6C399A99B28F} = {F101C2F0-1CB9-4A57-827B-6C399A99B28F}37 38 EndProjectSection 38 39 EndProject 39 40 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "network", "vc8\network.vcproj", "{35575B59-E1AE-40E8-89C4-2862B5B09B68}" 40 41 ProjectSection(ProjectDependencies) = postProject 42 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86} 41 43 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC} 42 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86}43 44 EndProjectSection 44 45 EndProject … … 46 47 ProjectSection(ProjectDependencies) = postProject 47 48 {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626} = {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626} 48 {35575B59-E1AE-40E8-89C4-2862B5B09B68} = {35575B59-E1AE-40E8-89C4-2862B5B09B68}49 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}50 49 {F101C2F0-1CB9-4A57-827B-6C399A99B28F} = {F101C2F0-1CB9-4A57-827B-6C399A99B28F} 51 50 {271715F3-5B90-4110-A552-70C788084A86} = {271715F3-5B90-4110-A552-70C788084A86} 51 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC} 52 {35575B59-E1AE-40E8-89C4-2862B5B09B68} = {35575B59-E1AE-40E8-89C4-2862B5B09B68} 52 53 {4733BD1A-E04C-458D-8BFB-5010250EA497} = {4733BD1A-E04C-458D-8BFB-5010250EA497} 53 EndProjectSection54 EndProject55 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tolua_gen", "vc8\tolua_gen.vcproj", "{71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}"56 ProjectSection(ProjectDependencies) = postProject57 {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626} = {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}58 54 EndProjectSection 59 55 EndProject … … 80 76 {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.Release|Win32.ActiveCfg = Release|Win32 81 77 {35E36A06-0A5C-4A0D-9AB6-5A05EAA87626}.Release|Win32.Build.0 = Release|Win32 82 { 4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.ActiveCfg = Debug|Win3283 { 4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.Build.0 = Debug|Win3284 { 4733BD1A-E04C-458D-8BFB-5010250EA497}.Release|Win32.ActiveCfg = Release|Win3285 { 4733BD1A-E04C-458D-8BFB-5010250EA497}.Release|Win32.Build.0 = Release|Win3278 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Debug|Win32.ActiveCfg = Debug|Win32 79 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Debug|Win32.Build.0 = Debug|Win32 80 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Release|Win32.ActiveCfg = Release|Win32 81 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Release|Win32.Build.0 = Release|Win32 86 82 {A0724246-CB7C-420B-BCF0-68EF205AFE34}.Debug|Win32.ActiveCfg = Debug|Win32 87 83 {A0724246-CB7C-420B-BCF0-68EF205AFE34}.Debug|Win32.Build.0 = Debug|Win32 … … 96 92 {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.ActiveCfg = Release|Win32 97 93 {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.Build.0 = Release|Win32 94 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.ActiveCfg = Debug|Win32 95 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Debug|Win32.Build.0 = Debug|Win32 96 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Release|Win32.ActiveCfg = Release|Win32 97 {4733BD1A-E04C-458D-8BFB-5010250EA497}.Release|Win32.Build.0 = Release|Win32 98 98 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.ActiveCfg = Debug|Win32 99 99 {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.Build.0 = Debug|Win32 … … 104 104 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Release|Win32.ActiveCfg = Release|Win32 105 105 {0B6C5CFD-F91B-432A-80A3-2610F61E060B}.Release|Win32.Build.0 = Release|Win32 106 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Debug|Win32.ActiveCfg = Debug|Win32107 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Debug|Win32.Build.0 = Debug|Win32108 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Release|Win32.ActiveCfg = Release|Win32109 {71FC0211-5EB5-4637-BE8A-A48EC3CC27D0}.Release|Win32.Build.0 = Release|Win32110 106 EndGlobalSection 111 107 GlobalSection(SolutionProperties) = preSolution -
code/branches/gui/visual_studio/util_properties.vsprops
r1084 r1646 8 8 <Tool 9 9 Name="VCCLCompilerTool" 10 AdditionalOptions="/MP2" 10 11 PreprocessorDefinitions="UTIL_SHARED_BUILD" 11 12 />
Note: See TracChangeset
for help on using the changeset viewer.