diff options
author | Max Horn | 2003-07-12 12:16:17 +0000 |
---|---|---|
committer | Max Horn | 2003-07-12 12:16:17 +0000 |
commit | f383dc24c4aa17fd6a1b8c922f360db5baaf6c64 (patch) | |
tree | ced5fc0b0b179c14c4177f5b15a3284e31fbafbc | |
parent | 1e0b7aaa16d6caeca1d67f383297f7ed619348f9 (diff) | |
download | scummvm-rg350-f383dc24c4aa17fd6a1b8c922f360db5baaf6c64.tar.gz scummvm-rg350-f383dc24c4aa17fd6a1b8c922f360db5baaf6c64.tar.bz2 scummvm-rg350-f383dc24c4aa17fd6a1b8c922f360db5baaf6c64.zip |
fix existing ego actor change detection code
svn-id: r8941
-rw-r--r-- | scumm/scummvm.cpp | 14 | ||||
-rw-r--r-- | scumm/verbs.cpp | 12 |
2 files changed, 8 insertions, 18 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index d82c813266..9e89293c0d 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -1034,6 +1034,12 @@ int Scumm::scummLoop(int delta) { _talkDelay = 0; } + // Record the current ego actor before any scripts (including input scripts) + // get a chance to run. + int oldEgo = 0; + if (VAR_EGO != 0xFF) + oldEgo = VAR(VAR_EGO); + processKbd(); if (_features & GF_NEW_CAMERA) { @@ -1135,11 +1141,6 @@ load_game: _lastSaveTime = _system->get_msecs(); } - int oldEgo = 0; - - if (VAR_EGO != 0xFF) - oldEgo = VAR(VAR_EGO); - if (_completeScreenRedraw) { _completeScreenRedraw = false; gdi.clearCharsetMask(); @@ -1221,8 +1222,9 @@ load_game: if (_version <= 2) { if (oldEgo != VAR(VAR_EGO)) { - // FIXME: Reset and redraw the sentence line + // FIXME/TODO: Reset and redraw the sentence line oldEgo = VAR(VAR_EGO); + _inventoryOffset = 0; // TODO: Record the _inventoryOffset for each ego actor? redrawV2Inventory(); } checkV2MouseOver(_mouse); diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index a0aa86cf40..ea9d361e81 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -27,8 +27,6 @@ #include "scumm.h" #include "verbs.h" -int egoVar; // TODO: Put this in V2 class? - enum { kInventoryUpArrow = 4, kInventoryDownArrow = 5, @@ -158,11 +156,6 @@ void Scumm::checkV2Inventory(int x, int y) { if ((y < 34) || !(_mouseButStat & MBS_LEFT_CLICK)) return; - if (_scummVars[VAR_EGO] != egoVar) { - egoVar = _scummVars[VAR_EGO]; - _inventoryOffset = 0; - } - if (v2_mouseover_boxes[kInventoryUpArrow].rect.contains(x, y)) { _inventoryOffset -= 2; if (_inventoryOffset < 0) @@ -209,11 +202,6 @@ void Scumm::redrawV2Inventory() { _string[1].charset = 1; - if (_scummVars[VAR_EGO] != egoVar) { - egoVar = _scummVars[VAR_EGO]; - _inventoryOffset = 0; - } - max_inv = getInventoryCount(_scummVars[VAR_EGO]) - _inventoryOffset; if (max_inv > 4) max_inv = 4; |