summaryrefslogtreecommitdiff
path: root/src/game.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-11 23:04:05 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-09-11 23:04:05 +0000
commite496e082e38a8c962f23bfac7ce1fa7400ed3bf6 (patch)
tree978e4fe35382f5096d17e64a0ddc3caddf31f918 /src/game.h
parentabeaf0ce93dba357abf8130d62ae10a9f1a35452 (diff)
downloadmana-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.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/game.h b/src/game.h
index a44c8970..5fc5205e 100644
--- a/src/game.h
+++ b/src/game.h
@@ -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;