diff options
author | Sven Hesse | 2012-06-15 13:32:43 +0200 |
---|---|---|
committer | Sven Hesse | 2012-06-15 13:35:46 +0200 |
commit | 7632246264102d88922fc963284af6250ea12f57 (patch) | |
tree | 8316a8fd8b7522b83a350e908195331730bc9081 /engines/gob/inter_littlered.cpp | |
parent | c668431522d834b24c00baf964d2b6b3f3a2bbb8 (diff) | |
download | scummvm-rg350-7632246264102d88922fc963284af6250ea12f57.tar.gz scummvm-rg350-7632246264102d88922fc963284af6250ea12f57.tar.bz2 scummvm-rg350-7632246264102d88922fc963284af6250ea12f57.zip |
GOB: Implement Util::getKeyState() for Little Red
This makes the bees level playable, removing the "lock-up".
Collision detection between Little Red and the bees and butterflies
doesn't work yet though, so they're just flying through her.
Nevertheless, the game seems to be completable now.
Diffstat (limited to 'engines/gob/inter_littlered.cpp')
-rw-r--r-- | engines/gob/inter_littlered.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/engines/gob/inter_littlered.cpp b/engines/gob/inter_littlered.cpp index 6a63998216..01d372aaeb 100644 --- a/engines/gob/inter_littlered.cpp +++ b/engines/gob/inter_littlered.cpp @@ -22,6 +22,13 @@ #include "gob/gob.h" #include "gob/inter.h" +#include "gob/global.h" +#include "gob/util.h" +#include "gob/draw.h" +#include "gob/game.h" +#include "gob/script.h" +#include "gob/hotspots.h" +#include "gob/sound/sound.h" namespace Gob { @@ -39,6 +46,8 @@ void Inter_LittleRed::setupOpcodesDraw() { void Inter_LittleRed::setupOpcodesFunc() { Inter_v2::setupOpcodesFunc(); + + OPCODEFUNC(0x14, oLittleRed_keyFunc); } void Inter_LittleRed::setupOpcodesGob() { @@ -46,4 +55,53 @@ void Inter_LittleRed::setupOpcodesGob() { OPCODEGOB(501, o2_stopProtracker); } +void Inter_LittleRed::oLittleRed_keyFunc(OpFuncParams ¶ms) { + animPalette(); + _vm->_draw->blitInvalidated(); + + handleBusyWait(); + + int16 cmd = _vm->_game->_script->readInt16(); + int16 key; + uint32 keyState; + + switch (cmd) { + case -1: + break; + + case 0: + _vm->_draw->_showCursor &= ~2; + _vm->_util->longDelay(1); + key = _vm->_game->_hotspots->check(0, 0); + storeKey(key); + + _vm->_util->clearKeyBuf(); + break; + + case 1: + _vm->_util->forceMouseUp(true); + key = _vm->_game->checkKeys(&_vm->_global->_inter_mouseX, + &_vm->_global->_inter_mouseY, &_vm->_game->_mouseButtons, 0); + storeKey(key); + break; + + case 2: + _vm->_util->processInput(true); + keyState = _vm->_util->getKeyState(); + + WRITE_VAR(0, keyState); + _vm->_util->clearKeyBuf(); + break; + + default: + _vm->_sound->speakerOnUpdate(cmd); + if (cmd < 20) { + _vm->_util->delay(cmd); + _noBusyWait = true; + } else + _vm->_util->longDelay(cmd); + break; + } +} + } // End of namespace Gob |