aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs/script.cpp
diff options
context:
space:
mode:
authorBenjamin Haisch2010-11-03 11:58:17 +0000
committerWillem Jan Palenstijn2011-11-20 22:43:10 +0100
commit1cb95f36e72dd4b4e86a0a1bf49e1b797c5781c2 (patch)
tree6c09c5f5adb105b44db5813e9491e02911a3711a /engines/toltecs/script.cpp
parent9698127c5d78c92f99032d55dec5fe1feb773ae4 (diff)
downloadscummvm-rg350-1cb95f36e72dd4b4e86a0a1bf49e1b797c5781c2.tar.gz
scummvm-rg350-1cb95f36e72dd4b4e86a0a1bf49e1b797c5781c2.tar.bz2
scummvm-rg350-1cb95f36e72dd4b4e86a0a1bf49e1b797c5781c2.zip
TOLTECS: - More work on the menu system, saving and loading from there is now possible
- Add blastSprite method which draws a sprite directly to the frontScreen without the renderQueue - Add F10 scancode in sfHandleInput to open the menu
Diffstat (limited to 'engines/toltecs/script.cpp')
-rw-r--r--engines/toltecs/script.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp
index 0c9f89e711..3c2060048b 100644
--- a/engines/toltecs/script.cpp
+++ b/engines/toltecs/script.cpp
@@ -36,6 +36,7 @@
#include "toltecs/toltecs.h"
#include "toltecs/animation.h"
+#include "toltecs/menu.h"
#include "toltecs/movie.h"
#include "toltecs/palette.h"
#include "toltecs/resource.h"
@@ -180,6 +181,14 @@ void ScriptInterpreter::runScript() {
if (_vm->_movieSceneFlag)
_vm->_mouseButton = 0;
+
+ if (_vm->_saveLoadRequested != 0) {
+ if (_vm->_saveLoadRequested == 1)
+ _vm->loadGameState(_vm->_saveLoadSlot);
+ else if (_vm->_saveLoadRequested == 2)
+ _vm->saveGameState(_vm->_saveLoadSlot, _vm->_saveLoadDescription.c_str());
+ _vm->_saveLoadRequested = 0;
+ }
if (_switchLocalDataNear) {
_switchLocalDataNear = false;
@@ -1037,20 +1046,38 @@ void ScriptInterpreter::sfClearScreen() {
}
void ScriptInterpreter::sfHandleInput() {
- // TODO: Recheck what this does
int16 varOfs = arg16(3);
int16 keyCode = 0;
if (_vm->_rightButtonDown) {
keyCode = 1;
} else {
- // TODO: Handle Escape
- // TODO: Set keyboard scancode
+ /* Convert keyboard scancode to IBM PC scancode
+ Only scancodes known to be used (so far) are converted
+ */
+ switch (_vm->_keyState.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ keyCode = 1;
+ break;
+ case Common::KEYCODE_F10:
+ keyCode = 68;
+ break;
+ default:
+ break;
+ }
}
localWrite16(varOfs, keyCode);
}
void ScriptInterpreter::sfRunOptionsScreen() {
- // TODO
+ _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();
+ _vm->_system->showMouse(true);
+ _vm->_menuSystem->run();
+ _vm->_keyState.reset();
+ _switchLocalDataNear = true;
}
/* NOTE: The opcodes sfPrecacheSprites, sfPrecacheSounds1, sfPrecacheSounds2 and