diff options
-rw-r--r-- | engines/mohawk/riven_scripts.cpp | 7 | ||||
-rw-r--r-- | engines/mohawk/riven_stack.cpp | 10 | ||||
-rw-r--r-- | engines/mohawk/riven_stack.h | 9 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/aspit.cpp | 42 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/aspit.h | 42 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/bspit.cpp | 52 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/bspit.h | 38 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/gspit.cpp | 40 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/gspit.h | 40 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/jspit.cpp | 70 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/jspit.h | 58 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/ospit.cpp | 30 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/ospit.h | 16 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/pspit.cpp | 20 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/pspit.h | 14 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/rspit.cpp | 8 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/rspit.h | 8 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/tspit.cpp | 40 | ||||
-rw-r--r-- | engines/mohawk/riven_stacks/tspit.h | 36 |
19 files changed, 293 insertions, 287 deletions
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index c99d8bd294..be21471586 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -473,7 +473,12 @@ void RivenSimpleCommand::delay(uint16 op, uint16 argc, uint16 *argv) { // Command 17: call external command void RivenSimpleCommand::runExternalCommand(uint16 op, uint16 argc, uint16 *argv) { - _vm->getStack()->runCommand(argc, argv); + uint16 commandNameid = argv[0]; + uint16 argumentCount = argv[1]; + + Common::Array<uint16> commandArgs(argv + 2, argumentCount); + + _vm->getStack()->runCommand(commandNameid, commandArgs); } // Command 18: transition diff --git a/engines/mohawk/riven_stack.cpp b/engines/mohawk/riven_stack.cpp index 66c4d57177..323cbc0d6a 100644 --- a/engines/mohawk/riven_stack.cpp +++ b/engines/mohawk/riven_stack.cpp @@ -154,22 +154,22 @@ void RivenStack::dump() const { } } -void RivenStack::runCommand(uint16 argc, uint16 *argv) { - Common::String externalCommandName = getName(kExternalCommandNames, argv[0]); +void RivenStack::runCommand(uint16 commandNameId, const ArgumentArray &args) { + Common::String externalCommandName = getName(kExternalCommandNames, commandNameId); if (!_commands.contains(externalCommandName)) { error("Unknown external command \'%s\'", externalCommandName.c_str()); } - (*_commands[externalCommandName])(argv[1], argv[1] ? argv + 2 : nullptr); + (*_commands[externalCommandName])(args); } void RivenStack::registerCommand(const Common::String &name, ExternalCommand *command) { _commands[name] = Common::SharedPtr<ExternalCommand>(command); } -void RivenStack::xflies(uint16 argc, uint16 *argv) { - _vm->_gfx->setFliesEffect(argv[1], argv[0] == 1); +void RivenStack::xflies(const ArgumentArray &args) { + _vm->_gfx->setFliesEffect(args[1], args[0] == 1); } uint16 RivenStack::getComboDigit(uint32 correctCombo, uint32 digit) { diff --git a/engines/mohawk/riven_stack.h b/engines/mohawk/riven_stack.h index d4d7614749..429169b960 100644 --- a/engines/mohawk/riven_stack.h +++ b/engines/mohawk/riven_stack.h @@ -83,6 +83,7 @@ public: RivenStack(MohawkEngine_Riven *vm, uint16 id); virtual ~RivenStack(); + typedef Common::Array<uint16> ArgumentArray; typedef Common::Functor0<void> TimerProc; /** Get the id of the stack */ @@ -108,7 +109,7 @@ public: uint32 getCardGlobalId(uint16 cardId) const; /** Run an external command with the specified parameters */ - void runCommand(uint16 argc, uint16 *argv); + void runCommand(uint16 commandNameId, const Common::Array<uint16> &args); /** Write all of the stack's data including its cards to standard output */ void dump() const; @@ -153,7 +154,7 @@ public: void keyForceUp(); // Common external commands - void xflies(uint16 argc, uint16 *argv); // Start the "flies" effect + void xflies(const ArgumentArray &args); // Start the "flies" effect // Miscellaneous uint16 getComboDigit(uint32 correctCombo, uint32 digit); @@ -163,7 +164,7 @@ public: bool pageTurn(RivenTransition transition); protected: - typedef Common::Functor2<uint16, uint16 *, void> ExternalCommand; + typedef Common::Functor1<const ArgumentArray &, void> ExternalCommand; MohawkEngine_Riven *_vm; @@ -178,7 +179,7 @@ private: #define REGISTER_COMMAND(cls, method) \ registerCommand( \ - #method, new Common::Functor2Mem<uint16, uint16 *, void, cls>(this, &cls::method) \ + #method, new Common::Functor1Mem<const Common::Array<uint16> &, void, cls>(this, &cls::method) \ ) #define TIMER(cls, method) \ diff --git a/engines/mohawk/riven_stacks/aspit.cpp b/engines/mohawk/riven_stacks/aspit.cpp index 4b67cd1e34..c8d5dec377 100644 --- a/engines/mohawk/riven_stacks/aspit.cpp +++ b/engines/mohawk/riven_stacks/aspit.cpp @@ -62,12 +62,12 @@ ASpit::ASpit(MohawkEngine_Riven *vm) : REGISTER_COMMAND(ASpit, xaexittomain); } -void ASpit::xastartupbtnhide(uint16 argc, uint16 *argv) { +void ASpit::xastartupbtnhide(const ArgumentArray &args) { // The original game hides the start/setup buttons depending on an ini entry. // It's safe to ignore this command. } -void ASpit::xasetupcomplete(uint16 argc, uint16 *argv) { +void ASpit::xasetupcomplete(const ArgumentArray &args) { // The original game sets an ini entry to disable the setup button and use the // start button only. It's safe to ignore this part of the command. uint16 menuCardId = getCardStackId(0xE2E); @@ -75,7 +75,7 @@ void ASpit::xasetupcomplete(uint16 argc, uint16 *argv) { _vm->_scriptMan->runScript(goToMenuScript, false); } -void ASpit::xaatrusopenbook(uint16 argc, uint16 *argv) { +void ASpit::xaatrusopenbook(const ArgumentArray &args) { // Get the variable uint32 &page = _vm->_vars["aatrusbook"]; @@ -97,11 +97,11 @@ void ASpit::xaatrusopenbook(uint16 argc, uint16 *argv) { _vm->getCard()->drawPicture(page); } -void ASpit::xaatrusbookback(uint16 argc, uint16 *argv) { +void ASpit::xaatrusbookback(const ArgumentArray &args) { _vm->_inventory->backFromItemScript(); } -void ASpit::xaatrusbookprevpage(uint16 argc, uint16 *argv) { +void ASpit::xaatrusbookprevpage(const ArgumentArray &args) { // Get the page variable uint32 &page = _vm->_vars["aatrusbook"]; @@ -125,7 +125,7 @@ void ASpit::xaatrusbookprevpage(uint16 argc, uint16 *argv) { } } -void ASpit::xaatrusbooknextpage(uint16 argc, uint16 *argv) { +void ASpit::xaatrusbooknextpage(const ArgumentArray &args) { // Get the page variable uint32 &page = _vm->_vars["aatrusbook"]; @@ -149,7 +149,7 @@ void ASpit::xaatrusbooknextpage(uint16 argc, uint16 *argv) { } } -void ASpit::xacathopenbook(uint16 argc, uint16 *argv) { +void ASpit::xacathopenbook(const ArgumentArray &args) { // Get the variable uint32 page = _vm->_vars["acathbook"]; @@ -201,11 +201,11 @@ void ASpit::cathBookDrawTelescopeCombination() {// Draw the telescope combinatio } } -void ASpit::xacathbookback(uint16 argc, uint16 *argv) { +void ASpit::xacathbookback(const ArgumentArray &args) { _vm->_inventory->backFromItemScript(); } -void ASpit::xacathbookprevpage(uint16 argc, uint16 *argv) { +void ASpit::xacathbookprevpage(const ArgumentArray &args) { // Get the variable uint32 &page = _vm->_vars["acathbook"]; @@ -230,7 +230,7 @@ void ASpit::xacathbookprevpage(uint16 argc, uint16 *argv) { } } -void ASpit::xacathbooknextpage(uint16 argc, uint16 *argv) { +void ASpit::xacathbooknextpage(const ArgumentArray &args) { // Get the variable uint32 &page = _vm->_vars["acathbook"]; @@ -255,13 +255,13 @@ void ASpit::xacathbooknextpage(uint16 argc, uint16 *argv) { } } -void ASpit::xtrapbookback(uint16 argc, uint16 *argv) { +void ASpit::xtrapbookback(const ArgumentArray &args) { // Return to where we were before entering the book _vm->_vars["atrap"] = 0; _vm->_inventory->backFromItemScript(); } -void ASpit::xatrapbookclose(uint16 argc, uint16 *argv) { +void ASpit::xatrapbookclose(const ArgumentArray &args) { // Close the trap book _vm->_vars["atrap"] = 0; @@ -276,7 +276,7 @@ void ASpit::xatrapbookclose(uint16 argc, uint16 *argv) { _vm->getCard()->enter(false); } -void ASpit::xatrapbookopen(uint16 argc, uint16 *argv) { +void ASpit::xatrapbookopen(const ArgumentArray &args) { // Open the trap book _vm->_vars["atrap"] = 1; @@ -285,24 +285,24 @@ void ASpit::xatrapbookopen(uint16 argc, uint16 *argv) { _vm->getCard()->enter(false); } -void ASpit::xarestoregame(uint16 argc, uint16 *argv) { +void ASpit::xarestoregame(const ArgumentArray &args) { // Launch the load game dialog _vm->runLoadDialog(); } -void ASpit::xadisablemenureturn(uint16 argc, uint16 *argv) { +void ASpit::xadisablemenureturn(const ArgumentArray &args) { // This function would normally enable the Windows menu item for // returning to the main menu. Ctrl+r will do this instead. // The original also had this shortcut. } -void ASpit::xaenablemenureturn(uint16 argc, uint16 *argv) { +void ASpit::xaenablemenureturn(const ArgumentArray &args) { // This function would normally enable the Windows menu item for // returning to the main menu. Ctrl+r will do this instead. // The original also had this shortcut. } -void ASpit::xalaunchbrowser(uint16 argc, uint16 *argv) { +void ASpit::xalaunchbrowser(const ArgumentArray &args) { // Well, we can't launch a browser for obvious reasons ;) // The original text is as follows (for reference): @@ -327,7 +327,7 @@ void ASpit::xalaunchbrowser(uint16 argc, uint16 *argv) { dialog.runModal(); } -void ASpit::xadisablemenuintro(uint16 argc, uint16 *argv) { +void ASpit::xadisablemenuintro(const ArgumentArray &args) { // This function would normally enable the Windows menu item for // playing the intro. Ctrl+p will play the intro movies instead. // The original also had this shortcut. @@ -335,7 +335,7 @@ void ASpit::xadisablemenuintro(uint16 argc, uint16 *argv) { _vm->_inventory->forceHidden(true); } -void ASpit::xaenablemenuintro(uint16 argc, uint16 *argv) { +void ASpit::xaenablemenuintro(const ArgumentArray &args) { // This function would normally enable the Windows menu item for // playing the intro. Ctrl+p will play the intro movies instead. // The original also had this shortcut. @@ -344,12 +344,12 @@ void ASpit::xaenablemenuintro(uint16 argc, uint16 *argv) { _vm->_inventory->forceHidden(false); } -void ASpit::xademoquit(uint16 argc, uint16 *argv) { +void ASpit::xademoquit(const ArgumentArray &args) { // Exactly as it says on the tin. In the demo, this function quits. _vm->quitGame(); } -void ASpit::xaexittomain(uint16 argc, uint16 *argv) { +void ASpit::xaexittomain(const ArgumentArray &args) { // One could potentially implement this function, but there would be no // point. This function is only used in the demo's aspit card 9 update // screen script. However, card 9 is not accessible from the game without diff --git a/engines/mohawk/riven_stacks/aspit.h b/engines/mohawk/riven_stacks/aspit.h index feeba6637c..5321db0ff6 100644 --- a/engines/mohawk/riven_stacks/aspit.h +++ b/engines/mohawk/riven_stacks/aspit.h @@ -36,37 +36,37 @@ public: ASpit(MohawkEngine_Riven *vm); // External commands - Main Menu - void xastartupbtnhide(uint16 argc, uint16 *argv); - void xasetupcomplete(uint16 argc, uint16 *argv); + void xastartupbtnhide(const ArgumentArray &args); + void xasetupcomplete(const ArgumentArray &args); // External commands - Atrus' Journal - void xaatrusopenbook(uint16 argc, uint16 *argv); - void xaatrusbookback(uint16 argc, uint16 *argv); - void xaatrusbookprevpage(uint16 argc, uint16 *argv); - void xaatrusbooknextpage(uint16 argc, uint16 *argv); + void xaatrusopenbook(const ArgumentArray &args); + void xaatrusbookback(const ArgumentArray &args); + void xaatrusbookprevpage(const ArgumentArray &args); + void xaatrusbooknextpage(const ArgumentArray &args); // External commands - Catherine's Journal - void xacathopenbook(uint16 argc, uint16 *argv); - void xacathbookback(uint16 argc, uint16 *argv); - void xacathbookprevpage(uint16 argc, uint16 *argv); - void xacathbooknextpage(uint16 argc, uint16 *argv); + void xacathopenbook(const ArgumentArray &args); + void xacathbookback(const ArgumentArray &args); + void xacathbookprevpage(const ArgumentArray &args); + void xacathbooknextpage(const ArgumentArray &args); // External commands - Trap Book - void xtrapbookback(uint16 argc, uint16 *argv); - void xatrapbookclose(uint16 argc, uint16 *argv); - void xatrapbookopen(uint16 argc, uint16 *argv); + void xtrapbookback(const ArgumentArray &args); + void xatrapbookclose(const ArgumentArray &args); + void xatrapbookopen(const ArgumentArray &args); // External commands - DVD-specific - void xarestoregame(uint16 argc, uint16 *argv); + void xarestoregame(const ArgumentArray &args); // External commands - Demo-specific - void xadisablemenureturn(uint16 argc, uint16 *argv); - void xaenablemenureturn(uint16 argc, uint16 *argv); - void xalaunchbrowser(uint16 argc, uint16 *argv); - void xadisablemenuintro(uint16 argc, uint16 *argv); - void xaenablemenuintro(uint16 argc, uint16 *argv); - void xademoquit(uint16 argc, uint16 *argv); - void xaexittomain(uint16 argc, uint16 *argv); + void xadisablemenureturn(const ArgumentArray &args); + void xaenablemenureturn(const ArgumentArray &args); + void xalaunchbrowser(const ArgumentArray &args); + void xadisablemenuintro(const ArgumentArray &args); + void xaenablemenuintro(const ArgumentArray &args); + void xademoquit(const ArgumentArray &args); + void xaexittomain(const ArgumentArray &args); private: void cathBookDrawTelescopeCombination(); diff --git a/engines/mohawk/riven_stacks/bspit.cpp b/engines/mohawk/riven_stacks/bspit.cpp index dc412fe4a0..51d3656761 100644 --- a/engines/mohawk/riven_stacks/bspit.cpp +++ b/engines/mohawk/riven_stacks/bspit.cpp @@ -55,7 +55,7 @@ BSpit::BSpit(MohawkEngine_Riven *vm) : REGISTER_COMMAND(BSpit, xbchipper); } -void BSpit::xblabopenbook(uint16 argc, uint16 *argv) { +void BSpit::xblabopenbook(const ArgumentArray &args) { // Get the variable uint32 page = _vm->_vars["blabpage"]; @@ -91,7 +91,7 @@ void BSpit::labBookDrawDomeCombination() const { assert(numCount == 5); // Sanity check } -void BSpit::xblabbookprevpage(uint16 argc, uint16 *argv) { +void BSpit::xblabbookprevpage(const ArgumentArray &args) { // Get the page variable uint32 &page = _vm->_vars["blabpage"]; @@ -120,7 +120,7 @@ void BSpit::xblabbookprevpage(uint16 argc, uint16 *argv) { } } -void BSpit::xblabbooknextpage(uint16 argc, uint16 *argv) { +void BSpit::xblabbooknextpage(const ArgumentArray &args) { // Get the page variable uint32 &page = _vm->_vars["blabpage"]; @@ -149,7 +149,7 @@ void BSpit::xblabbooknextpage(uint16 argc, uint16 *argv) { } } -void BSpit::xsoundplug(uint16 argc, uint16 *argv) { +void BSpit::xsoundplug(const ArgumentArray &args) { if (_vm->_vars["bcratergg"] == 0) { if (_vm->_vars["bblrwtr"] == 0) { _vm->getCard()->overrideSound(0, 2); @@ -161,7 +161,7 @@ void BSpit::xsoundplug(uint16 argc, uint16 *argv) { } } -void BSpit::xbchangeboiler(uint16 argc, uint16 *argv) { +void BSpit::xbchangeboiler(const ArgumentArray &args) { uint32 heat = _vm->_vars["bheat"]; uint32 water = _vm->_vars["bblrwtr"]; uint32 platform = _vm->_vars["bblrgrt"]; @@ -169,7 +169,7 @@ void BSpit::xbchangeboiler(uint16 argc, uint16 *argv) { // Stop any background videos _vm->_video->closeVideos(); - if (argv[0] == 1) { + if (args[0] == 1) { // Water is filling/draining from the boiler if (water == 0) { if (platform == 1) @@ -187,7 +187,7 @@ void BSpit::xbchangeboiler(uint16 argc, uint16 *argv) { else _vm->getCard()->playMovie(13); } - } else if (argv[0] == 2 && water != 0) { + } else if (args[0] == 2 && water != 0) { if (heat == 1) { // Turning on the heat if (platform == 1) @@ -201,7 +201,7 @@ void BSpit::xbchangeboiler(uint16 argc, uint16 *argv) { else _vm->getCard()->playMovie(15); } - } else if (argv[0] == 3) { + } else if (args[0] == 3) { if (platform == 1) { // Lowering the platform if (water == 1) { @@ -225,16 +225,16 @@ void BSpit::xbchangeboiler(uint16 argc, uint16 *argv) { } } - if (argc > 1) - _vm->getCard()->playSound(argv[1]); - else if (argv[0] == 2) + if (args.size() > 1) + _vm->getCard()->playSound(args[1]); + else if (args[0] == 2) _vm->getCard()->playSound(1); RivenVideo *video = _vm->_video->openSlot(11); video->playBlocking(); } -void BSpit::xbupdateboiler(uint16 argc, uint16 *argv) { +void BSpit::xbupdateboiler(const ArgumentArray &args) { if (_vm->_vars["bheat"] != 0) { if (_vm->_vars["bblrgrt"] == 0) { _vm->getCard()->playMovie(8); @@ -263,7 +263,7 @@ void BSpit::ytramTrapTimer() { checkYtramCatch(true); } -void BSpit::xbsettrap(uint16 argc, uint16 *argv) { +void BSpit::xbsettrap(const ArgumentArray &args) { // Set the Ytram trap // We can catch the Ytram between 10 seconds and 3 minutes from now @@ -303,12 +303,12 @@ void BSpit::checkYtramCatch(bool playSound) { _vm->_sound->playSound(33); } -void BSpit::xbcheckcatch(uint16 argc, uint16 *argv) { +void BSpit::xbcheckcatch(const ArgumentArray &args) { // Just pass our parameter along... - checkYtramCatch(argv[0] != 0); + checkYtramCatch(args[0] != 0); } -void BSpit::xbait(uint16 argc, uint16 *argv) { +void BSpit::xbait(const ArgumentArray &args) { // Set the cursor to the pellet _vm->_cursor->setCursor(kRivenPelletCursor); @@ -333,7 +333,7 @@ void BSpit::xbait(uint16 argc, uint16 *argv) { } } -void BSpit::xbfreeytram(uint16 argc, uint16 *argv) { +void BSpit::xbfreeytram(const ArgumentArray &args) { // Play a random Ytram movie after freeing it uint16 mlstId; @@ -363,7 +363,7 @@ void BSpit::xbfreeytram(uint16 argc, uint16 *argv) { _vm->getCard()->drawPicture(4); } -void BSpit::xbaitplate(uint16 argc, uint16 *argv) { +void BSpit::xbaitplate(const ArgumentArray &args) { // Remove the pellet from the plate and put it in your hand _vm->_cursor->setCursor(kRivenPelletCursor); _vm->getCard()->drawPicture(3); @@ -392,31 +392,31 @@ void BSpit::xbaitplate(uint16 argc, uint16 *argv) { } } -void BSpit::xbisland190_opencard(uint16 argc, uint16 *argv) { +void BSpit::xbisland190_opencard(const ArgumentArray &args) { checkDomeSliders(); } -void BSpit::xbisland190_resetsliders(uint16 argc, uint16 *argv) { +void BSpit::xbisland190_resetsliders(const ArgumentArray &args) { resetDomeSliders(9); } -void BSpit::xbisland190_slidermd(uint16 argc, uint16 *argv) { +void BSpit::xbisland190_slidermd(const ArgumentArray &args) { dragDomeSlider(9); } -void BSpit::xbisland190_slidermw(uint16 argc, uint16 *argv) { +void BSpit::xbisland190_slidermw(const ArgumentArray &args) { checkSliderCursorChange(9); } -void BSpit::xbscpbtn(uint16 argc, uint16 *argv) { +void BSpit::xbscpbtn(const ArgumentArray &args) { runDomeButtonMovie(); } -void BSpit::xbisland_domecheck(uint16 argc, uint16 *argv) { +void BSpit::xbisland_domecheck(const ArgumentArray &args) { runDomeCheck(); } -void BSpit::xvalvecontrol(uint16 argc, uint16 *argv) { +void BSpit::xvalvecontrol(const ArgumentArray &args) { Common::Point startPos = getMouseDragStartPosition(); // Set the cursor to the closed position @@ -481,7 +481,7 @@ void BSpit::valveChangePosition(uint32 valvePosition, uint16 videoId, uint16 pic _vm->_vars["bvalve"] = valvePosition; } -void BSpit::xbchipper(uint16 argc, uint16 *argv) { +void BSpit::xbchipper(const ArgumentArray &args) { Common::Point startPos = getMouseDragStartPosition(); bool pulledLever = false; diff --git a/engines/mohawk/riven_stacks/bspit.h b/engines/mohawk/riven_stacks/bspit.h index d7ce1feea5..a391d38cea 100644 --- a/engines/mohawk/riven_stacks/bspit.h +++ b/engines/mohawk/riven_stacks/bspit.h @@ -36,35 +36,35 @@ public: BSpit(MohawkEngine_Riven *vm); // External commands - Gehn's Lab Journal - void xblabopenbook(uint16 argc, uint16 *argv); - void xblabbooknextpage(uint16 argc, uint16 *argv); - void xblabbookprevpage(uint16 argc, uint16 *argv); + void xblabopenbook(const ArgumentArray &args); + void xblabbooknextpage(const ArgumentArray &args); + void xblabbookprevpage(const ArgumentArray &args); // External commands - Boiler Puzzle - void xsoundplug(uint16 argc, uint16 *argv); - void xbchangeboiler(uint16 argc, uint16 *argv); - void xbupdateboiler(uint16 argc, uint16 *argv); + void xsoundplug(const ArgumentArray &args); + void xbchangeboiler(const ArgumentArray &args); + void xbupdateboiler(const ArgumentArray &args); // External commands - Frog Trap - void xbsettrap(uint16 argc, uint16 *argv); - void xbcheckcatch(uint16 argc, uint16 *argv); - void xbait(uint16 argc, uint16 *argv); - void xbfreeytram(uint16 argc, uint16 *argv); - void xbaitplate(uint16 argc, uint16 *argv); + void xbsettrap(const ArgumentArray &args); + void xbcheckcatch(const ArgumentArray &args); + void xbait(const ArgumentArray &args); + void xbfreeytram(const ArgumentArray &args); + void xbaitplate(const ArgumentArray &args); // External commands - Dome - void xbisland190_opencard(uint16 argc, uint16 *argv); - void xbisland190_resetsliders(uint16 argc, uint16 *argv); - void xbisland190_slidermd(uint16 argc, uint16 *argv); - void xbisland190_slidermw(uint16 argc, uint16 *argv); - void xbscpbtn(uint16 argc, uint16 *argv); - void xbisland_domecheck(uint16 argc, uint16 *argv); + void xbisland190_opencard(const ArgumentArray &args); + void xbisland190_resetsliders(const ArgumentArray &args); + void xbisland190_slidermd(const ArgumentArray &args); + void xbisland190_slidermw(const ArgumentArray &args); + void xbscpbtn(const ArgumentArray &args); + void xbisland_domecheck(const ArgumentArray &args); // External commands - Water Control - void xvalvecontrol(uint16 argc, uint16 *argv); + void xvalvecontrol(const ArgumentArray &args); // External commands - Run the Wood Chipper - void xbchipper(uint16 argc, uint16 *argv); + void xbchipper(const ArgumentArray &args); // Time callback void ytramTrapTimer(); diff --git a/engines/mohawk/riven_stacks/gspit.cpp b/engines/mohawk/riven_stacks/gspit.cpp index 305ea677c9..5c36e88c93 100644 --- a/engines/mohawk/riven_stacks/gspit.cpp +++ b/engines/mohawk/riven_stacks/gspit.cpp @@ -83,12 +83,12 @@ void GSpit::lowerPins() { upMovie = 0; } -void GSpit::xgresetpins(uint16 argc, uint16 *argv) { +void GSpit::xgresetpins(const ArgumentArray &args) { // As the function name suggests, this resets the pins lowerPins(); } -void GSpit::xgrotatepins(uint16 argc, uint16 *argv) { +void GSpit::xgrotatepins(const ArgumentArray &args) { // Rotate the pins, if necessary if (_vm->_vars["gpinup"] == 0) @@ -113,7 +113,7 @@ void GSpit::xgrotatepins(uint16 argc, uint16 *argv) { video->disable(); } -void GSpit::xgpincontrols(uint16 argc, uint16 *argv) { +void GSpit::xgpincontrols(const ArgumentArray &args) { // Handle a click on a section of an island RivenHotspot *panel = _vm->getCard()->getHotspotByBlstId(13); @@ -207,31 +207,31 @@ void GSpit::xgpincontrols(uint16 argc, uint16 *argv) { curImage = image; } -void GSpit::xgisland25_opencard(uint16 argc, uint16 *argv) { +void GSpit::xgisland25_opencard(const ArgumentArray &args) { checkDomeSliders(); } -void GSpit::xgisland25_resetsliders(uint16 argc, uint16 *argv) { +void GSpit::xgisland25_resetsliders(const ArgumentArray &args) { resetDomeSliders(11); } -void GSpit::xgisland25_slidermd(uint16 argc, uint16 *argv) { +void GSpit::xgisland25_slidermd(const ArgumentArray &args) { dragDomeSlider(11); } -void GSpit::xgisland25_slidermw(uint16 argc, uint16 *argv) { +void GSpit::xgisland25_slidermw(const ArgumentArray &args) { checkSliderCursorChange(11); } -void GSpit::xgscpbtn(uint16 argc, uint16 *argv) { +void GSpit::xgscpbtn(const ArgumentArray &args) { runDomeButtonMovie(); } -void GSpit::xgisland1490_domecheck(uint16 argc, uint16 *argv) { +void GSpit::xgisland1490_domecheck(const ArgumentArray &args) { runDomeCheck(); } -void GSpit::xgplateau3160_dopools(uint16 argc, uint16 *argv) { +void GSpit::xgplateau3160_dopools(const ArgumentArray &args) { // Play the deactivation of a pool if one is active and a different one is activated if (_vm->_vars["glkbtns"] != 0) { RivenVideo *video = _vm->_video->openSlot(_vm->_vars["glkbtns"] * 2); @@ -239,12 +239,12 @@ void GSpit::xgplateau3160_dopools(uint16 argc, uint16 *argv) { } } -void GSpit::xgwt200_scribetime(uint16 argc, uint16 *argv) { +void GSpit::xgwt200_scribetime(const ArgumentArray &args) { // Get the current time _vm->_vars["gscribetime"] = _vm->_system->getMillis(); } -void GSpit::xgwt900_scribe(uint16 argc, uint16 *argv) { +void GSpit::xgwt900_scribe(const ArgumentArray &args) { uint32 &scribeVar = _vm->_vars["gscribe"]; if (scribeVar == 1 && _vm->_system->getMillis() > _vm->_vars["gscribetime"] + 40000) @@ -253,7 +253,7 @@ void GSpit::xgwt900_scribe(uint16 argc, uint16 *argv) { static const uint16 s_viewerTimeIntervals[] = { 0, 816, 1617, 2416, 3216, 4016, 4816, 5616, 6416, 7216, 8016, 8816 }; -void GSpit::xgrviewer(uint16 argc, uint16 *argv) { +void GSpit::xgrviewer(const ArgumentArray &args) { // This controls the viewer on the right side of the 'throne' on Garden Island // (It shows the colors of the marbles) @@ -290,7 +290,7 @@ void GSpit::xgrviewer(uint16 argc, uint16 *argv) { _vm->getCard()->enter(false); } -void GSpit::xgplaywhark(uint16 argc, uint16 *argv) { +void GSpit::xgplaywhark(const ArgumentArray &args) { // The whark response to using the lights // If we've gotten a visit already since we turned out the light, bail out @@ -335,7 +335,7 @@ void GSpit::xgplaywhark(uint16 argc, uint16 *argv) { video->playBlocking(); } -void GSpit::xgwharksnd(uint16 argc, uint16 *argv) { +void GSpit::xgwharksnd(const ArgumentArray &args) { uint32 wharkVisits = _vm->_vars["gwhark"]; // If we're at 5 or more, the whark will no longer visit us :( @@ -357,7 +357,7 @@ void GSpit::xgwharksnd(uint16 argc, uint16 *argv) { _vm->_sound->playCardSound(Common::String::format("gWharkSolo%d", soundId)); } -void GSpit::xglviewer(uint16 argc, uint16 *argv) { +void GSpit::xglviewer(const ArgumentArray &args) { // This controls the viewer on the left side of the 'throne' on Garden Island // (It shows the village from the middle of the lake) @@ -383,13 +383,13 @@ void GSpit::xglviewer(uint16 argc, uint16 *argv) { _vm->getCard()->drawPicture(curPos + 2); } -void GSpit::xglview_villageon(uint16 argc, uint16 *argv) { +void GSpit::xglview_villageon(const ArgumentArray &args) { // Turn on the left viewer to 'village mode' _vm->_vars["glview"] = 2; _vm->getCard()->drawPicture(_vm->_vars["glviewpos"] + 2); } -void GSpit::xglview_villageoff(uint16 argc, uint16 *argv) { +void GSpit::xglview_villageoff(const ArgumentArray &args) { // Turn off the left viewer when in 'village mode' (why is this external?) _vm->_vars["glview"] = 0; _vm->getCard()->drawPicture(1); @@ -428,7 +428,7 @@ void GSpit::catherineViewerIdleTimer() { installTimer(TIMER(GSpit, catherineViewerIdleTimer), video->getDuration() + _vm->_rnd->getRandomNumber(60) * 1000); } -void GSpit::xglview_prisonon(uint16 argc, uint16 *argv) { +void GSpit::xglview_prisonon(const ArgumentArray &args) { // Activate random background Catherine videos // Turn on the left viewer to 'prison mode' @@ -476,7 +476,7 @@ void GSpit::xglview_prisonon(uint16 argc, uint16 *argv) { installTimer(TIMER(GSpit, catherineViewerIdleTimer), timeUntilNextMovie); } -void GSpit::xglview_prisonoff(uint16 argc, uint16 *argv) { +void GSpit::xglview_prisonoff(const ArgumentArray &args) { // Deactivate random background Catherine videos // Update the viewer state (now off) diff --git a/engines/mohawk/riven_stacks/gspit.h b/engines/mohawk/riven_stacks/gspit.h index e7f21692cc..df4e399388 100644 --- a/engines/mohawk/riven_stacks/gspit.h +++ b/engines/mohawk/riven_stacks/gspit.h @@ -36,34 +36,34 @@ public: GSpit(MohawkEngine_Riven *vm); // External commands - Pins - void xgresetpins(uint16 argc, uint16 *argv); - void xgrotatepins(uint16 argc, uint16 *argv); - void xgpincontrols(uint16 argc, uint16 *argv); + void xgresetpins(const ArgumentArray &args); + void xgrotatepins(const ArgumentArray &args); + void xgpincontrols(const ArgumentArray &args); // External commands - Dome - void xgisland25_opencard(uint16 argc, uint16 *argv); - void xgisland25_resetsliders(uint16 argc, uint16 *argv); - void xgisland25_slidermd(uint16 argc, uint16 *argv); - void xgisland25_slidermw(uint16 argc, uint16 *argv); - void xgscpbtn(uint16 argc, uint16 *argv); - void xgisland1490_domecheck(uint16 argc, uint16 *argv); + void xgisland25_opencard(const ArgumentArray &args); + void xgisland25_resetsliders(const ArgumentArray &args); + void xgisland25_slidermd(const ArgumentArray &args); + void xgisland25_slidermw(const ArgumentArray &args); + void xgscpbtn(const ArgumentArray &args); + void xgisland1490_domecheck(const ArgumentArray &args); // External commands - Mapping - void xgplateau3160_dopools(uint16 argc, uint16 *argv); + void xgplateau3160_dopools(const ArgumentArray &args); // External commands - Scribe Taking the Tram - void xgwt200_scribetime(uint16 argc, uint16 *argv); - void xgwt900_scribe(uint16 argc, uint16 *argv); + void xgwt200_scribetime(const ArgumentArray &args); + void xgwt900_scribe(const ArgumentArray &args); // External commands - Periscope/Prison Viewer - void xgplaywhark(uint16 argc, uint16 *argv); - void xgrviewer(uint16 argc, uint16 *argv); - void xgwharksnd(uint16 argc, uint16 *argv); - void xglview_prisonoff(uint16 argc, uint16 *argv); - void xglview_villageoff(uint16 argc, uint16 *argv); - void xglviewer(uint16 argc, uint16 *argv); - void xglview_prisonon(uint16 argc, uint16 *argv); - void xglview_villageon(uint16 argc, uint16 *argv); + void xgplaywhark(const ArgumentArray &args); + void xgrviewer(const ArgumentArray &args); + void xgwharksnd(const ArgumentArray &args); + void xglview_prisonoff(const ArgumentArray &args); + void xglview_villageoff(const ArgumentArray &args); + void xglviewer(const ArgumentArray &args); + void xglview_prisonon(const ArgumentArray &args); + void xglview_villageon(const ArgumentArray &args); // Timer handlers void catherineViewerIdleTimer(); diff --git a/engines/mohawk/riven_stacks/jspit.cpp b/engines/mohawk/riven_stacks/jspit.cpp index eded3c588a..f99664535d 100644 --- a/engines/mohawk/riven_stacks/jspit.cpp +++ b/engines/mohawk/riven_stacks/jspit.cpp @@ -64,7 +64,7 @@ JSpit::JSpit(MohawkEngine_Riven *vm) : REGISTER_COMMAND(JSpit, xjatboundary); } -void JSpit::xreseticons(uint16 argc, uint16 *argv) { +void JSpit::xreseticons(const ArgumentArray &args) { // Reset the icons when going to Tay (rspit) _vm->_vars["jicons"] = 0; _vm->_vars["jiconorder"] = 0; @@ -87,11 +87,11 @@ static byte countDepressedIcons(uint32 iconOrderVar) { return 0; } -void JSpit::xicon(uint16 argc, uint16 *argv) { +void JSpit::xicon(const ArgumentArray &args) { // Set atemp as the status of whether or not the icon can be depressed. - if (_vm->_vars["jicons"] & (1 << (argv[0] - 1))) { + if (_vm->_vars["jicons"] & (1 << (args[0] - 1))) { // This icon is depressed. Allow depression only if the last depressed icon was this one. - if ((_vm->_vars["jiconorder"] & 0x1f) == argv[0]) + if ((_vm->_vars["jiconorder"] & 0x1f) == args[0]) _vm->_vars["atemp"] = 1; else _vm->_vars["atemp"] = 2; @@ -99,7 +99,7 @@ void JSpit::xicon(uint16 argc, uint16 *argv) { _vm->_vars["atemp"] = 0; } -void JSpit::xcheckicons(uint16 argc, uint16 *argv) { +void JSpit::xcheckicons(const ArgumentArray &args) { // Reset the icons if this is the sixth icon uint32 &iconOrderVar = _vm->_vars["jiconorder"]; if (countDepressedIcons(iconOrderVar) == 5) { @@ -114,19 +114,19 @@ void JSpit::xcheckicons(uint16 argc, uint16 *argv) { } } -void JSpit::xtoggleicon(uint16 argc, uint16 *argv) { +void JSpit::xtoggleicon(const ArgumentArray &args) { // Get the variables uint32 &iconsDepressed = _vm->_vars["jicons"]; uint32 &iconOrderVar = _vm->_vars["jiconorder"]; - if (iconsDepressed & (1 << (argv[0] - 1))) { + if (iconsDepressed & (1 << (args[0] - 1))) { // The icon is depressed, now unpress it - iconsDepressed &= ~(1 << (argv[0] - 1)); + iconsDepressed &= ~(1 << (args[0] - 1)); iconOrderVar >>= 5; } else { // The icon is not depressed, now depress it - iconsDepressed |= 1 << (argv[0] - 1); - iconOrderVar = (iconOrderVar << 5) + argv[0]; + iconsDepressed |= 1 << (args[0] - 1); + iconOrderVar = (iconOrderVar << 5) + args[0]; } // Check if the puzzle is complete now and assign 1 to jrbook if the puzzle is complete. @@ -134,7 +134,7 @@ void JSpit::xtoggleicon(uint16 argc, uint16 *argv) { _vm->_vars["jrbook"] = 1; } -void JSpit::xjtunnel103_pictfix(uint16 argc, uint16 *argv) { +void JSpit::xjtunnel103_pictfix(const ArgumentArray &args) { // Get the jicons variable which contains which of the stones are depressed in the rebel tunnel puzzle uint32 iconsDepressed = _vm->_vars["jicons"]; @@ -159,7 +159,7 @@ void JSpit::xjtunnel103_pictfix(uint16 argc, uint16 *argv) { _vm->_gfx->applyScreenUpdate(); } -void JSpit::xjtunnel104_pictfix(uint16 argc, uint16 *argv) { +void JSpit::xjtunnel104_pictfix(const ArgumentArray &args) { // Get the jicons variable which contains which of the stones are depressed in the rebel tunnel puzzle uint32 iconsDepressed = _vm->_vars["jicons"]; @@ -186,7 +186,7 @@ void JSpit::xjtunnel104_pictfix(uint16 argc, uint16 *argv) { _vm->_gfx->applyScreenUpdate(); } -void JSpit::xjtunnel105_pictfix(uint16 argc, uint16 *argv) { +void JSpit::xjtunnel105_pictfix(const ArgumentArray &args) { // Get the jicons variable which contains which of the stones are depressed in the rebel tunnel puzzle uint32 iconsDepressed = _vm->_vars["jicons"]; @@ -211,7 +211,7 @@ void JSpit::xjtunnel105_pictfix(uint16 argc, uint16 *argv) { _vm->_gfx->applyScreenUpdate(); } -void JSpit::xjtunnel106_pictfix(uint16 argc, uint16 *argv) { +void JSpit::xjtunnel106_pictfix(const ArgumentArray &args) { // Get the jicons variable which contains which of the stones are depressed in the rebel tunnel puzzle uint32 iconsDepressed = _vm->_vars["jicons"]; @@ -236,7 +236,7 @@ void JSpit::xjtunnel106_pictfix(uint16 argc, uint16 *argv) { _vm->_gfx->applyScreenUpdate(); } -void JSpit::xvga1300_carriage(uint16 argc, uint16 *argv) { +void JSpit::xvga1300_carriage(const ArgumentArray &args) { // Run the gallows's carriage RivenVideo *handleVideo = _vm->_video->openSlot(1); @@ -333,23 +333,23 @@ void JSpit::xvga1300_carriage(uint16 argc, uint16 *argv) { } } -void JSpit::xjdome25_resetsliders(uint16 argc, uint16 *argv) { +void JSpit::xjdome25_resetsliders(const ArgumentArray &args) { resetDomeSliders(10); } -void JSpit::xjdome25_slidermd(uint16 argc, uint16 *argv) { +void JSpit::xjdome25_slidermd(const ArgumentArray &args) { dragDomeSlider(10); } -void JSpit::xjdome25_slidermw(uint16 argc, uint16 *argv) { +void JSpit::xjdome25_slidermw(const ArgumentArray &args) { checkSliderCursorChange(10); } -void JSpit::xjscpbtn(uint16 argc, uint16 *argv) { +void JSpit::xjscpbtn(const ArgumentArray &args) { runDomeButtonMovie(); } -void JSpit::xjisland3500_domecheck(uint16 argc, uint16 *argv) { +void JSpit::xjisland3500_domecheck(const ArgumentArray &args) { runDomeCheck(); } @@ -373,7 +373,7 @@ int JSpit::jspitElevatorLoop() { return 0; } -void JSpit::xhandlecontrolup(uint16 argc, uint16 *argv) { +void JSpit::xhandlecontrolup(const ArgumentArray &args) { int changeLevel = jspitElevatorLoop(); // If we've moved the handle down, go down a floor @@ -405,7 +405,7 @@ void JSpit::xhandlecontrolup(uint16 argc, uint16 *argv) { } } -void JSpit::xhandlecontroldown(uint16 argc, uint16 *argv) { +void JSpit::xhandlecontroldown(const ArgumentArray &args) { int changeLevel = jspitElevatorLoop(); // If we've moved the handle up, go up a floor @@ -420,7 +420,7 @@ void JSpit::xhandlecontroldown(uint16 argc, uint16 *argv) { } } -void JSpit::xhandlecontrolmid(uint16 argc, uint16 *argv) { +void JSpit::xhandlecontrolmid(const ArgumentArray &args) { int changeLevel = jspitElevatorLoop(); if (changeLevel == 0) @@ -460,32 +460,32 @@ void JSpit::xhandlecontrolmid(uint16 argc, uint16 *argv) { _vm->_scriptMan->runScript(changeCard, false); } -void JSpit::xjplaybeetle_550(uint16 argc, uint16 *argv) { +void JSpit::xjplaybeetle_550(const ArgumentArray &args) { // Play a beetle animation 25% of the time _vm->_vars["jplaybeetle"] = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0; } -void JSpit::xjplaybeetle_600(uint16 argc, uint16 *argv) { +void JSpit::xjplaybeetle_600(const ArgumentArray &args) { // Play a beetle animation 25% of the time _vm->_vars["jplaybeetle"] = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0; } -void JSpit::xjplaybeetle_950(uint16 argc, uint16 *argv) { +void JSpit::xjplaybeetle_950(const ArgumentArray &args) { // Play a beetle animation 25% of the time _vm->_vars["jplaybeetle"] = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0; } -void JSpit::xjplaybeetle_1050(uint16 argc, uint16 *argv) { +void JSpit::xjplaybeetle_1050(const ArgumentArray &args) { // Play a beetle animation 25% of the time _vm->_vars["jplaybeetle"] = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0; } -void JSpit::xjplaybeetle_1450(uint16 argc, uint16 *argv) { +void JSpit::xjplaybeetle_1450(const ArgumentArray &args) { // Play a beetle animation 25% of the time as long as the girl is not present _vm->_vars["jplaybeetle"] = (_vm->_rnd->getRandomNumberRng(0, 3) == 0 && _vm->_vars["jgirl"] != 1) ? 1 : 0; } -void JSpit::xjlagoon700_alert(uint16 argc, uint16 *argv) { +void JSpit::xjlagoon700_alert(const ArgumentArray &args) { // Handle sunner reactions (mid-staircase) uint32 sunners = _vm->_vars["jsunners"]; @@ -500,7 +500,7 @@ void JSpit::xjlagoon700_alert(uint16 argc, uint16 *argv) { sunnersPlayVideo(sunnerAlertVideo, 0x7BEB, true); } -void JSpit::xjlagoon800_alert(uint16 argc, uint16 *argv) { +void JSpit::xjlagoon800_alert(const ArgumentArray &args) { // Handle sunner reactions (lower-staircase) uint32 &sunners = _vm->_vars["jsunners"]; @@ -522,7 +522,7 @@ void JSpit::xjlagoon800_alert(uint16 argc, uint16 *argv) { } } -void JSpit::xjlagoon1500_alert(uint16 argc, uint16 *argv) { +void JSpit::xjlagoon1500_alert(const ArgumentArray &args) { // Handle sunner reactions (beach) uint32 &sunners = _vm->_vars["jsunners"]; @@ -703,12 +703,12 @@ void JSpit::sunnersBeachTimer() { installTimer(TIMER(JSpit, sunnersBeachTimer), timerTime); } -void JSpit::xjschool280_resetleft(uint16 argc, uint16 *argv) { +void JSpit::xjschool280_resetleft(const ArgumentArray &args) { // Dummy function. This resets the unneeded video timing variable (dropLeftStart) in // the DVD version. } -void JSpit::xjschool280_resetright(uint16 argc, uint16 *argv) { +void JSpit::xjschool280_resetright(const ArgumentArray &args) { // Dummy function. This resets the unneeded video timing variable (dropRightStart) in // the DVD version. } @@ -721,7 +721,7 @@ void JSpit::redrawWharkNumberPuzzle(uint16 overlay, uint16 number) { _vm->_gfx->applyScreenUpdate(); } -void JSpit::xschool280_playwhark(uint16 argc, uint16 *argv) { +void JSpit::xschool280_playwhark(const ArgumentArray &args) { // The "monstrous" whark puzzle that teaches the number system uint32 *posVar; @@ -779,7 +779,7 @@ void JSpit::xschool280_playwhark(uint16 argc, uint16 *argv) { rotateRight->enable(!rotateRight->isEnabled()); } -void JSpit::xjatboundary(uint16 argc, uint16 *argv) { +void JSpit::xjatboundary(const ArgumentArray &args) { runDemoBoundaryDialog(); } diff --git a/engines/mohawk/riven_stacks/jspit.h b/engines/mohawk/riven_stacks/jspit.h index a3d4963176..034bb88681 100644 --- a/engines/mohawk/riven_stacks/jspit.h +++ b/engines/mohawk/riven_stacks/jspit.h @@ -40,49 +40,49 @@ public: virtual void installCardTimer() override; // External commands - Rebel Tunnel Puzzle - void xreseticons(uint16 argc, uint16 *argv); - void xicon(uint16 argc, uint16 *argv); - void xcheckicons(uint16 argc, uint16 *argv); - void xtoggleicon(uint16 argc, uint16 *argv); - void xjtunnel103_pictfix(uint16 argc, uint16 *argv); - void xjtunnel104_pictfix(uint16 argc, uint16 *argv); - void xjtunnel105_pictfix(uint16 argc, uint16 *argv); - void xjtunnel106_pictfix(uint16 argc, uint16 *argv); + void xreseticons(const ArgumentArray &args); + void xicon(const ArgumentArray &args); + void xcheckicons(const ArgumentArray &args); + void xtoggleicon(const ArgumentArray &args); + void xjtunnel103_pictfix(const ArgumentArray &args); + void xjtunnel104_pictfix(const ArgumentArray &args); + void xjtunnel105_pictfix(const ArgumentArray &args); + void xjtunnel106_pictfix(const ArgumentArray &args); // External commands - Lower the gallows carriage - void xvga1300_carriage(uint16 argc, uint16 *argv); + void xvga1300_carriage(const ArgumentArray &args); // External commands - Dome - void xjdome25_resetsliders(uint16 argc, uint16 *argv); - void xjdome25_slidermd(uint16 argc, uint16 *argv); - void xjdome25_slidermw(uint16 argc, uint16 *argv); - void xjscpbtn(uint16 argc, uint16 *argv); - void xjisland3500_domecheck(uint16 argc, uint16 *argv); + void xjdome25_resetsliders(const ArgumentArray &args); + void xjdome25_slidermd(const ArgumentArray &args); + void xjdome25_slidermw(const ArgumentArray &args); + void xjscpbtn(const ArgumentArray &args); + void xjisland3500_domecheck(const ArgumentArray &args); // External commands - Whark Elevator - void xhandlecontroldown(uint16 argc, uint16 *argv); - void xhandlecontrolmid(uint16 argc, uint16 *argv); - void xhandlecontrolup(uint16 argc, uint16 *argv); + void xhandlecontroldown(const ArgumentArray &args); + void xhandlecontrolmid(const ArgumentArray &args); + void xhandlecontrolup(const ArgumentArray &args); // External commands - Beetle - void xjplaybeetle_550(uint16 argc, uint16 *argv); - void xjplaybeetle_600(uint16 argc, uint16 *argv); - void xjplaybeetle_950(uint16 argc, uint16 *argv); - void xjplaybeetle_1050(uint16 argc, uint16 *argv); - void xjplaybeetle_1450(uint16 argc, uint16 *argv); + void xjplaybeetle_550(const ArgumentArray &args); + void xjplaybeetle_600(const ArgumentArray &args); + void xjplaybeetle_950(const ArgumentArray &args); + void xjplaybeetle_1050(const ArgumentArray &args); + void xjplaybeetle_1450(const ArgumentArray &args); // External commands - Creatures in the Lagoon - void xjlagoon700_alert(uint16 argc, uint16 *argv); - void xjlagoon800_alert(uint16 argc, uint16 *argv); - void xjlagoon1500_alert(uint16 argc, uint16 *argv); + void xjlagoon700_alert(const ArgumentArray &args); + void xjlagoon800_alert(const ArgumentArray &args); + void xjlagoon1500_alert(const ArgumentArray &args); // External commands - Play the Whark Game - void xschool280_playwhark(uint16 argc, uint16 *argv); - void xjschool280_resetleft(uint16 argc, uint16 *argv); // DVD only - void xjschool280_resetright(uint16 argc, uint16 *argv); // DVD only + void xschool280_playwhark(const ArgumentArray &args); + void xjschool280_resetleft(const ArgumentArray &args); // DVD only + void xjschool280_resetright(const ArgumentArray &args); // DVD only // External commands - Demo-specific - void xjatboundary(uint16 argc, uint16 *argv); + void xjatboundary(const ArgumentArray &args); // Timer callbacks void sunnersTopStairsTimer(); diff --git a/engines/mohawk/riven_stacks/ospit.cpp b/engines/mohawk/riven_stacks/ospit.cpp index f177ae88eb..2393052881 100644 --- a/engines/mohawk/riven_stacks/ospit.cpp +++ b/engines/mohawk/riven_stacks/ospit.cpp @@ -45,7 +45,7 @@ OSpit::OSpit(MohawkEngine_Riven *vm) : REGISTER_COMMAND(OSpit, xgwatch); } -void OSpit::xorollcredittime(uint16 argc, uint16 *argv) { +void OSpit::xorollcredittime(const ArgumentArray &args) { // WORKAROUND: The special change stuff only handles one destination and it would // be messy to modify the way that currently works. If we use the trap book on Tay, // we should be using the Tay end game sequences. @@ -66,26 +66,26 @@ void OSpit::xorollcredittime(uint16 argc, uint16 *argv) { runEndGame(3, 8000); } -void OSpit::xbookclick(uint16 argc, uint16 *argv) { +void OSpit::xbookclick(const ArgumentArray &args) { // Let's hook onto our video - RivenVideo *video = _vm->_video->getSlot(argv[0]); + RivenVideo *video = _vm->_video->getSlot(args[0]); // Convert from the standard QuickTime base time to milliseconds // The values are in terms of 1/600 of a second. // Have I said how much I just *love* QuickTime? </sarcasm> - uint32 startTime = argv[1] * 1000 / 600; - uint32 endTime = argv[2] * 1000 / 600; + uint32 startTime = args[1] * 1000 / 600; + uint32 endTime = args[2] * 1000 / 600; // Track down our hotspot - Common::String hotspotName = Common::String::format("touchBook%d", argv[3]); + Common::String hotspotName = Common::String::format("touchBook%d", args[3]); RivenHotspot *hotspot = _vm->getCard()->getHotspotByName(hotspotName); Common::Rect hotspotRect = hotspot->getRect(); debug(0, "xbookclick:"); - debug(0, "\tVideo Code = %d", argv[0]); + debug(0, "\tVideo Code = %d", args[0]); debug(0, "\tStart Time = %dms", startTime); debug(0, "\tEnd Time = %dms", endTime); - debug(0, "\tHotspot = %d -> %s", argv[3], hotspotName.c_str()); + debug(0, "\tHotspot = %d -> %s", args[3], hotspotName.c_str()); // Just let the video play while we wait until Gehn opens the trap book for us while (video->getTime() < startTime && !_vm->shouldQuit()) { @@ -142,7 +142,7 @@ void OSpit::xbookclick(uint16 argc, uint16 *argv) { // Run the credits from here. if (_vm->_vars["agehn"] == 3) { _vm->_scriptMan->stopAllScripts(); - runCredits(argv[0], 5000); + runCredits(args[0], 5000); return; } @@ -150,7 +150,7 @@ void OSpit::xbookclick(uint16 argc, uint16 *argv) { video->playBlocking(); } -void OSpit::xooffice30_closebook(uint16 argc, uint16 *argv) { +void OSpit::xooffice30_closebook(const ArgumentArray &args) { // Close the blank linking book if it's open uint32 &book = _vm->_vars["odeskbook"]; if (book != 1) @@ -176,18 +176,18 @@ void OSpit::xooffice30_closebook(uint16 argc, uint16 *argv) { _vm->getCard()->drawPicture(1); } -void OSpit::xobedroom5_closedrawer(uint16 argc, uint16 *argv) { +void OSpit::xobedroom5_closedrawer(const ArgumentArray &args) { // Close the drawer if open when clicking on the journal. RivenVideo *video = _vm->_video->openSlot(2); video->playBlocking(); _vm->_vars["ostanddrawer"] = 0; } -void OSpit::xogehnopenbook(uint16 argc, uint16 *argv) { +void OSpit::xogehnopenbook(const ArgumentArray &args) { _vm->getCard()->drawPicture(_vm->_vars["ogehnpage"]); } -void OSpit::xogehnbookprevpage(uint16 argc, uint16 *argv) { +void OSpit::xogehnbookprevpage(const ArgumentArray &args) { // Get the page variable uint32 &page = _vm->_vars["ogehnpage"]; @@ -211,7 +211,7 @@ void OSpit::xogehnbookprevpage(uint16 argc, uint16 *argv) { } } -void OSpit::xogehnbooknextpage(uint16 argc, uint16 *argv) { +void OSpit::xogehnbooknextpage(const ArgumentArray &args) { // Get the page variable uint32 &page = _vm->_vars["ogehnpage"]; @@ -235,7 +235,7 @@ void OSpit::xogehnbooknextpage(uint16 argc, uint16 *argv) { } } -void OSpit::xgwatch(uint16 argc, uint16 *argv) { +void OSpit::xgwatch(const ArgumentArray &args) { // Hide the cursor _vm->_cursor->setCursor(kRivenHideCursor); diff --git a/engines/mohawk/riven_stacks/ospit.h b/engines/mohawk/riven_stacks/ospit.h index 4181ce3651..442441cd32 100644 --- a/engines/mohawk/riven_stacks/ospit.h +++ b/engines/mohawk/riven_stacks/ospit.h @@ -36,22 +36,22 @@ public: OSpit(MohawkEngine_Riven *vm); // External commands - Death! - void xorollcredittime(uint16 argc, uint16 *argv); + void xorollcredittime(const ArgumentArray &args); // External commands - Trap Book Puzzle - void xbookclick(uint16 argc, uint16 *argv); // Four params -- movie_sref, start_time, end_time, u0 + void xbookclick(const ArgumentArray &args); // Four params -- movie_sref, start_time, end_time, u0 // External commands - Blank Linking Book - void xooffice30_closebook(uint16 argc, uint16 *argv); + void xooffice30_closebook(const ArgumentArray &args); // External commands - Gehn's Journal - void xobedroom5_closedrawer(uint16 argc, uint16 *argv); - void xogehnopenbook(uint16 argc, uint16 *argv); - void xogehnbookprevpage(uint16 argc, uint16 *argv); - void xogehnbooknextpage(uint16 argc, uint16 *argv); + void xobedroom5_closedrawer(const ArgumentArray &args); + void xogehnopenbook(const ArgumentArray &args); + void xogehnbookprevpage(const ArgumentArray &args); + void xogehnbooknextpage(const ArgumentArray &args); // External commands - Elevator Combination - void xgwatch(uint16 argc, uint16 *argv); + void xgwatch(const ArgumentArray &args); }; diff --git a/engines/mohawk/riven_stacks/pspit.cpp b/engines/mohawk/riven_stacks/pspit.cpp index 07a91f2cff..a3134754b4 100644 --- a/engines/mohawk/riven_stacks/pspit.cpp +++ b/engines/mohawk/riven_stacks/pspit.cpp @@ -80,9 +80,9 @@ void PSpit::catherineIdleTimer() { installTimer(TIMER(PSpit, catherineIdleTimer), timeUntilNextMovie); } -void PSpit::xpisland990_elevcombo(uint16 argc, uint16 *argv) { - // Play button sound based on argv[0] - _vm->_sound->playSound(argv[0] + 5); +void PSpit::xpisland990_elevcombo(const ArgumentArray &args) { + // Play button sound based on args[0] + _vm->_sound->playSound(args[0] + 5); _vm->delay(500); // It is impossible to get here if Gehn is not trapped. However, @@ -95,33 +95,33 @@ void PSpit::xpisland990_elevcombo(uint16 argc, uint16 *argv) { // pelevcombo keeps count of how many buttons we have pressed in the correct order. // When pelevcombo is 5, clicking the handle will show the video freeing Catherine. - if (correctDigits < 5 && argv[0] == getComboDigit(_vm->_vars["pcorrectorder"], correctDigits)) + if (correctDigits < 5 && args[0] == getComboDigit(_vm->_vars["pcorrectorder"], correctDigits)) correctDigits++; else correctDigits = 0; } -void PSpit::xpscpbtn(uint16 argc, uint16 *argv) { +void PSpit::xpscpbtn(const ArgumentArray &args) { runDomeButtonMovie(); } -void PSpit::xpisland290_domecheck(uint16 argc, uint16 *argv) { +void PSpit::xpisland290_domecheck(const ArgumentArray &args) { runDomeCheck(); } -void PSpit::xpisland25_opencard(uint16 argc, uint16 *argv) { +void PSpit::xpisland25_opencard(const ArgumentArray &args) { checkDomeSliders(); } -void PSpit::xpisland25_resetsliders(uint16 argc, uint16 *argv) { +void PSpit::xpisland25_resetsliders(const ArgumentArray &args) { resetDomeSliders(14); } -void PSpit::xpisland25_slidermd(uint16 argc, uint16 *argv) { +void PSpit::xpisland25_slidermd(const ArgumentArray &args) { dragDomeSlider(14); } -void PSpit::xpisland25_slidermw(uint16 argc, uint16 *argv) { +void PSpit::xpisland25_slidermw(const ArgumentArray &args) { checkSliderCursorChange(14); } diff --git a/engines/mohawk/riven_stacks/pspit.h b/engines/mohawk/riven_stacks/pspit.h index ec0186a727..9b34a90b3c 100644 --- a/engines/mohawk/riven_stacks/pspit.h +++ b/engines/mohawk/riven_stacks/pspit.h @@ -39,15 +39,15 @@ public: virtual void installCardTimer() override; // External commands - Prison Elevator - void xpisland990_elevcombo(uint16 argc, uint16 *argv); // Param1: button + void xpisland990_elevcombo(const ArgumentArray &args); // Param1: button // External commands - Dome - void xpscpbtn(uint16 argc, uint16 *argv); - void xpisland290_domecheck(uint16 argc, uint16 *argv); - void xpisland25_opencard(uint16 argc, uint16 *argv); - void xpisland25_resetsliders(uint16 argc, uint16 *argv); - void xpisland25_slidermd(uint16 argc, uint16 *argv); - void xpisland25_slidermw(uint16 argc, uint16 *argv); + void xpscpbtn(const ArgumentArray &args); + void xpisland290_domecheck(const ArgumentArray &args); + void xpisland25_opencard(const ArgumentArray &args); + void xpisland25_resetsliders(const ArgumentArray &args); + void xpisland25_slidermd(const ArgumentArray &args); + void xpisland25_slidermw(const ArgumentArray &args); // Timer callbacks void catherineIdleTimer(); diff --git a/engines/mohawk/riven_stacks/rspit.cpp b/engines/mohawk/riven_stacks/rspit.cpp index cb029124a6..6d153bed67 100644 --- a/engines/mohawk/riven_stacks/rspit.cpp +++ b/engines/mohawk/riven_stacks/rspit.cpp @@ -40,7 +40,7 @@ RSpit::RSpit(MohawkEngine_Riven *vm) : REGISTER_COMMAND(RSpit, xrwindowsetup); } -void RSpit::xrcredittime(uint16 argc, uint16 *argv) { +void RSpit::xrcredittime(const ArgumentArray &args) { // Nice going, you used the trap book on Tay. // The game chooses what ending based on agehn for us, @@ -51,10 +51,10 @@ void RSpit::xrcredittime(uint16 argc, uint16 *argv) { runEndGame(1, 1500); } -void RSpit::xrshowinventory(uint16 argc, uint16 *argv) { +void RSpit::xrshowinventory(const ArgumentArray &args) { } -void RSpit::xrhideinventory(uint16 argc, uint16 *argv) { +void RSpit::xrhideinventory(const ArgumentArray &args) { } void RSpit::rebelPrisonWindowTimer() { @@ -74,7 +74,7 @@ void RSpit::rebelPrisonWindowTimer() { installTimer(TIMER(RSpit, rebelPrisonWindowTimer), timeUntilNextVideo); } -void RSpit::xrwindowsetup(uint16 argc, uint16 *argv) { +void RSpit::xrwindowsetup(const ArgumentArray &args) { // Randomize what effect happens when you look out into the middle of Tay uint32 villageTime = _vm->_vars["rvillagetime"]; diff --git a/engines/mohawk/riven_stacks/rspit.h b/engines/mohawk/riven_stacks/rspit.h index fe219444d6..1b5e6bab7a 100644 --- a/engines/mohawk/riven_stacks/rspit.h +++ b/engines/mohawk/riven_stacks/rspit.h @@ -36,10 +36,10 @@ public: RSpit(MohawkEngine_Riven *vm); // External commands - void xrcredittime(uint16 argc, uint16 *argv); - void xrshowinventory(uint16 argc, uint16 *argv); - void xrhideinventory(uint16 argc, uint16 *argv); - void xrwindowsetup(uint16 argc, uint16 *argv); + void xrcredittime(const ArgumentArray &args); + void xrshowinventory(const ArgumentArray &args); + void xrhideinventory(const ArgumentArray &args); + void xrwindowsetup(const ArgumentArray &args); // Timer callbacks void rebelPrisonWindowTimer(); diff --git a/engines/mohawk/riven_stacks/tspit.cpp b/engines/mohawk/riven_stacks/tspit.cpp index dd23afba34..54eae99fc9 100644 --- a/engines/mohawk/riven_stacks/tspit.cpp +++ b/engines/mohawk/riven_stacks/tspit.cpp @@ -57,7 +57,7 @@ TSpit::TSpit(MohawkEngine_Riven *vm) : REGISTER_COMMAND(TSpit, xtatboundary); } -void TSpit::xtexterior300_telescopedown(uint16 argc, uint16 *argv) { +void TSpit::xtexterior300_telescopedown(const ArgumentArray &args) { // First, show the button movie RivenVideo *buttonVideo = _vm->_video->openSlot(3); buttonVideo->seek(0); @@ -101,7 +101,7 @@ void TSpit::xtexterior300_telescopedown(uint16 argc, uint16 *argv) { } } -void TSpit::xtexterior300_telescopeup(uint16 argc, uint16 *argv) { +void TSpit::xtexterior300_telescopeup(const ArgumentArray &args) { // First, show the button movie RivenVideo *buttonVideo = _vm->_video->openSlot(3); buttonVideo->seek(0); @@ -163,11 +163,11 @@ void TSpit::xtopenfissure() { } } -void TSpit::xtisland390_covercombo(uint16 argc, uint16 *argv) { - // Called when clicking the telescope cover buttons. argv[0] is the button number (1...5). +void TSpit::xtisland390_covercombo(const ArgumentArray &args) { + // Called when clicking the telescope cover buttons. args[0] is the button number (1...5). uint32 &correctDigits = _vm->_vars["tcovercombo"]; - if (correctDigits < 5 && argv[0] == getComboDigit(_vm->_vars["tcorrectorder"], correctDigits)) + if (correctDigits < 5 && args[0] == getComboDigit(_vm->_vars["tcorrectorder"], correctDigits)) correctDigits++; else correctDigits = 0; @@ -179,16 +179,16 @@ void TSpit::xtisland390_covercombo(uint16 argc, uint16 *argv) { } // Atrus' Journal and Trap Book are added to inventory -void TSpit::xtatrusgivesbooks(uint16 argc, uint16 *argv) { +void TSpit::xtatrusgivesbooks(const ArgumentArray &args) { // Give the player Atrus' Journal and the Trap book } // Trap Book is removed from inventory -void TSpit::xtchotakesbook(uint16 argc, uint16 *argv) { +void TSpit::xtchotakesbook(const ArgumentArray &args) { // And now Cho takes the trap book } -void TSpit::xthideinventory(uint16 argc, uint16 *argv) { +void TSpit::xthideinventory(const ArgumentArray &args) { } // Marble Puzzle related constants @@ -227,7 +227,7 @@ static Common::Rect generateMarbleGridRect(uint16 x, uint16 y) { return Common::Rect(offsetX, offsetY, offsetX + kMarbleHotspotSize, offsetY + kMarbleHotspotSize); } -void TSpit::xt7500_checkmarbles(uint16 argc, uint16 *argv) { +void TSpit::xt7500_checkmarbles(const ArgumentArray &args) { // Set apower if the marbles are in their correct spot. bool valid = true; @@ -249,7 +249,7 @@ void TSpit::xt7500_checkmarbles(uint16 argc, uint16 *argv) { _vm->_vars["apower"] = 0; } -void TSpit::xt7600_setupmarbles(uint16 argc, uint16 *argv) { +void TSpit::xt7600_setupmarbles(const ArgumentArray &args) { // Draw the small marbles when we're a step away from the waffle // Convert from marble X coordinate to screen X coordinate @@ -309,7 +309,7 @@ void TSpit::setMarbleHotspots() { } } -void TSpit::xt7800_setup(uint16 argc, uint16 *argv) { +void TSpit::xt7800_setup(const ArgumentArray &args) { // First, let's store the base receptacle hotspots for the marbles if (_marbleBaseHotspots.empty()) for (uint16 i = 0; i < kMarbleCount; i++) { @@ -342,12 +342,12 @@ void TSpit::drawMarbles() { _vm->_gfx->applyScreenUpdate(); } -void TSpit::xdrawmarbles(uint16 argc, uint16 *argv) { +void TSpit::xdrawmarbles(const ArgumentArray &args) { // Draw marbles in the closeup drawMarbles(); } -void TSpit::xtakeit(uint16 argc, uint16 *argv) { +void TSpit::xtakeit(const ArgumentArray &args) { // Pick up and move a marble // First, let's figure out what marble we're now holding @@ -408,31 +408,31 @@ void TSpit::xtakeit(uint16 argc, uint16 *argv) { drawMarbles(); } -void TSpit::xtscpbtn(uint16 argc, uint16 *argv) { +void TSpit::xtscpbtn(const ArgumentArray &args) { runDomeButtonMovie(); } -void TSpit::xtisland4990_domecheck(uint16 argc, uint16 *argv) { +void TSpit::xtisland4990_domecheck(const ArgumentArray &args) { runDomeCheck(); } -void TSpit::xtisland5056_opencard(uint16 argc, uint16 *argv) { +void TSpit::xtisland5056_opencard(const ArgumentArray &args) { checkDomeSliders(); } -void TSpit::xtisland5056_resetsliders(uint16 argc, uint16 *argv) { +void TSpit::xtisland5056_resetsliders(const ArgumentArray &args) { resetDomeSliders(24); } -void TSpit::xtisland5056_slidermd(uint16 argc, uint16 *argv) { +void TSpit::xtisland5056_slidermd(const ArgumentArray &args) { dragDomeSlider(24); } -void TSpit::xtisland5056_slidermw(uint16 argc, uint16 *argv) { +void TSpit::xtisland5056_slidermw(const ArgumentArray &args) { checkSliderCursorChange(24); } -void TSpit::xtatboundary(uint16 argc, uint16 *argv) { +void TSpit::xtatboundary(const ArgumentArray &args) { runDemoBoundaryDialog(); } diff --git a/engines/mohawk/riven_stacks/tspit.h b/engines/mohawk/riven_stacks/tspit.h index 9811f6143b..153fbda03d 100644 --- a/engines/mohawk/riven_stacks/tspit.h +++ b/engines/mohawk/riven_stacks/tspit.h @@ -38,37 +38,37 @@ public: TSpit(MohawkEngine_Riven *vm); // External commands - Telescope - void xtexterior300_telescopedown(uint16 argc, uint16 *argv); - void xtexterior300_telescopeup(uint16 argc, uint16 *argv); + void xtexterior300_telescopedown(const ArgumentArray &args); + void xtexterior300_telescopeup(const ArgumentArray &args); void xtopenfissure(); // External commands - Telescope cover buttons. Button is the button number (1...5). - void xtisland390_covercombo(uint16 argc, uint16 *argv); // Param1: button + void xtisland390_covercombo(const ArgumentArray &args); // Param1: button // External commands - Atrus' Journal and Trap Book are added to inventory - void xtatrusgivesbooks(uint16 argc, uint16 *argv); + void xtatrusgivesbooks(const ArgumentArray &args); // External commands - Trap Book is removed from inventory - void xtchotakesbook(uint16 argc, uint16 *argv); - void xthideinventory(uint16 argc, uint16 *argv); + void xtchotakesbook(const ArgumentArray &args); + void xthideinventory(const ArgumentArray &args); // External commands - Marble Puzzle - void xt7500_checkmarbles(uint16 argc, uint16 *argv); - void xt7600_setupmarbles(uint16 argc, uint16 *argv); - void xt7800_setup(uint16 argc, uint16 *argv); - void xdrawmarbles(uint16 argc, uint16 *argv); - void xtakeit(uint16 argc, uint16 *argv); + void xt7500_checkmarbles(const ArgumentArray &args); + void xt7600_setupmarbles(const ArgumentArray &args); + void xt7800_setup(const ArgumentArray &args); + void xdrawmarbles(const ArgumentArray &args); + void xtakeit(const ArgumentArray &args); // External commands - Dome - void xtscpbtn(uint16 argc, uint16 *argv); - void xtisland4990_domecheck(uint16 argc, uint16 *argv); - void xtisland5056_opencard(uint16 argc, uint16 *argv); - void xtisland5056_resetsliders(uint16 argc, uint16 *argv); - void xtisland5056_slidermd(uint16 argc, uint16 *argv); - void xtisland5056_slidermw(uint16 argc, uint16 *argv); + void xtscpbtn(const ArgumentArray &args); + void xtisland4990_domecheck(const ArgumentArray &args); + void xtisland5056_opencard(const ArgumentArray &args); + void xtisland5056_resetsliders(const ArgumentArray &args); + void xtisland5056_slidermd(const ArgumentArray &args); + void xtisland5056_slidermw(const ArgumentArray &args); // External commands - Demo-specific - void xtatboundary(uint16 argc, uint16 *argv); + void xtatboundary(const ArgumentArray &args); private: void drawMarbles(); |