[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.104,1.105 actor.h,1.23,1.24 script_v2.cpp,2.102,2.103

Max Horn fingolfin at users.sourceforge.net
Wed May 21 17:52:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv14560

Modified Files:
	actor.cpp actor.h script_v2.cpp 
Log Message:
freeze scripts & hide mouse during cutscenes; addde Actor::isPlayer method that should work in V2, too; fixed o2_walkActorToObject

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- actor.cpp	21 May 2003 18:09:46 -0000	1.104
+++ actor.cpp	22 May 2003 00:51:41 -0000	1.105
@@ -631,7 +631,7 @@
 			flags = _vm->getBoxFlags(box);
 
 			// Skip over invisible boxes
-			if (flags & kBoxInvisible && !(flags & kBoxPlayerOnly && !isInClass(kObjectClassPlayer)))
+			if (flags & kBoxInvisible && !(flags & kBoxPlayerOnly && !isPlayer()))
 				continue;
 			
 			// For increased performance, we perform a quick test if
@@ -1392,7 +1392,7 @@
 		// FIXME: not sure if this is needed in non-Zak games, but I think it shouldn't
 		// hurt there either.
 		int flags = _vm->getBoxFlags(next_box);
-		if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isInClass(kObjectClassPlayer))) {
+		if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {
 			moving |= MF_LAST_LEG;
 			return;
 		}
@@ -1526,3 +1526,12 @@
 bool Actor::isInClass(int cls) {
 	return _vm->getClass(number, cls);
 }
+
+bool Actor::isPlayer() {
+	if (_vm->_features & GF_AFTER_V2)
+		return _vm->VAR(42) <= number && number <= _vm->VAR(43);
+	else
+		return isInClass(kObjectClassPlayer);
+}
+
+

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- actor.h	20 May 2003 20:42:27 -0000	1.23
+++ actor.h	22 May 2003 00:51:42 -0000	1.24
@@ -193,6 +193,8 @@
 	
 protected:
 	bool isInClass(int cls);
+	
+	bool isPlayer();
 };
 
 #endif

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.102
retrieving revision 2.103
diff -u -d -r2.102 -r2.103
--- script_v2.cpp	22 May 2003 00:14:28 -0000	2.102
+++ script_v2.cpp	22 May 2003 00:51:42 -0000	2.103
@@ -1006,7 +1006,7 @@
 
 	a = derefActorSafe(getVarOrDirectByte(0x80), "o2_walkActorToObject");
 	assert(a);
-	obj = getVarOrDirectByte(0x40);
+	obj = getVarOrDirectWord(0x40);
 	if (whereIsObject(obj) != WIO_NOT_FOUND) {
 		int x, y, dir;
 		getObjectXYPos(obj, x, y, dir);
@@ -1191,6 +1191,9 @@
 	VAR(VAR_CURSORSTATE) = 200;
 	
 	// TODO: some cursor command stuff (hide mouse etc maybe?)
+	freezeScripts(0);
+	_userPut = 0;
+	_cursor.state = 0;
 	
 	_sentenceNum = 0;
 	stopScript(SENTENCE_SCRIPT);
@@ -1211,6 +1214,9 @@
 	VAR(VAR_CURSORSTATE) = vm.cutSceneData[1];
 
 	// TODO: some cursor command stuff (probably to reset it to the pre-cutscene state)
+	unfreezeScripts();
+	_userPut = 1;
+	_cursor.state = 1;
 	
 	if (_gameId == GID_MANIAC) {
 		camera._mode = (byte) vm.cutSceneData[3];





More information about the Scummvm-git-logs mailing list