diff options
author | Johannes Schickel | 2007-10-21 21:38:23 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-10-21 21:38:23 +0000 |
commit | 80045e966189a2899c2feb1d86ff7ed6f62277a3 (patch) | |
tree | 8c8fea4c17b166a4eb14a28995cea87724be344b | |
parent | 00f349a52f5cda80dbff9fedd8082f3a45d7a577 (diff) | |
download | scummvm-rg350-80045e966189a2899c2feb1d86ff7ed6f62277a3.tar.gz scummvm-rg350-80045e966189a2899c2feb1d86ff7ed6f62277a3.tar.bz2 scummvm-rg350-80045e966189a2899c2feb1d86ff7ed6f62277a3.zip |
Fixes timers in Kyra1. (Initialized them twice oops...)
svn-id: r29245
-rw-r--r-- | engines/kyra/kyra_v1.cpp | 1 | ||||
-rw-r--r-- | engines/kyra/timer.cpp | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 6f9d4062b9..f9432fb9ba 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -381,7 +381,6 @@ void KyraEngine_v1::startup() { loadButtonShapes(); initMainButtonList(); loadMainScreen(); - setupTimers(); _screen->loadPalette("PALETTE.COL", _screen->_currentPalette); // XXX diff --git a/engines/kyra/timer.cpp b/engines/kyra/timer.cpp index dff191cbe0..458b6fc8b0 100644 --- a/engines/kyra/timer.cpp +++ b/engines/kyra/timer.cpp @@ -73,6 +73,12 @@ void TimerManager::reset() { void TimerManager::addTimer(uint8 id, TimerFunc *func, int countdown, bool enabled) { debugC(9, kDebugLevelTimer, "TimerManager::addTimer(%d, %p, %d, %d)", id, (const void*)func, countdown, enabled); + Iterator timer = Common::find_if(_timers.begin(), _timers.end(), TimerEqual(id)); + if (timer != _timers.end()) { + warning("Adding allready existing timer %d", id); + return; + } + TimerEntry newTimer; newTimer.id = id; |