[Scummvm-cvs-logs] CVS: scummvm/scumm boxes.cpp,1.9,1.10 scummvm.cpp,2.36,2.37

Max Horn fingolfin at users.sourceforge.net
Mon Jan 13 05:38:03 CET 2003


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

Modified Files:
	boxes.cpp scummvm.cpp 
Log Message:
fix off by one error

Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/boxes.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- boxes.cpp	13 Jan 2003 01:29:44 -0000	1.9
+++ boxes.cpp	13 Jan 2003 13:37:43 -0000	1.10
@@ -136,9 +136,9 @@
 	if (_features & GF_AFTER_V8) {
 		int slot = FROM_LE_32(ptr->v8.scaleSlot);
 		if (slot) {
-			assert(0 <= slot && slot < 20);
+			assert(1 <= slot && slot <= 20);
 			int scaleX = 0, scaleY = 0;
-			ScaleSlot &s = _scaleSlots[slot];
+			ScaleSlot &s = _scaleSlots[slot-1];
 
 			if (s.y1 == s.y2 && s.x1 == s.x2)
 				error("Invalid scale slot %d", slot);

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.36
retrieving revision 2.37
diff -u -d -r2.36 -r2.37
--- scummvm.cpp	13 Jan 2003 01:29:45 -0000	2.36
+++ scummvm.cpp	13 Jan 2003 13:37:43 -0000	2.37
@@ -980,12 +980,13 @@
 
 void Scumm::setScaleSlot(int slot, int x1, int y1, int scale1, int x2, int y2, int scale2)
 {
-	_scaleSlots[slot].x2 = x2;
-	_scaleSlots[slot].y2 = y2;
-	_scaleSlots[slot].scale2 = scale2;
-	_scaleSlots[slot].x1 = x1;
-	_scaleSlots[slot].y1 = y1;
-	_scaleSlots[slot].scale1 = scale1;
+	assert(1 <= slot && slot <= 20);
+	_scaleSlots[slot-1].x2 = x2;
+	_scaleSlots[slot-1].y2 = y2;
+	_scaleSlots[slot-1].scale2 = scale2;
+	_scaleSlots[slot-1].x1 = x1;
+	_scaleSlots[slot-1].y1 = y1;
+	_scaleSlots[slot-1].scale1 = scale1;
 }
 
 void Scumm::dumpResource(char *tag, int idx, byte *ptr)





More information about the Scummvm-git-logs mailing list