diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/scumm/verbs.cpp | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2 scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip |
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend
changes into the branch. I suppose the gp2x backend and probably all new
backends, i.e. gph, dingux etc., might not compile anymore.
Since I have no way of testing those it would be nice if porters could look
into getting those up to speed in this branch.
svn-id: r53399
Diffstat (limited to 'engines/scumm/verbs.cpp')
-rw-r--r-- | engines/scumm/verbs.cpp | 72 |
1 files changed, 54 insertions, 18 deletions
diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index 95fba8ee7e..77181c0b55 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -651,6 +651,50 @@ void ScummEngine_v2::checkExecVerbs() { } } + // Simulate inventory picking and scrolling keys + int object = -1; + + switch (_mouseAndKeyboardStat) { + case 'u': // arrow up + if (_inventoryOffset >= 2) { + _inventoryOffset -= 2; + redrawV2Inventory(); + } + return; + case 'j': // arrow down + if (_inventoryOffset + 4 < getInventoryCount(_scummVars[VAR_EGO])) { + _inventoryOffset += 2; + redrawV2Inventory(); + } + return; + case 'i': // object + object = 0; + break; + case 'o': + object = 1; + break; + case 'k': + object = 2; + break; + case 'l': + object = 3; + break; + } + + if (object != -1) { + object = findInventory(_scummVars[VAR_EGO], object + 1 + _inventoryOffset); + + if (object > 0) { + if (_game.version == 0) { + _activeInventory = object; + + } else { + runInputScript(kInventoryClickArea, object, 0); + } + } + return; + } + // Generic keyboard input runInputScript(kKeyClickArea, _mouseAndKeyboardStat, 1); } else if (_mouseAndKeyboardStat & MBS_MOUSE_MASK) { @@ -701,30 +745,17 @@ void ScummEngine_v0::runObject(int obj, int entry) { runObjectScript(obj, entry, false, false, NULL); } else if (entry != 13 && entry != 15) { if (_activeVerb != 3) { - VAR(9) = entry; + VAR(VAR_ACTIVE_VERB) = entry; runScript(3, 0, 0, 0); // For some reasons, certain objects don't have a "give" script - } else if (VAR(5) > 0 && VAR(5) < 8) { + } else if (VAR(VAR_ACTIVE_ACTOR) > 0 && VAR(VAR_ACTIVE_ACTOR) < 8) { if (_activeInventory) - setOwnerOf(_activeInventory, VAR(5)); + setOwnerOf(_activeInventory, VAR(VAR_ACTIVE_ACTOR)); } } } -void ScummEngine_v2::runObject(int obj, int entry) { - if (getVerbEntrypoint(obj, entry) != 0) { - runObjectScript(obj, entry, false, false, NULL); - } else if (entry != 13 && entry != 15) { - VAR(9) = entry; - runScript(3, 0, 0, 0); - } - - _activeInventory = 0; - _activeObject = 0; - _activeVerb = 13; -} - bool ScummEngine_v0::verbMoveToActor(int actor) { Actor *a = derefActor(VAR(VAR_EGO), "verbMoveToActor"); Actor *a2 = derefActor(actor, "verbMoveToActor"); @@ -911,7 +942,7 @@ bool ScummEngine_v0::verbExec() { return true; } _v0ObjectInInventory = true; - VAR(5) = _activeActor; + VAR(VAR_ACTIVE_ACTOR) = _activeActor; runObject(_activeInventory , 3); _v0ObjectInInventory = false; @@ -1420,9 +1451,14 @@ void ScummEngine::restoreVerbBG(int verb) { VerbSlot *vs; vs = &_verbs[verb]; + uint8 col = +#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE + ((_game.platform == Common::kPlatformFMTowns) && (_game.id == GID_MONKEY2 || _game.id == GID_INDY4) && (vs->bkcolor == _townsOverrideShadowColor)) ? 0 : +#endif + vs->bkcolor; if (vs->oldRect.left != -1) { - restoreBackground(vs->oldRect, vs->bkcolor); + restoreBackground(vs->oldRect, col); vs->oldRect.left = -1; } } |