[Scummvm-cvs-logs] CVS: scummvm/queen logic.cpp,1.15,1.16

Gregory Montoir cyx at users.sourceforge.net
Fri Oct 3 13:00:04 CEST 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv26392

Modified Files:
	logic.cpp 
Log Message:
fix 2 cases not handled in findBob() (stupid me...) and match new/delete

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- logic.cpp	3 Oct 2003 19:47:41 -0000	1.15
+++ logic.cpp	3 Oct 2003 19:59:19 -0000	1.16
@@ -31,7 +31,7 @@
 }
 
 QueenLogic::~QueenLogic() {
-	free (_jas);
+	delete[] _jas;
 	//free(_graphicData);
 }
 
@@ -280,16 +280,25 @@
 						++idxStatic;
 					}
 				}
+				else if(img == -1) {
+					++idxStatic;
+				}
+				else if(img == -2) {
+					++idxAnimated;
+				}
 			}
-			// FIXME: _max*Frame variables should initialized in SETUP_FURNITURE and DISP_ROOM
+			// FIXME: _max*Frame variables should be initialized in SETUP_FURNITURE and DISP_ROOM
 			if(bobtype == 0) {
 				// static bob
-				bobnum = 19 + _maxStaticFrame + idxStatic;
+				if(idxStatic > 0) {
+					bobnum = 19 + _maxStaticFrame + idxStatic;
+				}
 			}
 			else {
 				// animated bob
-				bobnum = 4 + _maxAnimatedFrame + idxAnimated;
-
+				if(idxAnimated > 0) {
+					bobnum = 4 + _maxAnimatedFrame + idxAnimated;
+				}
 			}
 		}
 	}
@@ -355,7 +364,7 @@
 		if(img <= -10) {
 			GraphicData* pgd = &_graphicData[-(img + 10)];
 			if(pgd->lastFrame != 0) {
-				idx += ABS(pgd->lastFrame - pgd->firstFrame) + 1;
+				idx += ABS(pgd->lastFrame) - pgd->firstFrame + 1;
 			}
 			else {
 				++idx;





More information about the Scummvm-git-logs mailing list