Changeset 2846 for code/branches/gui/src
- Timestamp:
- Mar 25, 2009, 6:24:15 PM (16 years ago)
- Location:
- code/branches/gui/src
- Files:
-
- 10 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" -
code/branches/gui/src/network/ChatListener.cc
r2171 r2846 30 30 31 31 #include "core/CoreIncludes.h" 32 #include "core/Core.h"33 32 34 33 namespace orxonox -
code/branches/gui/src/network/ClientConnectionListener.cc
r2171 r2846 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 4 * 5 * 6 * License notice: 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * 22 * Author: 23 * Oliver Scheuss 24 * Co-authors: 25 * ... 26 * 27 */ 28 1 29 #include "ClientConnectionListener.h" 2 30 #include "core/CoreIncludes.h" -
code/branches/gui/src/orxonox/gamestates/GSClient.cc
r2844 r2846 62 62 ThrowException(InitialisationFailed, "Could not establish connection with server."); 63 63 64 client_->update( Core::getGameClock());64 client_->update(Game::getInstance().getGameClock()); 65 65 } 66 66 -
code/branches/gui/src/orxonox/gamestates/GSGraphics.cc
r2844 r2846 113 113 void GSGraphics::deactivate() 114 114 { 115 if (Core::showsGraphics()) 116 InputManager::getInstance().requestLeaveState("master"); 115 InputManager::getInstance().requestLeaveState("master"); 117 116 118 117 delete this->guiManager_; … … 129 128 delete graphicsManager_; 130 129 131 if (Core::showsGraphics()) 130 masterInputState_->setHandler(0); 131 InputManager::getInstance().requestDestroyState("master"); 132 if (this->masterKeyBinder_) 132 133 { 133 masterInputState_->setHandler(0); 134 InputManager::getInstance().requestDestroyState("master"); 135 if (this->masterKeyBinder_) 136 { 137 delete this->masterKeyBinder_; 138 this->masterKeyBinder_ = 0; 139 } 134 delete this->masterKeyBinder_; 135 this->masterKeyBinder_ = 0; 140 136 } 137 138 Core::setShowsGraphics(false); 141 139 } 142 140 -
code/branches/gui/src/orxonox/gamestates/GSRoot.cc
r2845 r2846 115 115 uint64_t timeBeforeTick = time.getRealMicroseconds(); 116 116 117 Core::getInstance().update(time);118 119 117 for (ObjectList<TimerBase>::iterator it = ObjectList<TimerBase>::begin(); it; ++it) 120 118 it->tick(time);
Note: See TracChangeset
for help on using the changeset viewer.