Changeset 7870
- Timestamp:
- Feb 12, 2011, 7:24:16 PM (14 years ago)
- Location:
- code/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/Core.cc
r7868 r7870 94 94 , bGraphicsLoaded_(false) 95 95 , bStartIOConsole_(true) 96 , lastLevelTimestamp_(0) 97 , ogreConfigTimestamp_(0) 96 98 { 97 99 // Set the hard coded fixed paths … … 221 223 SetConfigValue(bStartIOConsole_, true) 222 224 .description("Set to false if you don't want to use the IOConsole (for Lua debugging for instance)"); 225 SetConfigValue(lastLevelTimestamp_, 0) 226 .description("Timestamp when the last level was started."); 227 SetConfigValue(ogreConfigTimestamp_, 0) 228 .description("Timestamp when the ogre config file was changed."); 223 229 } 224 230 … … 395 401 } 396 402 } 403 404 void Core::updateLastLevelTimestamp() 405 { 406 ModifyConfigValue(lastLevelTimestamp_, set, static_cast<long long>(time(NULL))); 407 } 408 409 void Core::updateOgreConfigTimestamp() 410 { 411 ModifyConfigValue(ogreConfigTimestamp_, set, static_cast<long long>(time(NULL))); 412 } 397 413 } -
code/trunk/src/libraries/core/Core.h
r7401 r7870 83 83 void resetLanguage(); 84 84 85 void updateLastLevelTimestamp(); 86 inline long long getLastLevelTimestamp() const 87 { return this->lastLevelTimestamp_; } 88 89 void updateOgreConfigTimestamp(); 90 inline long long getOgreConfigTimestamp() const 91 { return this->ogreConfigTimestamp_; } 92 85 93 private: 86 94 Core(const Core&); //!< Don't use (undefined symbol) … … 120 128 bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called 121 129 bool bStartIOConsole_; //!< Set to false if you don't want to use the IOConsole 130 long long lastLevelTimestamp_; ///< Timestamp when the last level was started 131 long long ogreConfigTimestamp_; ///< Timestamp wehen the ogre config level was modified 122 132 123 133 static Core* singletonPtr_s; -
code/trunk/src/libraries/core/GraphicsManager.cc
r7868 r7870 54 54 #include "ConfigValueIncludes.h" 55 55 #include "CoreIncludes.h" 56 #include "Core.h" 56 57 #include "Game.h" 57 58 #include "GameMode.h" … … 303 304 CCOUT(4) << "Configuring Renderer" << std::endl; 304 305 305 if (!ogreRoot_->restoreConfig()) 306 if (!ogreRoot_->restoreConfig() || Core::getInstance().getOgreConfigTimestamp() > Core::getInstance().getLastLevelTimestamp()) 307 { 306 308 if (!ogreRoot_->showConfigDialog()) 307 309 ThrowException(InitialisationFailed, "OGRE graphics configuration dialogue canceled."); 310 else 311 Core::getInstance().updateOgreConfigTimestamp(); 312 } 308 313 309 314 CCOUT(4) << "Creating render window" << std::endl; -
code/trunk/src/orxonox/gamestates/GSLevel.cc
r7854 r7870 36 36 #include "core/input/InputState.h" 37 37 #include "core/input/KeyBinderManager.h" 38 #include "core/Core.h" 38 39 #include "core/Game.h" 39 40 #include "core/GameMode.h" … … 140 141 startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel()); 141 142 Loader::open(startFile_); 143 144 Core::getInstance().updateLastLevelTimestamp(); 142 145 } 143 146
Note: See TracChangeset
for help on using the changeset viewer.