diff options
author | Paul Gilbert | 2014-08-17 22:44:31 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-08-17 22:44:31 -0400 |
commit | 9150e1816c57e3852fd86123ba8e0d1c9dee8ff4 (patch) | |
tree | 008dd047ce1910ee50929853afcf9eff1ea99681 /engines/access/amazon | |
parent | 7fef53b68ccddcb8ed93c567456c73fe503ee006 (diff) | |
download | scummvm-rg350-9150e1816c57e3852fd86123ba8e0d1c9dee8ff4.tar.gz scummvm-rg350-9150e1816c57e3852fd86123ba8e0d1c9dee8ff4.tar.bz2 scummvm-rg350-9150e1816c57e3852fd86123ba8e0d1c9dee8ff4.zip |
ACCESS: Shifted some Amazon specific opcodes to the AmazonScripts class
Diffstat (limited to 'engines/access/amazon')
-rw-r--r-- | engines/access/amazon/amazon_scripts.cpp | 57 | ||||
-rw-r--r-- | engines/access/amazon/amazon_scripts.h | 9 |
2 files changed, 66 insertions, 0 deletions
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp index 2fdbcc94a2..38cf9d6a84 100644 --- a/engines/access/amazon/amazon_scripts.cpp +++ b/engines/access/amazon/amazon_scripts.cpp @@ -71,6 +71,63 @@ void AmazonScripts::executeSpecial(int commandIndex, int param1, int param2) { } } +typedef void(AmazonScripts::*AmazonScriptMethodPtr)(); + +void AmazonScripts::executeCommand(int commandIndex) { + static const AmazonScriptMethodPtr COMMAND_LIST[] = { + &AmazonScripts::CMDHELP, &AmazonScripts::CMDCYCLEBACK, + &AmazonScripts::CMDCHAPTER, &AmazonScripts::cmdSetHelp, + &AmazonScripts::cmdCenterPanel, &AmazonScripts::cmdMainPanel, + &AmazonScripts::CMDRETFLASH + }; + + if (commandIndex >= 73) + (this->*COMMAND_LIST[commandIndex - 73])(); + else + Scripts::executeCommand(commandIndex); +} + +void AmazonScripts::CMDHELP() { + error("TODO CMDHELP"); +} + +void AmazonScripts::CMDCYCLEBACK() { + error("TODO CMDCYCLEBACK"); +} +void AmazonScripts::CMDCHAPTER() { + error("TODO CMDCHAPTER"); +} + +void AmazonScripts::cmdSetHelp() { + int arrayId = (_data->readUint16LE() && 0xFF) - 1; + int helpId = _data->readUint16LE() && 0xFF; + + byte *help = _vm->_helpTbl[arrayId]; + help[helpId] = 1; + + if (_vm->_useItem == 0) { + _sequence = 11000; + searchForSequence(); + } +} + +void AmazonScripts::cmdCenterPanel() { + if (_vm->_screen->_vesaMode) { + _vm->_screen->clearScreen(); + _vm->_screen->setPanel(3); + } +} + +void AmazonScripts::cmdMainPanel() { + if (_vm->_screen->_vesaMode) { + _vm->_room->init4Quads(); + _vm->_screen->setPanel(0); + } +} + +void AmazonScripts::CMDRETFLASH() { + error("TODO CMDRETFLASH"); +} } // End of namespace Amazon diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h index b8fdaaa7f3..c9a889e3ad 100644 --- a/engines/access/amazon/amazon_scripts.h +++ b/engines/access/amazon/amazon_scripts.h @@ -33,6 +33,15 @@ namespace Amazon { class AmazonScripts: public Scripts { protected: virtual void executeSpecial(int commandIndex, int param1, int param2); + virtual void executeCommand(int commandIndex); + + void CMDHELP(); + void CMDCYCLEBACK(); + void CMDCHAPTER(); + void cmdSetHelp(); + void cmdCenterPanel(); + void cmdMainPanel(); + void CMDRETFLASH(); public: AmazonScripts(AccessEngine *vm); }; |