diff options
author | Florian Kagerer | 2009-02-23 20:17:53 +0000 |
---|---|---|
committer | Florian Kagerer | 2009-02-23 20:17:53 +0000 |
commit | 837ca0683e758f7a822452c53b2bff69fa554099 (patch) | |
tree | faba5e246310c377e669b8a2c30a03c556754208 /engines/kyra/timer_lol.cpp | |
parent | e3afa772e2ad494175b91e011304558150b8901a (diff) | |
download | scummvm-rg350-837ca0683e758f7a822452c53b2bff69fa554099.tar.gz scummvm-rg350-837ca0683e758f7a822452c53b2bff69fa554099.tar.bz2 scummvm-rg350-837ca0683e758f7a822452c53b2bff69fa554099.zip |
LOL: - some more work on the interface (you can now click on the banners and windows) and some bug fixes
svn-id: r38818
Diffstat (limited to 'engines/kyra/timer_lol.cpp')
-rw-r--r-- | engines/kyra/timer_lol.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp index 594aa1733e..ab94d97101 100644 --- a/engines/kyra/timer_lol.cpp +++ b/engines/kyra/timer_lol.cpp @@ -34,7 +34,7 @@ namespace Kyra { void LoLEngine::setupTimers() { debugC(9, kDebugLevelMain | kDebugLevelTimer, "LoLEngine::setupTimers()"); - _timer->addTimer(0, TimerV2(timerSub1), 15, true); + _timer->addTimer(0, TimerV2(timerProcessOpenDoor), 15, true); _timer->addTimer(0x10, TimerV2(timerSub2), 6, true); _timer->addTimer(0x11, TimerV2(timerSub2), 6, true); _timer->setNextRun(0x11, 3); @@ -44,7 +44,7 @@ void LoLEngine::setupTimers() { _timer->addTimer(0x51, TimerV2(timerSub5), 0, false); _timer->addTimer(0x52, TimerV2(timerSub5), 0, false); _timer->addTimer(8, TimerV2(timerSub6), 1200, true); - _timer->addTimer(9, TimerV2(timerSub7), 10, true); + _timer->addTimer(9, TimerV2(timerUpdatePortraitAnimations), 10, true); _timer->addTimer(10, TimerV2(timerUpdateLampState), 360, true); _timer->addTimer(11, TimerV2(timerFadeMessageText), 360, false); } @@ -54,7 +54,7 @@ void LoLEngine::enableTimer(int id) { _timer->setNextRun(id, _system->getMillis() + _timer->getDelay(id) * _tickLength); } -void LoLEngine::timerSub1(int timerNum) { +void LoLEngine::timerProcessOpenDoor(int timerNum) { } @@ -78,8 +78,26 @@ void LoLEngine::timerSub6(int timerNum) { } -void LoLEngine::timerSub7(int timerNum) { - +void LoLEngine::timerUpdatePortraitAnimations(int skipUpdate) { + if (skipUpdate != 1) + skipUpdate = 0; + + for (int i = 0; i < 4; i++) { + if (!(_characters[i].flags & 1) || (_characters[i].flags & 8) || (_characters[i].curFaceFrame > 1)) + continue; + + if (_characters[i].curFaceFrame != 1) { + if (--_characters[i].nextAnimUpdateCountdown <= 0 && !skipUpdate) { + _characters[i].curFaceFrame = 1; + gui_drawCharPortraitWithStats(i); + _timer->setCountdown(9, 10); + } + } else { + _characters[i].curFaceFrame = 0; + gui_drawCharPortraitWithStats(i); + _characters[i].nextAnimUpdateCountdown = (int16) _rnd.getRandomNumberRng(1, 12) + 6; + } + } } void LoLEngine::timerUpdateLampState(int timerNum) { |