Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (16 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/core/Core.h

    r2907 r2908  
    2222 *   Author:
    2323 *      Fabian 'x3n' Landau
     24 *   Co-authors:
    2425 *      Reto Grieder
    25  *   Co-authors:
    26  *      ...
    2726 *
    2827 */
     
    4544#include "util/OutputHandler.h"
    4645
     46// Only allow main to access postMainInitialisation, so we need a forward declaration
     47int main(int, char**);
    4748// boost::filesystem header has quite a large tail, use forward declaration
    4849namespace boost { namespace filesystem
     
    5859    class _CoreExport Core : public OrxonoxClass
    5960    {
     61        friend int ::main(int, char**); // sets isDevBuild_s
     62
    6063        public:
    6164            Core();
    6265            ~Core();
    63 
    64             void initialise(int argc, char** argv);
    6566            void setConfigValues();
    66 
    67             void update(const Clock& time);
    6867
    6968            static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; }
     
    7372            static const std::string& getLanguage();
    7473            static void  resetLanguage();
     74
     75            static bool isDevBuild() { return Core::isDevBuild_s; }
    7576
    7677            static void tsetMediaPath(const std::string& path)
     
    8384            static std::string getLogPathString();
    8485
     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
    8598        private:
    8699            Core(const Core&);
    87 
    88             void checkDevBuild();
    89             void setExecutablePath();
    90             void createDirectories();
    91             void setThreadAffinity(int limitToCPU);
    92 
    93100            void resetLanguageIntern();
    94101            void initializeRandomNumberGenerator();
     
    98105            void _tsetMediaPath(const std::string& path);
    99106
    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();
    108111
    109112            int softDebugLevel_;                            //!< The debug level
     
    114117            bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
    115118            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)
    118127
    119128            static Core* singletonRef_s;
Note: See TracChangeset for help on using the changeset viewer.