Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 16, 2008, 6:01:13 PM (17 years ago)
Author:
landauf
Message:

Merged objecthierarchy2 into presentation branch

Couln't merge 2 lines in Gamestate.cc and a whole block of code in GSDedicated.cc (it seems like oli implemented in both branches something like a network-tick-limiter but with different approaches)

Not yet tested in network mode and with bots
The SpaceShips movement is also not yet fully adopted to the new physics (see Engine class)

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/orxonox/gamestates/GSRoot.h

    r1891 r2485  
    4747        { requestState("root"); }
    4848
     49        // this has to be public because proteced triggers a bug in msvc
     50        // when taking the function address.
     51        void setTimeFactor(float factor);
     52        void pause();
     53        float getTimeFactor() { return this->timeFactor_; }
     54
    4955    private:
    5056        void enter();
     
    5561        void setThreadAffinity(unsigned int limitToCPU);
    5662
     63        float                 timeFactor_;       //!< A factor that sets the gamespeed. 1 is normal.
     64        bool                  bPaused_;
     65        float                 timeFactorPauseBackup_;
    5766        Settings*             settings_;
    5867        TclBind*              tclBind_;
    5968        TclThreadManager*     tclThreadManager_;
    6069        Shell*                shell_;
     70        LuaBind*              luaBind_;
     71
     72        // console commands
     73        ConsoleCommand*       ccExit_;
     74        ConsoleCommand*       ccSelectGameState_;
     75        ConsoleCommand*       ccSetTimeFactor_;
     76        ConsoleCommand*       ccPause_;
     77    };
     78
     79    class _OrxonoxExport TimeFactorListener : virtual public OrxonoxClass
     80    {
     81        friend class GSRoot;
     82
     83        public:
     84            TimeFactorListener();
     85            virtual ~TimeFactorListener() {}
     86
     87        protected:
     88            virtual void changedTimeFactor(float factor_new, float factor_old) {}
     89            inline float getTimeFactor() const
     90                { return TimeFactorListener::timefactor_s; }
     91
     92        private:
     93            static float timefactor_s;
    6194    };
    6295}
Note: See TracChangeset for help on using the changeset viewer.