summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorRogier Polak <rogier.l.a.polak@gmail.com>2007-02-25 15:12:43 +0000
committerRogier Polak <rogier.l.a.polak@gmail.com>2007-02-25 15:12:43 +0000
commit0ee4b4d0229d8513eb2a71cc735d8807fde57f29 (patch)
tree9a462fb8af3d13c813742e4d20ff7f0fb1b7deb8 /src/game.cpp
parent775404c84c3250225d43f10c4a5363e997618cb2 (diff)
downloadmana-0ee4b4d0229d8513eb2a71cc735d8807fde57f29.tar.gz
mana-0ee4b4d0229d8513eb2a71cc735d8807fde57f29.tar.bz2
mana-0ee4b4d0229d8513eb2a71cc735d8807fde57f29.tar.xz
mana-0ee4b4d0229d8513eb2a71cc735d8807fde57f29.zip
Fixed small issue concerning SDL timers, removed a useless variable.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp
index bc81add5..9eaa0693 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -228,7 +228,8 @@ Game::Game():
mNpcHandler(new NPCHandler()),
mPlayerHandler(new PlayerHandler()),
mSkillHandler(new SkillHandler()),
- mTradeHandler(new TradeHandler())
+ mTradeHandler(new TradeHandler()),
+ mLogicCounterId(0), mSecondsCounterId(0)
{
done = false;
@@ -240,8 +241,8 @@ Game::Game():
// Initialize timers
tick_time = 0;
- SDL_AddTimer(10, nextTick, NULL); // Logic counter
- SDL_AddTimer(1000, nextSecond, NULL); // Seconds counter
+ mLogicCounterId = SDL_AddTimer(10, nextTick, NULL); //Logic counter
+ mSecondsCounterId = SDL_AddTimer(1000, nextSecond, NULL);//Seconds counter
// Initialize frame limiting
config.addListener("fpslimit", this);
@@ -285,6 +286,9 @@ Game::~Game()
beingManager = NULL;
floorItemManager = NULL;
joystick = NULL;
+
+ SDL_RemoveTimer(mLogicCounterId);
+ SDL_RemoveTimer(mSecondsCounterId);
}
bool saveScreenshot(SDL_Surface *screenshot)