Changeset 10624 for code/trunk/src/libraries/core/Core.h
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (10 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/libraries/core/Core.h
r9667 r10624 47 47 #include "util/DestructionHelper.h" 48 48 #include "util/Singleton.h" 49 #include " config/Configurable.h"49 #include "CoreConfig.h" 50 50 51 51 namespace orxonox 52 52 { 53 //! Informs about changes in the Development Mode.54 class DevModeListener : virtual public Listable55 {56 public:57 DevModeListener();58 virtual ~DevModeListener() {}59 virtual void devModeChanged(bool value) = 0;60 };61 62 53 /** 63 54 @brief … … 66 57 You should only create this singleton once because it destroys the identifiers! 67 58 */ 68 class _CoreExport Core : public Singleton<Core> , public Configurable59 class _CoreExport Core : public Singleton<Core> 69 60 { 70 61 friend class Singleton<Core>; 71 friend class Game;72 62 73 63 public: … … 86 76 void destroy(); 87 77 88 void setConfigValues(); 78 void preUpdate(const Clock& time); 79 void postUpdate(const Clock& time); 89 80 90 //! Returns the configured language. 91 const std::string& getLanguage() 92 { return this->language_; } 93 void resetLanguage(); 81 void loadGraphics(); 82 void unloadGraphics(bool loadGraphicsManagerWithoutRenderer = true); 94 83 95 void updateLastLevelTimestamp(); 96 inline long long getLastLevelTimestamp() const 97 { return this->lastLevelTimestamp_; } 84 void loadModules(); 85 void unloadModules(); 86 void loadModule(ModuleInstance* module); 87 void unloadModule(ModuleInstance* module); 98 88 99 void updateOgreConfigTimestamp(); 100 inline long long getOgreConfigTimestamp() const 101 { return this->ogreConfigTimestamp_; } 102 103 //! Developers bit. If returns false, some options are not available as to not confuse the normal user. 104 inline bool inDevMode(void) const 105 { return this->bDevMode_; } 89 inline CoreConfig* getConfig() const 90 { return this->config_; } 106 91 107 92 private: 108 93 Core(const Core&); //!< Don't use (undefined symbol) 109 94 110 void devModeChanged();111 void languageChanged();112 void initRandomNumberGenerator();113 114 void preUpdate(const Clock& time);115 void postUpdate(const Clock& time);116 117 void loadGraphics();118 void unloadGraphics();119 120 95 void setThreadAffinity(int limitToCPU); 121 96 122 PathConfig* pathConfig_; 123 DynLibManager* dynLibManager_; 124 SignalHandler* signalHandler_; 125 ConfigFileManager* configFileManager_; 126 Language* languageInstance_; 127 IOConsole* ioConsole_; 128 TclBind* tclBind_; 129 TclThreadManager* tclThreadManager_; 130 Scope<ScopeID::Root>* rootScope_; 97 ApplicationPaths* applicationPaths_; 98 ConfigurablePaths* configurablePaths_; 99 DynLibManager* dynLibManager_; 100 SignalHandler* signalHandler_; 101 ConfigFileManager* configFileManager_; 102 Language* languageInstance_; 103 Loader* loaderInstance_; 104 IOConsole* ioConsole_; 105 TclBind* tclBind_; 106 TclThreadManager* tclThreadManager_; 107 Scope<ScopeID::ROOT>* rootScope_; 131 108 // graphical 132 GraphicsManager* graphicsManager_; //!< Interface to OGRE 133 InputManager* inputManager_; //!< Interface to OIS 134 GUIManager* guiManager_; //!< Interface to GUI 135 Scope<ScopeID::Graphics>* graphicsScope_; 109 GraphicsManager* graphicsManager_; //!< Interface to OGRE 110 InputManager* inputManager_; //!< Interface to OIS 111 GUIManager* guiManager_; //!< Interface to GUI 112 Scope<ScopeID::GRAPHICS>* graphicsScope_; 113 bool bGraphicsLoaded_; 136 114 137 bool bGraphicsLoaded_;138 std::string language_; //!< The language139 bool bInitRandomNumberGenerator_; //!< If true, srand(time(0)) is called140 bool bStartIOConsole_; //!< Set to false if you don't want to use the IOConsole141 long long lastLevelTimestamp_; ///< Timestamp when the last level was started 142 long long ogreConfigTimestamp_; ///< Timestamp wehen the ogre config level was modified143 bool bDevMode_; //!< Developers bit. If set to false, some options are not available as to not confuse the normal user.115 CoreStaticInitializationHandler* staticInitHandler_; 116 PluginManager* pluginManager_; 117 ModuleInstance* rootModule_; 118 std::list<ModuleInstance*> modules_; 119 120 /// Helper object that stores the config values 121 CoreConfig* config_; 144 122 145 123 /// Helper object that executes the surrogate destructor destroy() 146 DestructionHelper<Core> destructionHelper_;124 DestructionHelper<Core> destructionHelper_; 147 125 148 static Core* singletonPtr_s;126 static Core* singletonPtr_s; 149 127 }; 150 128 }
Note: See TracChangeset
for help on using the changeset viewer.