Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 25, 2009, 6:24:15 PM (16 years ago)
Author:
rgrieder
Message:

Moving game clock from Core to Game.
Other small fixes.

Location:
code/branches/gui/src/core
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/Core.cc

    r2815 r2846  
    102102    }
    103103
    104     Clock* Core::initialise(int argc, char** argv)
    105     {
    106         // Set up a basic clock to keep time
    107         this->gameClock_ = new Clock();
    108 
     104    void Core::initialise(int argc, char** argv)
     105    {
    109106        // Parse command line arguments fist
    110107        try
     
    175172       
    176173        this->loaded_ = true;
    177 
    178         // Return non const pointer to the game's clock for the main loop
    179         return this->gameClock_;
    180174    }
    181175
     
    199193        // Also delete external console command that don't belong to an Identifier
    200194        CommandExecutor::destroyExternalCommands();
    201 
    202         delete this->gameClock_;
    203195
    204196        assert(Core::singletonRef_s);
  • code/branches/gui/src/core/Core.h

    r2807 r2846  
    4545#include "util/OutputHandler.h"
    4646
    47 // Only allow main to access postMainInitialisation, so we need a forward declaration
    48 int main(int, char**);
    4947// boost::filesystem header has quite a large tail, use forward declaration
    5048namespace boost { namespace filesystem
     
    6462            ~Core();
    6563
    66             Clock* initialise(int argc, char** argv);
     64            void initialise(int argc, char** argv);
    6765            void setConfigValues();
    6866
     
    7573            static const std::string& getLanguage();
    7674            static void  resetLanguage();
    77 
    78             static const Clock& getGameClock() { return *getInstance().gameClock_; }
    7975
    8076            static void tsetMediaPath(const std::string& path)
     
    123119            TclThreadManager*     tclThreadManager_;
    124120
    125             Clock*                gameClock_;
    126 
    127121            int softDebugLevel_;                            //!< The debug level
    128122            int softDebugLevelConsole_;                     //!< The debug level for the console
  • code/branches/gui/src/core/Game.cc

    r2845 r2846  
    8686        this->avgTickTime_ = 0.0f;
    8787
     88
     89        // Set up a basic clock to keep time
     90        this->gameClock_ = new Clock();
     91
    8892        this->core_ = new orxonox::Core();
    89         this->gameClock_ = this->core_->initialise(argc, argv);
     93        this->core_->initialise(argc, argv);
    9094
    9195        RegisterRootObject(Game);
     
    104108        for (std::map<std::string, GameState*>::const_iterator it = allStates_s.begin(); it != allStates_s.end(); ++it)
    105109            delete it->second;
     110
     111        delete this->gameClock_;
    106112
    107113        assert(singletonRef_s);
     
    158164
    159165            // UPDATE, bottom to top in the stack
     166            this->core_->update(*this->gameClock_);
    160167            for (std::vector<GameState*>::const_iterator it = this->activeStates_.begin();
    161168                it != this->activeStates_.end(); ++it)
  • code/branches/gui/src/core/Game.h

    r2844 r2846  
    6868        void popState();
    6969
     70        const Clock& getGameClock() { return *this->gameClock_; }
     71
    7072        float getAvgTickTime() { return this->avgTickTime_; }
    7173        float getAvgFPS()      { return this->avgFPS_; }
  • code/branches/gui/src/core/input/KeyBinder.cc

    r2800 r2846  
    4242#include "core/CoreIncludes.h"
    4343#include "core/ConfigFileManager.h"
    44 #include "core/Core.h"
    4544#include "InputCommands.h"
    4645#include "InputManager.h"
Note: See TracChangeset for help on using the changeset viewer.