Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 6, 2009, 1:59:00 AM (15 years ago)
Author:
landauf
Message:

Merged gui branch back to trunk.

I did 2 small changes in IngameManager.cc on line 777 and 888 (yes, really), because const_reverse_iterator strangely doesn't work on MinGW.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/gamestates/GSRoot.h

    r2710 r2896  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    34 #include <list>
    35 #include <OgreLog.h>
    36 #include "core/RootGameState.h"
     33#include "core/GameState.h"
    3734#include "core/OrxonoxClass.h"
    3835
    3936namespace orxonox
    4037{
    41     class _OrxonoxExport GSRoot : public RootGameState, public OrxonoxClass
     38    class _OrxonoxExport GSRoot : public GameState
    4239    {
    43         friend class ClassIdentifier<GSRoot>;
    44 
    4540    public:
    46         struct statisticsTickInfo
    47         {
    48             uint64_t    tickTime;
    49             uint32_t    tickLength;
    50         };
    51    
    52     public:
    53         GSRoot();
     41        GSRoot(const std::string& name);
    5442        ~GSRoot();
    5543
    56         void exitGame()
    57         { requestState("root"); }
     44        void activate();
     45        void deactivate();
     46        void update(const Clock& time);
    5847
    5948        // this has to be public because proteced triggers a bug in msvc
     
    6352        float getTimeFactor() { return this->timeFactor_; }
    6453
    65         float getAvgTickTime() { return this->avgTickTime_; }
    66         float getAvgFPS()      { return this->avgFPS_; }
    67 
    68         inline void addTickTime(uint32_t length)
    69             { assert(!this->statisticsTickTimes_.empty()); this->statisticsTickTimes_.back().tickLength += length;
    70               this->periodTickTime_+=length; }
    71 
    7254    private:
    73         void enter();
    74         void leave();
    75         void ticked(const Clock& time);
    76 
    77         void setConfigValues();
    78         void setThreadAffinity(unsigned int limitToCPU);
    79 
    8055        float                 timeFactor_;       //!< A factor that sets the gamespeed. 1 is normal.
    8156        bool                  bPaused_;
    8257        float                 timeFactorPauseBackup_;
    83         TclBind*              tclBind_;
    84         TclThreadManager*     tclThreadManager_;
    85         Shell*                shell_;
    86         LuaBind*              luaBind_;
    87 
    88         // variables for time statistics
    89         uint64_t              statisticsStartTime_;
    90         std::list<statisticsTickInfo>
    91                               statisticsTickTimes_;
    92         uint32_t              periodTickTime_;
    93         float                 avgFPS_;
    94         float                 avgTickTime_;
    95 
    96         // config values
    97         unsigned int          statisticsRefreshCycle_;
    98         unsigned int          statisticsAvgLength_;
    9958
    10059        // console commands
    101         ConsoleCommand*       ccExit_;
    102         ConsoleCommand*       ccSelectGameState_;
    10360        ConsoleCommand*       ccSetTimeFactor_;
    10461        ConsoleCommand*       ccPause_;
    105     };
    106 
    107     class _OrxonoxExport TimeFactorListener : virtual public OrxonoxClass
    108     {
    109         friend class GSRoot;
    110 
    111         public:
    112             TimeFactorListener();
    113             virtual ~TimeFactorListener() {}
    114 
    115         protected:
    116             virtual void changedTimeFactor(float factor_new, float factor_old) {}
    117             inline float getTimeFactor() const
    118                 { return TimeFactorListener::timefactor_s; }
    119 
    120         private:
    121             static float timefactor_s;
    12262    };
    12363}
Note: See TracChangeset for help on using the changeset viewer.