From 2b0346ca5e3e85c3d25b5c14b6e5880d6f70475b Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 6 Nov 2008 16:31:34 +0000 Subject: Fix for bug #2071125 - "MICKEY: Mouse movement‏", by using the waitForTimer() function from the SCUMM engine svn-id: r34914 --- engines/agi/preagi.h | 1 + engines/agi/preagi_common.cpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/agi/preagi.h b/engines/agi/preagi.h index d95035a073..73288de93c 100644 --- a/engines/agi/preagi.h +++ b/engines/agi/preagi.h @@ -88,6 +88,7 @@ public: Common::SaveFileManager* getSaveFileMan() { return _saveFileMan; } void playNote(int16 frequency, int32 length); + void waitForTimer(int msec_delay); private: int _defaultColor; diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp index ad26879ca1..74dcd75edb 100644 --- a/engines/agi/preagi_common.cpp +++ b/engines/agi/preagi_common.cpp @@ -193,7 +193,17 @@ int PreAgiEngine::getSelection(SelectionTypes type) { void PreAgiEngine::playNote(int16 frequency, int32 length) { _speakerStream->play(Audio::PCSpeaker::kWaveFormSquare, frequency, length); - _system->delayMillis(length); + waitForTimer(length); +} + +void PreAgiEngine::waitForTimer(int msec_delay) { + uint32 start_time = _system->getMillis(); + + while (_system->getMillis() < start_time + msec_delay) { + _gfx->doUpdate(); + _system->updateScreen(); + _system->delayMillis(10); + } } } -- cgit v1.2.3