Changeset 5876 for code/branches/core5/src/orxonox/gamestates/GSGraphics.cc
- Timestamp:
- Oct 4, 2009, 11:08:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/gamestates/GSGraphics.cc
r5863 r5876 35 35 #include "GSGraphics.h" 36 36 37 #include "util/Clock.h"38 #include "util/Convert.h"39 37 #include "core/CommandExecutor.h" 40 38 #include "core/ConsoleCommand.h" 41 39 #include "core/Game.h" 42 40 #include "core/GUIManager.h" 43 #include "core/Loader.h"44 #include "core/XMLFile.h"45 46 41 // HACK: 47 42 #include "overlays/Map.h" … … 53 48 GSGraphics::GSGraphics(const GameStateInfo& info) 54 49 : GameState(info) 55 , debugOverlay_(0)56 50 { 57 51 } … … 65 59 This function is called when we enter this game state. 66 60 67 Since graphics is very important for our game this function does quite a lot: 68 \li starts graphics manager 69 \li loads debug overlay 70 \li manages render window 71 \li creates input manager 72 \li loads master key bindings 73 \li loads the SoundManager 74 \li loads ingame console 75 \li loads GUI interface (GUIManager) 76 \li creates console command to toggle GUI 61 There is only one thing to do here: 62 \li create console command to toggle GUI 77 63 */ 78 64 void GSGraphics::activate() 79 65 { 80 // load debug overlay81 COUT(3) << "Loading Debug Overlay..." << std::endl;82 this->debugOverlay_ = new XMLFile("debug.oxo");83 Loader::open(debugOverlay_);84 85 66 // add console command to toggle GUI 86 this->ccToggleGUI_ = createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI"); 87 CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_); 67 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI")); 88 68 } 89 69 … … 91 71 @brief 92 72 This function is called when the game state is left 93 94 Created references, input states and console commands are deleted.95 73 */ 96 74 void GSGraphics::deactivate() 97 75 { 98 /*99 if (this->ccToggleGUI_)100 {101 delete this->ccToggleGUI_;102 this->ccToggleGUI_ = 0;103 }104 */105 106 Loader::unload(this->debugOverlay_);107 delete this->debugOverlay_;108 109 76 // HACK: (destroys a resource smart pointer) 110 77 Map::hackDestroyMap(); … … 123 90 } 124 91 125 /**126 @note127 A note about the Ogre::FrameListener: Even though we don't use them,128 they still get called. However, the delta times are not correct (except129 for timeSinceLastFrame, which is the most important). A little research130 as shown that there is probably only one FrameListener that doesn't even131 need the time. So we shouldn't run into problems.132 */133 92 void GSGraphics::update(const Clock& time) 134 93 {
Note: See TracChangeset
for help on using the changeset viewer.