Changeset 1688 for code/branches/gui/src/orxonox
- Timestamp:
- Aug 31, 2008, 5:50:42 PM (16 years ago)
- Location:
- code/branches/gui/src/orxonox
- Files:
-
- 2 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/Main.cc
r1672 r1688 130 130 GSClient client; 131 131 GSGUI gui; 132 GSIO io;133 132 GSIOConsole ioConsole; 134 133 … … 139 138 graphics.addChild(&gui); 140 139 141 root.addChild(&io); 142 io.addChild(&ioConsole); 140 root.addChild(&ioConsole); 143 141 144 142 root.feedCommandLine(argc, argv); -
code/branches/gui/src/orxonox/OrxonoxPrereqs.h
r1674 r1688 120 120 //gui 121 121 class GUIManager; 122 123 // game states 124 class GSRoot; 125 class GSGraphics; 126 class GSIO; 127 class GSIOConsole; 128 class GSLevel; 129 class GSStandalone; 130 class GSServer; 131 class GSClient; 132 class GSGUI; 122 133 } 123 134 -
code/branches/gui/src/orxonox/gamestates/GSGUI.cc
r1686 r1688 39 39 { 40 40 GSGUI::GSGUI() 41 : GameState ("gui")41 : GameStateTyped<GSGraphics>("gui") 42 42 { 43 43 } … … 49 49 void GSGUI::enter() 50 50 { 51 guiManager_ = getParent()->getGUIManager(); 52 51 53 // show main menu 52 GUIManager::getInstance().showGUI("MainMenu", 0);53 GraphicsEngine::getInstance().getViewport()->setCamera(GUIManager::getInstance().getCamera());54 guiManager_->showGUI("MainMenu", 0); 55 getParent()->getViewport()->setCamera(guiManager_->getCamera()); 54 56 } 55 57 56 58 void GSGUI::leave() 57 59 { 58 GUIManager::getInstance().hideGUI();60 guiManager_->hideGUI(); 59 61 } 60 62 … … 62 64 { 63 65 // tick CEGUI 64 GUIManager::getInstance().tick(time.getDeltaTime());66 guiManager_->tick(time.getDeltaTime()); 65 67 66 68 this->tickChild(time); -
code/branches/gui/src/orxonox/gamestates/GSGUI.h
r1674 r1688 32 32 #include "OrxonoxPrereqs.h" 33 33 #include "core/GameState.h" 34 #include "GSGraphics.h" 34 35 35 36 namespace orxonox 36 37 { 37 class _OrxonoxExport GSGUI : public GameState 38 class _OrxonoxExport GSGUI : public GameStateTyped<GSGraphics> 38 39 { 39 40 public: … … 45 46 void leave(); 46 47 void ticked(const Clock& time); 48 49 GUIManager* guiManager_; 47 50 }; 48 51 } -
code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
r1686 r1688 57 57 { 58 58 GSGraphics::GSGraphics() 59 : GameState ("graphics")59 : GameStateTyped<GSRoot>("graphics") 60 60 , ogreRoot_(0) 61 61 , inputManager_(0) … … 77 77 void GSGraphics::setConfigValues() 78 78 { 79 SetConfigValue(resourceFile_, 79 SetConfigValue(resourceFile_, "resources.cfg").description("Location of the resources file in the data path."); 80 80 SetConfigValue(statisticsRefreshCycle_, 200000).description("Sets the time in microseconds interval at which average fps, etc. get updated."); 81 81 } … … 85 85 setConfigValues(); 86 86 87 this->ogreRoot_ = Ogre::Root::getSingletonPtr();87 this->ogreRoot_ = getParent()->getOgreRoot(); 88 88 89 89 this->declareResources(); … … 94 94 95 95 // HACK: temporary: 96 GraphicsEngine & graphicsEngine = GraphicsEngine::getInstance();97 graphicsEngine .renderWindow_= this->renderWindow_;98 graphicsEngine .root_= this->ogreRoot_;99 graphicsEngine .viewport_= this->viewport_;96 GraphicsEngine* graphicsEngine = getParent()->getGraphicsEngine(); 97 graphicsEngine->renderWindow_ = this->renderWindow_; 98 graphicsEngine->root_ = this->ogreRoot_; 99 graphicsEngine->viewport_ = this->viewport_; 100 100 101 101 -
code/branches/gui/src/orxonox/gamestates/GSGraphics.h
r1686 r1688 35 35 #include "core/GameState.h" 36 36 #include "core/OrxonoxClass.h" 37 #include "GSRoot.h" 37 38 38 39 namespace orxonox 39 40 { 40 class _OrxonoxExport GSGraphics : public GameState , public OrxonoxClass, public Ogre::WindowEventListener41 class _OrxonoxExport GSGraphics : public GameStateTyped<GSRoot>, public OrxonoxClass, public Ogre::WindowEventListener 41 42 { 42 43 friend class ClassIdentifier<GSGraphics>; … … 44 45 GSGraphics(); 45 46 ~GSGraphics(); 47 48 Ogre::Viewport* getViewport() { return this->viewport_; } 49 GUIManager* getGUIManager() { return this->guiManager_; } 46 50 47 51 private: -
code/branches/gui/src/orxonox/gamestates/GSIOConsole.cc
r1674 r1688 42 42 { 43 43 GSIOConsole::GSIOConsole() 44 : GameState ("ioConsole")44 : GameStateTyped<GSRoot>("ioConsole") 45 45 { 46 46 } -
code/branches/gui/src/orxonox/gamestates/GSIOConsole.h
r1674 r1688 33 33 #include <OgrePrerequisites.h> 34 34 #include "core/GameState.h" 35 #include "GSRoot.h" 35 36 36 37 namespace orxonox 37 38 { 38 class _OrxonoxExport GSIOConsole : public GameState 39 class _OrxonoxExport GSIOConsole : public GameStateTyped<GSRoot> 39 40 { 40 41 public: -
code/branches/gui/src/orxonox/gamestates/GSLevel.cc
r1686 r1688 45 45 { 46 46 GSLevel::GSLevel(const std::string& name) 47 : GameState (name)47 : GameStateTyped<GSGraphics>(name) 48 48 , timeFactor_(1.0f) 49 49 , sceneManager_(0) … … 68 68 69 69 // create Ogre SceneManager for the level 70 this->sceneManager_ = GraphicsEngine::getInstance().getOgreRoot()-> 71 createSceneManager(Ogre::ST_GENERIC, "LevelSceneManager"); 70 this->sceneManager_ = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, "LevelSceneManager"); 72 71 COUT(4) << "Created SceneManager: " << sceneManager_->getName() << std::endl; 72 73 // temporary hack 73 74 GraphicsEngine::getInstance().setLevelSceneManager(this->sceneManager_); 74 75 … … 98 99 delete this->radar_; 99 100 100 GraphicsEngine::getInstance().getOgreRoot()->destroySceneManager(this->sceneManager_);101 Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_); 101 102 102 103 inputState_->setHandler(0); -
code/branches/gui/src/orxonox/gamestates/GSLevel.h
r1686 r1688 33 33 #include <OgrePrerequisites.h> 34 34 #include "core/GameState.h" 35 #include "GSGraphics.h" 35 36 36 37 namespace orxonox 37 38 { 38 class _OrxonoxExport GSLevel : public GameState 39 class _OrxonoxExport GSLevel : public GameStateTyped<GSGraphics> 39 40 { 40 41 public: -
code/branches/gui/src/orxonox/gamestates/GSRoot.h
r1686 r1688 49 49 { requestState("root"); } 50 50 51 Ogre::Root* getOgreRoot() { return this->ogreRoot_; } 52 GraphicsEngine* getGraphicsEngine() { return this->graphicsEngine_; } 53 51 54 private: 52 55 void enter();
Note: See TracChangeset
for help on using the changeset viewer.