diff options
author | Bastien Bouclet | 2011-05-15 14:53:05 +0200 |
---|---|---|
committer | Bastien Bouclet | 2011-05-15 17:41:54 +0200 |
commit | e0e28aaeb24983b0e0700b5e561f0d9c991bfb4a (patch) | |
tree | 71cb2103ab5c09b868b9e6226be8e3a681657a81 /engines/mohawk | |
parent | d72037fb72b876b9cc0ca80d585a1a4939a68bd9 (diff) | |
download | scummvm-rg350-e0e28aaeb24983b0e0700b5e561f0d9c991bfb4a.tar.gz scummvm-rg350-e0e28aaeb24983b0e0700b5e561f0d9c991bfb4a.tar.bz2 scummvm-rg350-e0e28aaeb24983b0e0700b5e561f0d9c991bfb4a.zip |
MOHAWK: Implement "Show Map" feature for Myst ME
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/dialogs.cpp | 17 | ||||
-rw-r--r-- | engines/mohawk/dialogs.h | 1 | ||||
-rw-r--r-- | engines/mohawk/myst.cpp | 7 | ||||
-rw-r--r-- | engines/mohawk/myst.h | 1 | ||||
-rw-r--r-- | engines/mohawk/myst_scripts.cpp | 12 | ||||
-rw-r--r-- | engines/mohawk/myst_scripts.h | 5 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/channelwood.h | 2 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/mechanical.h | 2 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/myst.h | 2 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.h | 2 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/stoneship.h | 2 |
11 files changed, 52 insertions, 1 deletions
diff --git a/engines/mohawk/dialogs.cpp b/engines/mohawk/dialogs.cpp index 22a9d2d6c6..6cb455917e 100644 --- a/engines/mohawk/dialogs.cpp +++ b/engines/mohawk/dialogs.cpp @@ -80,7 +80,8 @@ enum { kZipCmd = 'ZIPM', kTransCmd = 'TRAN', kWaterCmd = 'WATR', - kDropCmd = 'DROP' + kDropCmd = 'DROP', + kMapCmd = 'SMAP' }; #ifdef ENABLE_MYST @@ -90,6 +91,12 @@ MystOptionsDialog::MystOptionsDialog(MohawkEngine_Myst* vm) : GUI::OptionsDialog _transitionsCheckbox = new GUI::CheckboxWidget(this, 15, 30, 300, 15, _("~T~ransitions Enabled"), 0, kTransCmd); _dropPageButton = new GUI::ButtonWidget(this, 15, 60, 100, 25, _("~D~rop Page"), 0, kDropCmd); + // Myst ME only has maps + if (_vm->getFeatures() & GF_ME) + _showMapButton = new GUI::ButtonWidget(this, 15, 95, 100, 25, _("~S~how Map"), 0, kMapCmd); + else + _showMapButton = 0; + new GUI::ButtonWidget(this, 95, 160, 120, 25, _("~O~K"), 0, GUI::kOKCmd); new GUI::ButtonWidget(this, 225, 160, 120, 25, _("~C~ancel"), 0, GUI::kCloseCmd); } @@ -102,6 +109,10 @@ void MystOptionsDialog::open() { _dropPageButton->setEnabled(_vm->_gameState->_globals.heldPage != 0); + if (_showMapButton) + _showMapButton->setEnabled(_vm->_scriptParser && + _vm->_scriptParser->getMap()); + _zipModeCheckbox->setState(_vm->_gameState->_globals.zipMode); _transitionsCheckbox->setState(_vm->_gameState->_globals.transitions); } @@ -118,6 +129,10 @@ void MystOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui _vm->_needsPageDrop = true; close(); break; + case kMapCmd: + _vm->_needsShowMap = true; + close(); + break; case GUI::kCloseCmd: close(); break; diff --git a/engines/mohawk/dialogs.h b/engines/mohawk/dialogs.h index 8aa9d0fbee..853ff30813 100644 --- a/engines/mohawk/dialogs.h +++ b/engines/mohawk/dialogs.h @@ -82,6 +82,7 @@ private: GUI::CheckboxWidget *_zipModeCheckbox; GUI::CheckboxWidget *_transitionsCheckbox; GUI::ButtonWidget *_dropPageButton; + GUI::ButtonWidget *_showMapButton; }; #endif diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index eedaa249ff..57d52d8394 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -341,12 +341,19 @@ Common::Error MohawkEngine_Myst::run() { break; case Common::KEYCODE_F5: _needsPageDrop = false; + _needsShowMap = false; + runDialog(*_optionsDialog); if (_needsPageDrop) { dropPage(); _needsPageDrop = false; } + + if (_needsShowMap) { + _scriptParser->showMap(); + _needsShowMap = false; + } break; default: break; diff --git a/engines/mohawk/myst.h b/engines/mohawk/myst.h index e12388373e..5edf774ed0 100644 --- a/engines/mohawk/myst.h +++ b/engines/mohawk/myst.h @@ -166,6 +166,7 @@ public: bool _tweaksEnabled; bool _needsUpdate; bool _needsPageDrop; + bool _needsShowMap; MystView _view; MystGraphics *_gfx; diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index a6351449b0..be5b7e1c76 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -145,6 +145,7 @@ void MystScriptParser::setupCommonOpcodes() { OPCODE(44, o_restoreMainCursor); // Opcode 45 Not Present OPCODE(46, o_soundWaitStop); + OPCODE(51, o_exitMap); // Opcodes 47 to 99 Not Present OPCODE(0xFFFF, NOP); @@ -922,4 +923,15 @@ void MystScriptParser::o_quit(uint16 op, uint16 var, uint16 argc, uint16 *argv) _vm->quitGame(); } +void MystScriptParser::showMap() { + if (_vm->getCurCard() != getMap()) { + _savedMapCardId = _vm->getCurCard(); + _vm->changeToCard(getMap(), true); + } +} + +void MystScriptParser::o_exitMap(uint16 op, uint16 var, uint16 argc, uint16 *argv) { + _vm->changeToCard(_savedMapCardId, true); +} + } // End of namespace Mohawk diff --git a/engines/mohawk/myst_scripts.h b/engines/mohawk/myst_scripts.h index c32d6a9266..18f5b27a6d 100644 --- a/engines/mohawk/myst_scripts.h +++ b/engines/mohawk/myst_scripts.h @@ -76,6 +76,9 @@ public: virtual void toggleVar(uint16 var); virtual bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 0; } + void showMap(); + void animatedUpdate(uint16 argc, uint16 *argv, uint16 delay); DECLARE_OPCODE(unknown); @@ -119,6 +122,7 @@ public: DECLARE_OPCODE(o_saveMainCursor); DECLARE_OPCODE(o_restoreMainCursor); DECLARE_OPCODE(o_soundWaitStop); + DECLARE_OPCODE(o_exitMap); // Used in multiple stacks DECLARE_OPCODE(o_quit); @@ -144,6 +148,7 @@ protected: MystResource *_invokingResource; uint16 _savedCardId; + uint16 _savedMapCardId; uint16 _savedCursorId; int16 _tempVar; // Generic temp var used by the scripts uint32 _startTime; // Generic start time used by the scripts diff --git a/engines/mohawk/myst_stacks/channelwood.h b/engines/mohawk/myst_stacks/channelwood.h index 43820aa125..a3ea406003 100644 --- a/engines/mohawk/myst_stacks/channelwood.h +++ b/engines/mohawk/myst_stacks/channelwood.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9932; } + DECLARE_OPCODE(o_bridgeToggle); DECLARE_OPCODE(o_pipeExtend); DECLARE_OPCODE(o_drawImageChangeCardAndVolume); diff --git a/engines/mohawk/myst_stacks/mechanical.h b/engines/mohawk/myst_stacks/mechanical.h index 112d28eea9..3bd7f2d71b 100644 --- a/engines/mohawk/myst_stacks/mechanical.h +++ b/engines/mohawk/myst_stacks/mechanical.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9931; } + void birdSing_run(); void elevatorRotation_run(); void elevatorGoMiddle_run(); diff --git a/engines/mohawk/myst_stacks/myst.h b/engines/mohawk/myst_stacks/myst.h index ca546e202b..9510d371d7 100644 --- a/engines/mohawk/myst_stacks/myst.h +++ b/engines/mohawk/myst_stacks/myst.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9934; } + void towerRotationMap_run(); void libraryBookcaseTransform_run(); void generatorControlRoom_run(); diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index fd4e937f63..d314c4d810 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -50,6 +50,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9930; } + DECLARE_OPCODE(o_mazeRunnerMove); DECLARE_OPCODE(o_mazeRunnerSoundRepeat); DECLARE_OPCODE(o_soundReceiverSigma); diff --git a/engines/mohawk/myst_stacks/stoneship.h b/engines/mohawk/myst_stacks/stoneship.h index 6def83f2ab..4125412b4d 100644 --- a/engines/mohawk/myst_stacks/stoneship.h +++ b/engines/mohawk/myst_stacks/stoneship.h @@ -49,6 +49,8 @@ private: void toggleVar(uint16 var); bool setVarValue(uint16 var, uint16 value); + virtual uint16 getMap() { return 9933; } + DECLARE_OPCODE(o_pumpTurnOff); DECLARE_OPCODE(o_brotherDoorOpen); DECLARE_OPCODE(o_cabinBookMovie); |