aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2005-04-28 01:04:42 +0000
committerMax Horn2005-04-28 01:04:42 +0000
commitec435855378a610ca7e40d4d8ee31bed2df494a0 (patch)
tree421b3886b48aa265ea2e3f6b5baf278b228e9208
parent5109e82c35c027c5ab695e54666476b04734c786 (diff)
downloadscummvm-rg350-ec435855378a610ca7e40d4d8ee31bed2df494a0.tar.gz
scummvm-rg350-ec435855378a610ca7e40d4d8ee31bed2df494a0.tar.bz2
scummvm-rg350-ec435855378a610ca7e40d4d8ee31bed2df494a0.zip
Added new handleMouseOver to allow further refactoring of the V2 specific verb code; added a TODO comment regarding the blast code
svn-id: r17848
-rw-r--r--scumm/intern.h1
-rw-r--r--scumm/scumm.cpp25
-rw-r--r--scumm/scumm.h2
-rw-r--r--scumm/verbs.cpp22
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;