Changeset 2361 for code/branches/objecthierarchy2/src/core/Core.cc
- Timestamp:
- Dec 9, 2008, 2:07:24 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/core/Core.cc
r2344 r2361 56 56 RegisterRootObject(Core); 57 57 58 assert(singletonRef_s == 0); 59 singletonRef_s = this; 58 assert(this->singletonRef_s == 0); 59 this->singletonRef_s = this; 60 this->bInitializeRandomNumberGenerator_ = false; 60 61 61 62 this->setConfigValues(); … … 80 81 SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell").callback(this, &Core::debugLevelChanged); 81 82 SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text").callback(this, &Core::languageChanged); 83 SetConfigValue(bInitializeRandomNumberGenerator_, true).description("If true, all random actions are different each time you start the game").callback(this, &Core::initializeRandomNumberGenerator); 82 84 } 83 85 … … 174 176 ResetConfigValue(language_); 175 177 } 178 179 void Core::initializeRandomNumberGenerator() 180 { 181 static bool bInitialized = false; 182 if (!bInitialized && this->bInitializeRandomNumberGenerator_) 183 { 184 srand(time(0)); 185 rand(); 186 bInitialized = true; 187 } 188 } 176 189 }
Note: See TracChangeset
for help on using the changeset viewer.