aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agi/preagi.h1
-rw-r--r--engines/agi/preagi_common.cpp12
2 files changed, 12 insertions, 1 deletions
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);
+ }
}
}