diff options
author | Paul Gilbert | 2014-11-01 20:58:13 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:19:44 -0500 |
commit | 7e4d76b1fb41662cd48e21d775322d2a0ad3325e (patch) | |
tree | 663880566f6e341d021fc7d5291ff547d4daa4e4 | |
parent | 48edbf1e34993ee8eda7902197e1e6cdb33dce7b (diff) | |
download | scummvm-rg350-7e4d76b1fb41662cd48e21d775322d2a0ad3325e.tar.gz scummvm-rg350-7e4d76b1fb41662cd48e21d775322d2a0ad3325e.tar.bz2 scummvm-rg350-7e4d76b1fb41662cd48e21d775322d2a0ad3325e.zip |
ACCESS: Implemented cmdWait
-rw-r--r-- | engines/access/scripts.cpp | 23 | ||||
-rw-r--r-- | engines/access/scripts.h | 2 |
2 files changed, 22 insertions, 3 deletions
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp index 85c714f4a8..bed1a775f6 100644 --- a/engines/access/scripts.cpp +++ b/engines/access/scripts.cpp @@ -127,7 +127,7 @@ void Scripts::executeCommand(int commandIndex) { &Scripts::CMDSETBUFVID, &Scripts::CMDPLAYBUFVID, &Scripts::cmdRemoveLast, &Scripts::cmdSpecial, &Scripts::cmdSpecial, &Scripts::cmdSpecial, &Scripts::CMDSETCYCLE, &Scripts::CMDCYCLE, &Scripts::cmdCharSpeak, - &Scripts::cmdTexSpeak, &Scripts::cmdTexChoice, &Scripts::CMDWAIT, + &Scripts::cmdTexSpeak, &Scripts::cmdTexChoice, &Scripts::cmdWait, &Scripts::cmdSetConPos, &Scripts::CMDCHECKVFRAME, &Scripts::cmdJumpChoice, &Scripts::cmdReturnChoice, &Scripts::cmdClearBlock, &Scripts::cmdLoadSound, &Scripts::cmdFreeSound, &Scripts::cmdSetVideoSound, &Scripts::cmdPlayVideoSound, @@ -655,7 +655,26 @@ void Scripts::cmdTexChoice() { _vm->_bubbleBox->clearBubbles(); } -void Scripts::CMDWAIT() { error("TODO CMDWAIT"); } +void Scripts::cmdWait() { + int time = _data->readSint16LE(); + _vm->_timers[3]._timer = time; + _vm->_timers[3]._initTm = time; + _vm->_timers[3]._flag++; + _vm->_events->_keypresses.clear(); + + while (!_vm->shouldQuit() && _vm->_events->_keypresses.empty() && + !_vm->_events->_leftButton && !_vm->_events->_rightButton && + _vm->_timers[3]._flag) { + _vm->_sound->midiRepeat(); + charLoop(); + + _vm->_events->pollEvents(); + g_system->delayMillis(10); + } + + _vm->_events->debounceLeft(); + _vm->_events->zeroKeys(); +} void Scripts::cmdSetConPos() { int x = _data->readSint16LE(); diff --git a/engines/access/scripts.h b/engines/access/scripts.h index e6faa46dde..49c3b562b9 100644 --- a/engines/access/scripts.h +++ b/engines/access/scripts.h @@ -106,7 +106,7 @@ protected: void cmdCharSpeak(); void cmdTexSpeak(); void cmdTexChoice(); - void CMDWAIT(); + void cmdWait(); void cmdSetConPos(); void CMDCHECKVFRAME(); void cmdJumpChoice(); |