[Scummvm-cvs-logs] CVS: scummvm/queen graphics.cpp,1.106,1.107

Gregory Montoir cyx at users.sourceforge.net
Sun Oct 17 12:07:02 CEST 2004


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

Modified Files:
	graphics.cpp 
Log Message:
fix intro glitch regression

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- graphics.cpp	8 Oct 2004 18:43:23 -0000	1.106
+++ graphics.cpp	17 Oct 2004 19:06:35 -0000	1.107
@@ -193,7 +193,14 @@
 static int compareBobDrawOrder(const void *a, const void *b) {
 	const BobSlot *bob1 = *(const BobSlot * const *)a;
 	const BobSlot *bob2 = *(const BobSlot * const *)b;
-	return bob1->y - bob2->y;
+	int d = bob1->y - bob2->y;
+	// As the qsort() function may reorder "equal" elements,
+	// we use the bob slot number when needed. This is required 
+	// during the introduction, to hide a crate behind the clock.
+	if (d == 0) {
+		d = bob1 - bob2;
+	}
+	return d;
 }
 
 const Box Graphics::_gameScreenBox(0, 0, GAME_SCREEN_WIDTH - 1, ROOM_ZONE_HEIGHT - 1);





More information about the Scummvm-git-logs mailing list