[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.467,2.468 scumm.cpp,1.469,1.470 scumm.h,1.607,1.608 verbs.cpp,1.133,1.134

Max Horn fingolfin at users.sourceforge.net
Wed Apr 27 18:07:15 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27088

Modified Files:
	intern.h scumm.cpp scumm.h verbs.cpp 
Log Message:
Added new handleMouseOver to allow further refactoring of the V2 specific verb code; added a TODO comment regarding the blast code

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.467
retrieving revision 2.468
diff -u -d -r2.467 -r2.468
--- intern.h	28 Apr 2005 00:44:49 -0000	2.467
+++ intern.h	28 Apr 2005 01:04:24 -0000	2.468
@@ -292,6 +292,7 @@
 	void resetSentence();
 	void setUserState(byte state);
 
+	virtual void handleMouseOver(bool updateInventory);
 	void initV2MouseOver();
 	void initNESMouseOver();
 

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.469
retrieving revision 1.470
diff -u -d -r1.469 -r1.470
--- scumm.cpp	28 Apr 2005 00:45:05 -0000	1.469
+++ scumm.cpp	28 Apr 2005 01:04:40 -0000	1.470
@@ -2057,12 +2057,7 @@
 			redrawVerbs();
 		}
 
-		verbMouseOver(0);
-
-		if (_version <= 2) {
-			((ScummEngine_v2 *)this)->redrawV2Inventory();
-			((ScummEngine_v2 *)this)->checkV2MouseOver(_mouse);
-		}
+		handleMouseOver(false);
 
 		_fullRedraw = true;
 	}
@@ -2135,18 +2130,14 @@
 			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

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.607
retrieving revision 1.608
diff -u -d -r1.607 -r1.608
--- scumm.h	28 Apr 2005 00:45:06 -0000	1.607
+++ scumm.h	28 Apr 2005 01:04:41 -0000	1.608
@@ -795,6 +795,8 @@
 	int8 _userPut;
 	uint16 _userState;
 
+	virtual void handleMouseOver(bool updateInventory);
+
 	void redrawVerbs();
 	void checkExecVerbs();
 	void verbMouseOver(int verb);

Index: verbs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/verbs.cpp,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- verbs.cpp	26 Apr 2005 15:52:55 -0000	1.133
+++ verbs.cpp	28 Apr 2005 01:04:42 -0000	1.134
@@ -345,6 +345,28 @@
 	_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;





More information about the Scummvm-git-logs mailing list