Skip to content

Commit

Permalink
ACCESS: Implemented cmdWait
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 13, 2014
1 parent 48edbf1 commit 7e4d76b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
23 changes: 21 additions & 2 deletions engines/access/scripts.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion engines/access/scripts.h
Expand Up @@ -106,7 +106,7 @@ class Scripts: public Manager {
void cmdCharSpeak();
void cmdTexSpeak();
void cmdTexChoice();
void CMDWAIT();
void cmdWait();
void cmdSetConPos();
void CMDCHECKVFRAME();
void cmdJumpChoice();
Expand Down

0 comments on commit 7e4d76b

Please sign in to comment.