Changeset 2846 for code/branches/gui/src/core
- Timestamp:
- Mar 25, 2009, 6:24:15 PM (16 years ago)
- Location:
- code/branches/gui/src/core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/Core.cc
r2815 r2846 102 102 } 103 103 104 Clock* Core::initialise(int argc, char** argv) 105 { 106 // Set up a basic clock to keep time 107 this->gameClock_ = new Clock(); 108 104 void Core::initialise(int argc, char** argv) 105 { 109 106 // Parse command line arguments fist 110 107 try … … 175 172 176 173 this->loaded_ = true; 177 178 // Return non const pointer to the game's clock for the main loop179 return this->gameClock_;180 174 } 181 175 … … 199 193 // Also delete external console command that don't belong to an Identifier 200 194 CommandExecutor::destroyExternalCommands(); 201 202 delete this->gameClock_;203 195 204 196 assert(Core::singletonRef_s); -
code/branches/gui/src/core/Core.h
r2807 r2846 45 45 #include "util/OutputHandler.h" 46 46 47 // Only allow main to access postMainInitialisation, so we need a forward declaration48 int main(int, char**);49 47 // boost::filesystem header has quite a large tail, use forward declaration 50 48 namespace boost { namespace filesystem … … 64 62 ~Core(); 65 63 66 Clock*initialise(int argc, char** argv);64 void initialise(int argc, char** argv); 67 65 void setConfigValues(); 68 66 … … 75 73 static const std::string& getLanguage(); 76 74 static void resetLanguage(); 77 78 static const Clock& getGameClock() { return *getInstance().gameClock_; }79 75 80 76 static void tsetMediaPath(const std::string& path) … … 123 119 TclThreadManager* tclThreadManager_; 124 120 125 Clock* gameClock_;126 127 121 int softDebugLevel_; //!< The debug level 128 122 int softDebugLevelConsole_; //!< The debug level for the console -
code/branches/gui/src/core/Game.cc
r2845 r2846 86 86 this->avgTickTime_ = 0.0f; 87 87 88 89 // Set up a basic clock to keep time 90 this->gameClock_ = new Clock(); 91 88 92 this->core_ = new orxonox::Core(); 89 this-> gameClock_ = this->core_->initialise(argc, argv);93 this->core_->initialise(argc, argv); 90 94 91 95 RegisterRootObject(Game); … … 104 108 for (std::map<std::string, GameState*>::const_iterator it = allStates_s.begin(); it != allStates_s.end(); ++it) 105 109 delete it->second; 110 111 delete this->gameClock_; 106 112 107 113 assert(singletonRef_s); … … 158 164 159 165 // UPDATE, bottom to top in the stack 166 this->core_->update(*this->gameClock_); 160 167 for (std::vector<GameState*>::const_iterator it = this->activeStates_.begin(); 161 168 it != this->activeStates_.end(); ++it) -
code/branches/gui/src/core/Game.h
r2844 r2846 68 68 void popState(); 69 69 70 const Clock& getGameClock() { return *this->gameClock_; } 71 70 72 float getAvgTickTime() { return this->avgTickTime_; } 71 73 float getAvgFPS() { return this->avgFPS_; } -
code/branches/gui/src/core/input/KeyBinder.cc
r2800 r2846 42 42 #include "core/CoreIncludes.h" 43 43 #include "core/ConfigFileManager.h" 44 #include "core/Core.h"45 44 #include "InputCommands.h" 46 45 #include "InputManager.h"
Note: See TracChangeset
for help on using the changeset viewer.