Changeset 2896 for code/trunk/src/core/Core.h
- Timestamp:
- Apr 6, 2009, 1:59:00 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/gui merged: 2796,2798-2801,2805,2807-2808,2811,2814-2817,2834,2840-2850,2853-2854,2859,2862-2863,2869,2875,2887,2892
- Property svn:mergeinfo changed
-
code/trunk/src/core/Core.h
r2759 r2896 22 22 * Author: 23 23 * Fabian 'x3n' Landau 24 * Reto Grieder 24 25 * Co-authors: 25 * Reto Grieder26 * ... 26 27 * 27 28 */ … … 44 45 #include "util/OutputHandler.h" 45 46 46 // Only allow main to access postMainInitialisation, so we need a forward declaration47 int main(int, char**);48 47 // boost::filesystem header has quite a large tail, use forward declaration 49 48 namespace boost { namespace filesystem … … 59 58 class _CoreExport Core : public OrxonoxClass 60 59 { 61 friend int ::main(int, char**); // sets isDevBuild_s62 63 60 public: 64 61 Core(); 65 62 ~Core(); 63 64 void initialise(int argc, char** argv); 66 65 void setConfigValues(); 66 67 void update(const Clock& time); 67 68 68 69 static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; } … … 72 73 static const std::string& getLanguage(); 73 74 static void resetLanguage(); 74 75 static bool isDevBuild() { return Core::isDevBuild_s; }76 75 77 76 static void tsetMediaPath(const std::string& path) … … 84 83 static std::string getLogPathString(); 85 84 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 98 85 private: 99 86 Core(const Core&); 87 88 void checkDevBuild(); 89 void setExecutablePath(); 90 void createDirectories(); 91 void setThreadAffinity(int limitToCPU); 92 100 93 void resetLanguageIntern(); 101 94 void initializeRandomNumberGenerator(); … … 105 98 void _tsetMediaPath(const std::string& path); 106 99 107 static void postMainInitialisation(); 108 static void checkDevBuild(); 109 static void setExecutablePath(); 110 static void createDirectories(); 100 // Singletons 101 ConfigFileManager* configFileManager_; 102 Language* languageInstance_; 103 LuaBind* luaBind_; 104 Shell* shell_; 105 SignalHandler* signalHandler_; 106 TclBind* tclBind_; 107 TclThreadManager* tclThreadManager_; 111 108 112 109 int softDebugLevel_; //!< The debug level … … 117 114 bool bInitializeRandomNumberGenerator_; //!< If true, srand(time(0)) is called 118 115 std::string mediaPathString_; //!< Path to the data/media file folder as string 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) 116 bool isDevBuild_; //!< True for builds in the build directory (not installed) 117 bool loaded_; //!< Only true if constructor was interrupted 127 118 128 119 static Core* singletonRef_s;
Note: See TracChangeset
for help on using the changeset viewer.