Changeset 2908 for code/branches/questsystem5/src/core/Core.h
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/core/Core.h
r2907 r2908 22 22 * Author: 23 23 * Fabian 'x3n' Landau 24 * Co-authors: 24 25 * Reto Grieder 25 * Co-authors:26 * ...27 26 * 28 27 */ … … 45 44 #include "util/OutputHandler.h" 46 45 46 // Only allow main to access postMainInitialisation, so we need a forward declaration 47 int main(int, char**); 47 48 // boost::filesystem header has quite a large tail, use forward declaration 48 49 namespace boost { namespace filesystem … … 58 59 class _CoreExport Core : public OrxonoxClass 59 60 { 61 friend int ::main(int, char**); // sets isDevBuild_s 62 60 63 public: 61 64 Core(); 62 65 ~Core(); 63 64 void initialise(int argc, char** argv);65 66 void setConfigValues(); 66 67 void update(const Clock& time);68 67 69 68 static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; } … … 73 72 static const std::string& getLanguage(); 74 73 static void resetLanguage(); 74 75 static bool isDevBuild() { return Core::isDevBuild_s; } 75 76 76 77 static void tsetMediaPath(const std::string& path) … … 83 84 static std::string getLogPathString(); 84 85 86 // fast access global variables. 87 static bool showsGraphics() { return bShowsGraphics_s; } 88 static bool hasServer() { return bHasServer_s; } 89 static bool isClient() { return bIsClient_s; } 90 static bool isStandalone() { return bIsStandalone_s; } 91 static bool isMaster() { return bIsMaster_s; } 92 static void setShowsGraphics(bool val) { bShowsGraphics_s = val; updateIsMaster(); } 93 static void setHasServer (bool val) { bHasServer_s = val; updateIsMaster(); } 94 static void setIsClient (bool val) { bIsClient_s = val; updateIsMaster(); } 95 static void setIsStandalone (bool val) { bIsStandalone_s = val; updateIsMaster(); } 96 static void updateIsMaster () { bIsMaster_s = (bHasServer_s || bIsStandalone_s); } 97 85 98 private: 86 99 Core(const Core&); 87 88 void checkDevBuild();89 void setExecutablePath();90 void createDirectories();91 void setThreadAffinity(int limitToCPU);92 93 100 void resetLanguageIntern(); 94 101 void initializeRandomNumberGenerator(); … … 98 105 void _tsetMediaPath(const std::string& path); 99 106 100 // Singletons 101 ConfigFileManager* configFileManager_; 102 Language* languageInstance_; 103 LuaBind* luaBind_; 104 Shell* shell_; 105 SignalHandler* signalHandler_; 106 TclBind* tclBind_; 107 TclThreadManager* tclThreadManager_; 107 static void postMainInitialisation(); 108 static void checkDevBuild(); 109 static void setExecutablePath(); 110 static void createDirectories(); 108 111 109 112 int softDebugLevel_; //!< The debug level … … 114 117 bool bInitializeRandomNumberGenerator_; //!< If true, srand(time(0)) is called 115 118 std::string mediaPathString_; //!< Path to the data/media file folder as string 116 bool isDevBuild_; //!< True for builds in the build directory (not installed) 117 bool loaded_; //!< Only true if constructor was interrupted 119 120 static bool bShowsGraphics_s; //!< global variable that tells whether to show graphics 121 static bool bHasServer_s; //!< global variable that tells whether this is a server 122 static bool bIsClient_s; 123 static bool bIsStandalone_s; 124 static bool bIsMaster_s; 125 126 static bool isDevBuild_s; //!< True for builds in the build directory (not installed) 118 127 119 128 static Core* singletonRef_s;
Note: See TracChangeset
for help on using the changeset viewer.