19 #ifndef OPENXCOM_TIMER_H
20 #define OPENXCOM_TIMER_H
29 typedef void (State::* StateHandler)();
30 typedef void (Surface::* SurfaceHandler)();
40 static int maxFrameSkip;
41 static Uint32 gameSlowSpeed;
45 Uint32 _frameSkipStart;
50 SurfaceHandler _surface;
53 Timer(Uint32 interval,
bool frameSkipping =
false);
69 void onTimer(StateHandler handler);
71 void onTimer(SurfaceHandler handler);
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Timer used to run code in fixed intervals.
Definition: Timer.h:37
~Timer()
Cleans up the timer.
Definition: Timer.cpp:60
void setFrameSkipping(bool skip)
Turns frame skipping on or off.
Definition: Timer.cpp:172
void start()
Starts the timer.
Definition: Timer.cpp:67
void stop()
Stops the timer.
Definition: Timer.cpp:76
void think(State *state, Surface *surface)
Advances the timer.
Definition: Timer.cpp:110
Uint32 getTime() const
Gets the current time interval.
Definition: Timer.cpp:86
void setInterval(Uint32 interval)
Sets the timer's interval.
Definition: Timer.cpp:145
Timer(Uint32 interval, bool frameSkipping=false)
Creates a stopped timer.
Definition: Timer.cpp:52
void onTimer(StateHandler handler)
Hooks a state action handler to the timer interval.
Definition: Timer.cpp:154
bool isRunning() const
Gets if the timer's running.
Definition: Timer.cpp:99
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39