[Scummvm-cvs-logs] CVS: scummvm/scumm costume.cpp,1.166,1.167

Eugene Sandulenko sev at users.sourceforge.net
Wed Mar 23 19:39:30 CET 2005


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

Modified Files:
	costume.cpp 
Log Message:
Proper calculation of edge case with number of costume frames from Quietust


Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/costume.cpp,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -d -r1.166 -r1.167
--- costume.cpp	24 Mar 2005 03:22:14 -0000	1.166
+++ costume.cpp	24 Mar 2005 03:38:51 -0000	1.167
@@ -579,7 +579,6 @@
 	const byte *src;
 	int frameset, framenum;
 	int offset;
-	byte *table;
 
 	_format = 0x01;
 	_mirror = 0;
@@ -593,13 +592,11 @@
 	offset = src[(frameset * 4 + framenum) * 2];
 
 	// Lookup & desc
-	table = _vm->_NEScostdesc;
-	offset = READ_LE_UINT16(table + v1MMNESLookup[_id] * 2);
-
-	if (v1MMNESLookup[_id] * 2 + 2 >= READ_LE_UINT16(table - 2)) {
-		_numAnim = (READ_LE_UINT16(table) - v1MMNESLookup[_id] * 2) / 2;
+	offset = READ_LE_UINT16(_vm->_NEScostdesc + v1MMNESLookup[_id] * 2);
+	if (v1MMNESLookup[_id] * 2 + 2 < READ_LE_UINT16(_vm->_NEScostdesc - 2)) {
+		_numAnim = (READ_LE_UINT16(_vm->_NEScostdesc + v1MMNESLookup[_id] * 2 + 2) - offset);
 	} else {
-		_numAnim = (READ_LE_UINT16(table + v1MMNESLookup[_id] * 2 + 2) - offset) / 2;
+		_numAnim = ((READ_LE_UINT16(_vm->_NEScostlens - 2) - 2) - offset);
 	}
 }
 





More information about the Scummvm-git-logs mailing list