[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.395,1.396

kirben kirben at users.sourceforge.net
Fri Jan 6 02:16:02 CET 2006


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

Modified Files:
	actor.cpp 
Log Message:

HE90+ games use difference value for actor conditions.
Fixes animation regressions during speech.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.395
retrieving revision 1.396
diff -u -d -r1.395 -r1.396
--- actor.cpp	5 Jan 2006 09:27:02 -0000	1.395
+++ actor.cpp	6 Jan 2006 10:14:59 -0000	1.396
@@ -1995,14 +1995,14 @@
 }
 
 void Actor::setUserCondition(int slot, int set) {
-	debug(1, "Actor::setUserCondition(%d, %d)", slot, set);
-	assert(slot >= 1 && slot <= 0x20);
+	const int condMaskCode = (_vm->_heversion >= 90) ? 0x1FFF : 0x3FF;
+	checkRange(32, 1, slot, "Condition %d out of range");
 	if (set == 0) {
 		_heCondMask &= ~(1 << (slot + 0xF));
 	} else {
 		_heCondMask |= 1 << (slot + 0xF);
 	}
-	if (_heCondMask & 0x3FF) {
+	if (_heCondMask & condMaskCode) {
 		_heCondMask &= ~1;
 	} else {
 		_heCondMask |= 1;
@@ -2010,17 +2010,17 @@
 }
 
 bool Actor::isUserConditionSet(int slot) const {
-	assert(slot >= 1 && slot <= 0x20);
+	checkRange(32, 1, slot, "Condition %d out of range");
 	return (_heCondMask & (1 << (slot + 0xF))) != 0;
 }
 
 void Actor::setTalkCondition(int slot) {
-	debug(1, "Actor::setTalkCondition(%d)", slot);
-	assert(slot >= 1 && slot <= 0x10);
-	_heCondMask = (_heCondMask & ~0x3FF) | 1;
+	const int condMaskCode = (_vm->_heversion >= 90) ? 0x1FFF : 0x3FF;
+	checkRange(32, 1, slot, "Condition %d out of range");
+	_heCondMask = (_heCondMask & ~condMaskCode) | 1;
 	if (slot != 1) {
 		_heCondMask |= 1 << (slot - 1);
-		if (_heCondMask & 0x3FF) {
+		if (_heCondMask & condMaskCode) {
 			_heCondMask &= ~1;
 		} else {
 			_heCondMask |= 1;
@@ -2029,7 +2029,7 @@
 }
 
 bool Actor::isTalkConditionSet(int slot) const {
-	assert(slot >= 1 && slot <= 0x10);
+	checkRange(32, 1, slot, "Condition %d out of range");
 	return (_heCondMask & (1 << (slot - 1))) != 0;
 }
 





More information about the Scummvm-git-logs mailing list