Changeset 3343 for code/branches/resource/src/core
- Timestamp:
- Jul 24, 2009, 4:25:33 PM (15 years ago)
- Location:
- code/branches/resource/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource/src/core/Core.cc
r3323 r3343 68 68 #include "CoreIncludes.h" 69 69 #include "Factory.h" 70 #include "GameMode.h" 70 71 #include "Identifier.h" 71 72 #include "Language.h" … … 230 231 231 232 Core::Core(const std::string& cmdLine) 233 : bGraphicsLoaded_(false) 232 234 { 233 235 if (singletonRef_s != 0) … … 315 317 // Destroy command line arguments 316 318 CommandLine::destroyAllArguments(); 317 // Also delete external console command that don't belong to an Identifier319 // Also delete external console commands that don't belong to an Identifier 318 320 CommandExecutor::destroyExternalCommands(); 319 321 // Clean up class hierarchy stuff (identifiers, XMLPort, configValues, consoleCommand) … … 323 325 324 326 // Don't assign singletonRef_s with NULL! Recreation is not supported 327 } 328 329 void Core::loadGraphics() 330 { 331 if (bGraphicsLoaded_) 332 return; 333 334 GameMode::setShowsGraphics(true); 335 bGraphicsLoaded_ = true; 336 } 337 338 void Core::unloadGraphics() 339 { 340 if (!bGraphicsLoaded_) 341 return; 342 343 bGraphicsLoaded_ = false; 344 GameMode::setShowsGraphics(false); 325 345 } 326 346 -
code/branches/resource/src/core/Core.h
r3323 r3343 73 73 void update(const Clock& time); 74 74 75 void loadGraphics(); 76 void unloadGraphics(); 77 75 78 static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; } 76 79 … … 111 114 TclThreadManager* tclThreadManager_; 112 115 113 bool isDevBuild_; //!< True for builds in the build directory (not installed) 116 bool isDevBuild_; //!< True for builds in the build directory (not installed) 117 bool bGraphicsLoaded_; 114 118 CoreConfiguration* configuration_; 115 119 -
code/branches/resource/src/core/GameMode.h
r2896 r3343 41 41 class _CoreExport GameMode 42 42 { 43 friend class Core; 44 43 45 public: 44 46 static bool showsGraphics() { return bShowsGraphics_s; } … … 47 49 static bool isStandalone() { return bIsStandalone_s; } 48 50 static bool isMaster() { return bIsMaster_s; } 49 static void setShowsGraphics(bool val) { bShowsGraphics_s = val; updateIsMaster(); } 51 50 52 static void setHasServer (bool val) { bHasServer_s = val; updateIsMaster(); } 51 53 static void setIsClient (bool val) { bIsClient_s = val; updateIsMaster(); } 52 54 static void setIsStandalone (bool val) { bIsStandalone_s = val; updateIsMaster(); } 53 static void updateIsMaster () { bIsMaster_s = (bHasServer_s || bIsStandalone_s); }54 55 55 56 private: … … 57 58 GameMode(const GameMode& inst); 58 59 ~GameMode(); 60 61 static void setShowsGraphics(bool val) { bShowsGraphics_s = val; updateIsMaster(); } 62 static void updateIsMaster () { bIsMaster_s = (bHasServer_s || bIsStandalone_s); } 59 63 60 64 static bool bShowsGraphics_s; //!< global variable that tells whether to show graphics
Note: See TracChangeset
for help on using the changeset viewer.