diff options
author | Johannes Schickel | 2008-04-26 22:30:55 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-04-26 22:30:55 +0000 |
commit | 99307976d5afc6896fe00f9906a3355fd543a839 (patch) | |
tree | f9084666c88f412c95b7b16c075a2a5cd63775cf | |
parent | dd98898a23d8dfffcfe95c70fa0b528e3f418332 (diff) | |
download | scummvm-rg350-99307976d5afc6896fe00f9906a3355fd543a839.tar.gz scummvm-rg350-99307976d5afc6896fe00f9906a3355fd543a839.tar.bz2 scummvm-rg350-99307976d5afc6896fe00f9906a3355fd543a839.zip |
Finished o3_delay implementation.
svn-id: r31740
-rw-r--r-- | engines/kyra/script_v3.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/engines/kyra/script_v3.cpp b/engines/kyra/script_v3.cpp index 288b6720f9..3db0d4c23c 100644 --- a/engines/kyra/script_v3.cpp +++ b/engines/kyra/script_v3.cpp @@ -384,13 +384,24 @@ int KyraEngine_v3::o3_setMalcolmsMood(ScriptState *script) { int KyraEngine_v3::o3_delay(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_delay(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); - const uint32 delayTime = stackPos(0) * _tickLength; - const int delayFunc = stackPos(1); + if (stackPos(1)) { + uint32 maxWaitTime = _system->getMillis() + stackPos(0) * _tickLength; + while (_system->getMillis() < maxWaitTime) { + int inputFlag = checkInput(0); + removeInputTop(); - if (delayFunc) - warning("STUB o3_delay func 1"); + if (inputFlag == 198 || inputFlag == 199) + return 1; - delay(delayTime, true); + if (_chatText) + updateWithText(); + else + update(); + _system->delayMillis(10); + } + } else { + delay(stackPos(0) * _tickLength, true); + } return 0; } |