diff options
author | Filippos Karapetis | 2012-09-10 22:11:16 +0300 |
---|---|---|
committer | Filippos Karapetis | 2012-09-11 00:34:27 +0300 |
commit | a9a579891e2e267cf665f68ed1c9f4a2314d502e (patch) | |
tree | a7dc91e88178db883b21be42f956e472536b803f /engines/toltecs | |
parent | 72cdd019fc5797f1250e346828a8fcef11fb28a4 (diff) | |
download | scummvm-rg350-a9a579891e2e267cf665f68ed1c9f4a2314d502e.tar.gz scummvm-rg350-a9a579891e2e267cf665f68ed1c9f4a2314d502e.tar.bz2 scummvm-rg350-a9a579891e2e267cf665f68ed1c9f4a2314d502e.zip |
TOLTECS: Open the save menu with F5 and the load menu with F9
Also, this changes the dialog skip key to space instead of escape
Diffstat (limited to 'engines/toltecs')
-rw-r--r-- | engines/toltecs/menu.cpp | 4 | ||||
-rw-r--r-- | engines/toltecs/menu.h | 10 | ||||
-rw-r--r-- | engines/toltecs/script.cpp | 10 | ||||
-rw-r--r-- | engines/toltecs/script.h | 2 | ||||
-rw-r--r-- | engines/toltecs/toltecs.cpp | 21 | ||||
-rw-r--r-- | engines/toltecs/toltecs.h | 12 |
6 files changed, 33 insertions, 26 deletions
diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp index d9836521f4..d7ba254d9b 100644 --- a/engines/toltecs/menu.cpp +++ b/engines/toltecs/menu.cpp @@ -40,7 +40,7 @@ MenuSystem::MenuSystem(ToltecsEngine *vm) : _vm(vm) { MenuSystem::~MenuSystem() { } -int MenuSystem::run() { +int MenuSystem::run(MenuID menuId) { //debug("MenuSystem::run()"); @@ -53,7 +53,7 @@ int MenuSystem::run() { memcpy(backgroundOrig.getBasePtr(0,0), _vm->_screen->_frontScreen, 640 * 400); _currMenuID = kMenuIdNone; - _newMenuID = kMenuIdMain; + _newMenuID = menuId; _currItemID = kItemIdNone; _editingDescription = false; diff --git a/engines/toltecs/menu.h b/engines/toltecs/menu.h index 999744e9d5..9234a56398 100644 --- a/engines/toltecs/menu.h +++ b/engines/toltecs/menu.h @@ -29,14 +29,6 @@ namespace Toltecs { -enum MenuID { - kMenuIdNone, - kMenuIdMain, - kMenuIdSave, - kMenuIdLoad, - kMenuIdVolumes -}; - enum ItemID { kItemIdNone, // Main menu @@ -85,7 +77,7 @@ public: MenuSystem(ToltecsEngine *vm); ~MenuSystem(); - int run(); + int run(MenuID menuId); void update(); void handleEvents(); diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp index 9683831980..40b13526cf 100644 --- a/engines/toltecs/script.cpp +++ b/engines/toltecs/script.cpp @@ -1060,15 +1060,7 @@ void ScriptInterpreter::sfHandleInput() { } void ScriptInterpreter::sfRunOptionsScreen() { - _vm->_screen->loadMouseCursor(12); - _vm->_palette->loadAddPalette(9, 224); - _vm->_palette->setDeltaPalette(_vm->_palette->getMainPalette(), 7, 0, 31, 224); - _vm->_screen->finishTalkTextItems(); - _vm->_screen->clearSprites(); - CursorMan.showMouse(true); - _vm->_menuSystem->run(); - _vm->_keyState.reset(); - _switchLocalDataNear = true; + _vm->showMenu(kMenuIdMain); } /* NOTE: The opcodes sfPrecacheSprites, sfPrecacheSounds1, sfPrecacheSounds2 and diff --git a/engines/toltecs/script.h b/engines/toltecs/script.h index 0c1898c525..7a50d22ff2 100644 --- a/engines/toltecs/script.h +++ b/engines/toltecs/script.h @@ -56,6 +56,8 @@ public: void saveState(Common::WriteStream *out); void loadState(Common::ReadStream *in); + void setSwitchLocalDataNear(bool newValue) { _switchLocalDataNear = newValue; } + protected: struct ScriptRegs { diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp index 987194212f..b1f60c5cc7 100644 --- a/engines/toltecs/toltecs.cpp +++ b/engines/toltecs/toltecs.cpp @@ -327,13 +327,13 @@ void ToltecsEngine::updateInput() { //debug("key: flags = %02X; keycode = %d", _keyState.flags, _keyState.keycode); switch (event.kbd.keycode) { - case Common::KEYCODE_F7: - savegame("toltecs.001", "Quicksave"); + case Common::KEYCODE_F5: + showMenu(kMenuIdSave); break; - case Common::KEYCODE_F9: - loadgame("toltecs.001"); + case Common::KEYCODE_F7: + showMenu(kMenuIdLoad); break; - case Common::KEYCODE_ESCAPE: + case Common::KEYCODE_SPACE: // Skip current dialog line, if a dialog is active if (_screen->getTalkTextDuration() > 0) { _sound->stopSpeech(); @@ -639,7 +639,18 @@ int16 ToltecsEngine::findRectAtPoint(byte *rectData, int16 x, int16 y, int16 ind } return -1; +} +void ToltecsEngine::showMenu(MenuID menuId) { + _screen->loadMouseCursor(12); + _palette->loadAddPalette(9, 224); + _palette->setDeltaPalette(_palette->getMainPalette(), 7, 0, 31, 224); + _screen->finishTalkTextItems(); + _screen->clearSprites(); + CursorMan.showMouse(true); + _menuSystem->run(menuId); + _keyState.reset(); + _script->setSwitchLocalDataNear(true); } void ToltecsEngine::syncSoundSettings() { diff --git a/engines/toltecs/toltecs.h b/engines/toltecs/toltecs.h index 58678f2272..e82a88bcfc 100644 --- a/engines/toltecs/toltecs.h +++ b/engines/toltecs/toltecs.h @@ -81,6 +81,14 @@ enum SysString { kSysStrCount }; +enum MenuID { + kMenuIdNone, + kMenuIdMain, + kMenuIdSave, + kMenuIdLoad, + kMenuIdVolumes +}; + class ToltecsEngine : public ::Engine { Common::KeyState _keyPressed; @@ -120,7 +128,9 @@ public: void scrollCameraLeft(int16 delta); void scrollCameraRight(int16 delta); void updateCamera(); - + + void showMenu(MenuID menuId); + void talk(int16 slotIndex, int16 slotOffset); void walk(byte *walkData); |