diff options
author | lukaslw | 2014-06-24 03:57:40 +0200 |
---|---|---|
committer | lukaslw | 2014-06-24 03:57:40 +0200 |
commit | a319f473f6502b4acd2b7da4aa5220a965335081 (patch) | |
tree | 3b8ba53c8c70f3b08503c3677e58d36eb6a4b9df | |
parent | 11d062f2b222826965fb1653aade448fa359c1ac (diff) | |
download | scummvm-rg350-a319f473f6502b4acd2b7da4aa5220a965335081.tar.gz scummvm-rg350-a319f473f6502b4acd2b7da4aa5220a965335081.tar.bz2 scummvm-rg350-a319f473f6502b4acd2b7da4aa5220a965335081.zip |
PRINCE: LMB outside of inventory - update
-rw-r--r-- | engines/prince/prince.cpp | 24 | ||||
-rw-r--r-- | engines/prince/script.cpp | 4 | ||||
-rw-r--r-- | engines/prince/script.h | 1 |
3 files changed, 28 insertions, 1 deletions
diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 7fefae9f5f..04901d78fa 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -1685,8 +1685,11 @@ void PrinceEngine::drawInvItems() { } void PrinceEngine::leftMouseButton() { + int option = 0; + if (_optionsFlag) { if (_optionEnabled < _optionsNumber) { + option = _optionEnabled; _optionsFlag = 0; // edi = optionsMob // ebp = optionsMobNumber @@ -1701,12 +1704,31 @@ void PrinceEngine::leftMouseButton() { // @@walkto - TODO return; } + option = 0; } //do_option // selectedMob = optionsMobNumber if (_currentPointerNumber != 2) { //skip_use_code - + int optionScriptOffset = _script->getOptionScript(_room->_walkTo, option); + int optionEvent; + if (optionScriptOffset != 0) { + optionEvent = _script->scanMobEvents(_optionsMob, optionScriptOffset); + } else { + optionEvent = -1; + } + if (optionEvent == -1) { + if (option == 0) { + //@@walkto - TODO + return; + } else { + optionEvent = _script->getOptionScript(_script->_scriptInfo.stdExamine, option - 1); + } + } + // eax <- return (int)READ_UINT16(&_data[optionEvent]); + // store_new_pc: + // storeNewPC(); + return; } else if (_selectedMode != 0) { //give_item diff --git a/engines/prince/script.cpp b/engines/prince/script.cpp index a8efe71ca8..4122b3898e 100644 --- a/engines/prince/script.cpp +++ b/engines/prince/script.cpp @@ -205,6 +205,10 @@ uint8 *Script::getRoomOffset(int locationNr) { return &_data[_scriptInfo.rooms + locationNr * 64]; } +int Script::getOptionScript(int offset, int option) { + return (int)READ_UINT16(&_data[offset + option * 4]); +} + int Script::scanMobEvents(int mobMask, int dataEventOffset) { debug("mobMask: %d", mobMask); int i = 0; diff --git a/engines/prince/script.h b/engines/prince/script.h index 4a7316c9d5..5cdf9c64ba 100644 --- a/engines/prince/script.h +++ b/engines/prince/script.h @@ -135,6 +135,7 @@ public: int16 getLightY(int locationNr); int32 getShadowScale(int locationNr); uint8 *getRoomOffset(int locationNr); + int32 getOptionScript(int offset, int option); void installBackAnims(Common::Array<BackgroundAnim> &_backanimList, int offset); void installSingleBackAnim(Common::Array<BackgroundAnim> &_backanimList, int offset); bool loadAllMasks(Common::Array<Mask> &maskList, int offset); |