diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/scumm.cpp | 25 | ||||
-rw-r--r-- | scumm/scumm.h | 2 | ||||
-rw-r--r-- | scumm/verbs.cpp | 22 |
4 files changed, 33 insertions, 17 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 224c571524..8d41c5f231 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -292,6 +292,7 @@ protected: void resetSentence(); void setUserState(byte state); + virtual void handleMouseOver(bool updateInventory); void initV2MouseOver(); void initNESMouseOver(); diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 29b199b772..2885ebf176 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -2057,12 +2057,7 @@ load_game: redrawVerbs(); } - verbMouseOver(0); - - if (_version <= 2) { - ((ScummEngine_v2 *)this)->redrawV2Inventory(); - ((ScummEngine_v2 *)this)->checkV2MouseOver(_mouse); - } + handleMouseOver(false); _fullRedraw = true; } @@ -2135,18 +2130,14 @@ load_game: clearClickedStatus(); } - if (_cursor.state > 0) - verbMouseOver(findVerbAtPos(_mouse.x, _mouse.y)); + handleMouseOver(oldEgo != VAR(VAR_EGO)); - if (_version <= 2) { - if (oldEgo != VAR(VAR_EGO)) { - // FIXME/TODO: Reset and redraw the sentence line - oldEgo = VAR(VAR_EGO); - _inventoryOffset = 0; - ((ScummEngine_v2 *)this)->redrawV2Inventory(); - } - ((ScummEngine_v2 *)this)->checkV2MouseOver(_mouse); - } + // + // TODO: The whole blast object/text code is V6-8 specific. So it + // would be nice to move it to ScummEngine_v6. One way to make that + // possible would be to replace their invocation with two new virtual + // methods preDrawScreenHook() and postDrawScreenHook(). + // // For the Full Throttle credits to work properly, the blast // texts have to be drawn before the blast objects. Unless diff --git a/scumm/scumm.h b/scumm/scumm.h index af68c69698..0c7335c6b9 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -795,6 +795,8 @@ protected: int8 _userPut; uint16 _userState; + virtual void handleMouseOver(bool updateInventory); + void redrawVerbs(); void checkExecVerbs(); void verbMouseOver(int verb); diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index cfe37ca09d..98482cb6d2 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -345,6 +345,28 @@ void ScummEngine::redrawVerbs() { _verbMouseOver = verb; } +void ScummEngine::handleMouseOver(bool updateInventory) { + if (_completeScreenRedraw) { + verbMouseOver(0); + } else { + if (_cursor.state > 0) + verbMouseOver(findVerbAtPos(_mouse.x, _mouse.y)); + } +} + +void ScummEngine_v2::handleMouseOver(bool updateInventory) { + ScummEngine::handleMouseOver(updateInventory); + + if (updateInventory) { + // FIXME/TODO: Reset and redraw the sentence line + _inventoryOffset = 0; + } + if (_completeScreenRedraw || updateInventory) { + redrawV2Inventory(); + } + checkV2MouseOver(_mouse); +} + void ScummEngine::checkExecVerbs() { int i, over; VerbSlot *vs; |