diff options
author | Stijn Buys <ingar@osirion.org> | 2011-05-11 14:48:17 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-05-11 14:48:17 +0000 |
commit | 1c63cbf204b1d2c667ce9f821ccb197d0ffb0ac3 (patch) | |
tree | c2d0ff7cc4a8a264657abd0ac99017a5b664ecd2 /src/core/gameinterface.h | |
parent | bb0f860989f84b901f80017ae0139a3fc0446dc1 (diff) |
Review of the main loop timer, converted timers from float to unsigned long,
corrected a number of timing bugs, improved client framerate stability.
Diffstat (limited to 'src/core/gameinterface.h')
-rw-r--r-- | src/core/gameinterface.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/core/gameinterface.h b/src/core/gameinterface.h index 369b828..d99903f 100644 --- a/src/core/gameinterface.h +++ b/src/core/gameinterface.h @@ -67,11 +67,13 @@ public: return game_interactive; } - /// return the current game time, in seconds + /** + * @brief return the current game time, in seconds. + * */ inline float time() const { - return ((float)(game_timestamp) / 1000.0f); + return (float) game_timestamp / 1000.0f; } - + /** * @brief return the current game time, in milliseconds. * 1000 milliseconds equals one second. @@ -99,7 +101,7 @@ public: /// run one game time frame /// @param timestamp current application time - virtual void frame(unsigned long timestamp) = 0; + virtual void frame(const unsigned long timestamp) = 0; protected: /// the local player @@ -108,16 +110,17 @@ protected: /// all the players Players game_players; - model::VertexArray *game_vertexarray; - /// timestamp of the time the playerlist was last changed unsigned long game_playerlist_timestamp; - void set_timestamp(unsigned long timestamp); + /// set the current game time + void set_timestamp(const unsigned long timestamp); void set_running(const bool running); void set_interactive(const bool interactive); + + model::VertexArray *game_vertexarray; private: bool game_running; |