diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-09-11 23:04:05 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-09-11 23:04:05 +0000 |
commit | e496e082e38a8c962f23bfac7ce1fa7400ed3bf6 (patch) | |
tree | 978e4fe35382f5096d17e64a0ddc3caddf31f918 /src/game.h | |
parent | abeaf0ce93dba357abf8130d62ae10a9f1a35452 (diff) | |
download | mana-e496e082e38a8c962f23bfac7ce1fa7400ed3bf6.tar.gz mana-e496e082e38a8c962f23bfac7ce1fa7400ed3bf6.tar.bz2 mana-e496e082e38a8c962f23bfac7ce1fa7400ed3bf6.tar.xz mana-e496e082e38a8c962f23bfac7ce1fa7400ed3bf6.zip |
Simplified fps limiting a bit and added some comments. Now based on
ConfigListener so that the fpslimit option doesn't need to be queried the whole
time.
Diffstat (limited to 'src/game.h')
-rw-r--r-- | src/game.h | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -27,6 +27,8 @@ #include <iosfwd> #include <memory> +#include "configlistener.h" + #define SPEECH_TIME 80 #define SPEECH_MAX_TIME 100 @@ -37,7 +39,7 @@ extern std::string map_path; extern volatile int fps; extern volatile int tick_time; -class Game +class Game : public ConfigListener { public: Game(Network *network); @@ -47,9 +49,17 @@ class Game void handleInput(); - protected: + void optionChanged(const std::string &name); + + private: Network *mNetwork; + /** Used to determine whether to draw the next frame. */ + int mDrawTime; + + /** The minimum frame time (used for frame limiting). */ + int mMinFrameTime; + typedef std::auto_ptr<MessageHandler> MessageHandlerPtr; MessageHandlerPtr mBeingHandler; MessageHandlerPtr mBuySellHandler; |