diff options
author | Paul Gilbert | 2014-08-08 23:29:17 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-08 23:29:17 -0400 |
commit | a9b8369274c74e2364e40b8ac3e0fb735443ae51 (patch) | |
tree | e810e699e2ba2029cb51a40d8bd5213400e464ed /engines | |
parent | fb0a1f5597145581cf082f0ef3ffcf9bea141cc9 (diff) | |
download | scummvm-rg350-a9b8369274c74e2364e40b8ac3e0fb735443ae51.tar.gz scummvm-rg350-a9b8369274c74e2364e40b8ac3e0fb735443ae51.tar.bz2 scummvm-rg350-a9b8369274c74e2364e40b8ac3e0fb735443ae51.zip |
ACCESS: Implemented several script commands
Diffstat (limited to 'engines')
-rw-r--r-- | engines/access/scripts.cpp | 76 | ||||
-rw-r--r-- | engines/access/scripts.h | 14 |
2 files changed, 72 insertions, 18 deletions
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp index 337aa43eb5..38f9f92329 100644 --- a/engines/access/scripts.cpp +++ b/engines/access/scripts.cpp @@ -78,9 +78,9 @@ int Scripts::executeScript() { void Scripts::executeCommand(int commandIndex, const byte *&pScript) { static const ScriptMethodPtr COMMAND_LIST[] = { - &Scripts::CMDENDOBJECT, &Scripts::CMDJUMPLOOK, &Scripts::CMDJUMPHELP, &Scripts::CMDJUMPGET, &Scripts::CMDJUMPMOVE, - &Scripts::CMDJUMPUSE, &Scripts::CMDJUMPTALK, &Scripts::CMDNULL, &Scripts::CMDPRINT, &Scripts::CMDRETPOS, &Scripts::CMDANIM, - &Scripts::CMDSETFLAG, &Scripts::CMDCHECKFLAG, &Scripts::cmdGoto, &Scripts::CMDSETINV, &Scripts::CMDSETINV, + &Scripts::CMDENDOBJECT, &Scripts::cmdJumpLook, &Scripts::cmdJumpHelp, &Scripts::cmdJumpGet, &Scripts::cmdJumpMove, + &Scripts::cmdJumpUse, &Scripts::cmdJumpTalk, &Scripts::CMDNULL, &Scripts::CMDPRINT, &Scripts::CMDRETPOS, &Scripts::CMDANIM, + &Scripts::cmdSetFlag, &Scripts::CMDCHECKFLAG, &Scripts::cmdGoto, &Scripts::CMDSETINV, &Scripts::CMDSETINV, &Scripts::CMDCHECKINV, &Scripts::CMDSETTEX, &Scripts::CMDNEWROOM, &Scripts::CMDCONVERSE, &Scripts::CMDCHECKFRAME, &Scripts::CMDCHECKANIM, &Scripts::CMDSND, &Scripts::CMDRETNEG, &Scripts::CMDRETPOS, &Scripts::CMDCHECKLOC, &Scripts::CMDSETANIM, &Scripts::CMDDISPINV, &Scripts::CMDSETTIMER, &Scripts::CMDSETTIMER, &Scripts::CMDCHECKTIMER, &Scripts::CMDSETTRAVEL, @@ -100,18 +100,72 @@ void Scripts::executeCommand(int commandIndex, const byte *&pScript) { } void Scripts::CMDENDOBJECT(const byte *&pScript) { } -void Scripts::CMDJUMPLOOK(const byte *&pScript) { } -void Scripts::CMDJUMPHELP(const byte *&pScript) { } -void Scripts::CMDJUMPGET(const byte *&pScript) { } -void Scripts::CMDJUMPMOVE(const byte *&pScript) { } -void Scripts::CMDJUMPUSE(const byte *&pScript) { } -void Scripts::CMDJUMPTALK(const byte *&pScript) { } + +void Scripts::cmdJumpLook(const byte *&pScript) { + if (_vm->_selectCommand == 0) + cmdGoto(pScript); + else + pScript += 2; +} + +void Scripts::cmdJumpHelp(const byte *&pScript) { + if (_vm->_selectCommand == 8) + cmdGoto(pScript); + else + pScript += 2; +} + +void Scripts::cmdJumpGet(const byte *&pScript) { + if (_vm->_selectCommand == 3) + cmdGoto(pScript); + else + pScript += 2; +} + +void Scripts::cmdJumpMove(const byte *&pScript) { + if (_vm->_selectCommand == 2) + cmdGoto(pScript); + else + pScript += 2; +} + +void Scripts::cmdJumpUse(const byte *&pScript) { + if (_vm->_selectCommand == 4) + cmdGoto(pScript); + else + pScript += 2; +} + +void Scripts::cmdJumpTalk(const byte *&pScript) { + if (_vm->_selectCommand == 6) + cmdGoto(pScript); + else + pScript += 2; +} + void Scripts::CMDNULL(const byte *&pScript) { } void Scripts::CMDPRINT(const byte *&pScript) { } void Scripts::CMDRETPOS(const byte *&pScript) { } void Scripts::CMDANIM(const byte *&pScript) { } -void Scripts::CMDSETFLAG(const byte *&pScript) { } -void Scripts::CMDCHECKFLAG(const byte *&pScript) { } + +void Scripts::cmdSetFlag(const byte *&pScript) { + int flagNum = *pScript++; + byte flagVal = *pScript++; + assert(flagNum < 100); + _vm->_flags[flagNum] = flagVal; +} + +void Scripts::CMDCHECKFLAG(const byte *&pScript) { + int flagNum = READ_LE_UINT16(pScript); + int flagVal = READ_LE_UINT16(pScript + 2); + pScript += 4; + assert(flagNum < 100); + + if (_vm->_flags[flagNum] == (flagVal & 0xff)) + cmdGoto(pScript); + else + pScript += 2; +} void Scripts::cmdGoto(const byte *&pScript) { _sequence = READ_LE_UINT16(pScript); diff --git a/engines/access/scripts.h b/engines/access/scripts.h index fc75e9e9ab..5e733dbd47 100644 --- a/engines/access/scripts.h +++ b/engines/access/scripts.h @@ -38,17 +38,17 @@ protected: virtual void executeCommand(int commandIndex, const byte *&pScript); void CMDENDOBJECT(const byte *&pScript); - void CMDJUMPLOOK(const byte *&pScript); - void CMDJUMPHELP(const byte *&pScript); - void CMDJUMPGET(const byte *&pScript); - void CMDJUMPMOVE(const byte *&pScript); - void CMDJUMPUSE(const byte *&pScript); - void CMDJUMPTALK(const byte *&pScript); + void cmdJumpLook(const byte *&pScript); + void cmdJumpHelp(const byte *&pScript); + void cmdJumpGet(const byte *&pScript); + void cmdJumpMove(const byte *&pScript); + void cmdJumpUse(const byte *&pScript); + void cmdJumpTalk(const byte *&pScript); void CMDNULL(const byte *&pScript); void CMDPRINT(const byte *&pScript); void CMDRETPOS(const byte *&pScript); void CMDANIM(const byte *&pScript); - void CMDSETFLAG(const byte *&pScript); + void cmdSetFlag(const byte *&pScript); void CMDCHECKFLAG(const byte *&pScript); /** |