[Scummvm-cvs-logs] SF.net SVN: scummvm: [29034] scummvm/trunk/engines/agi/picture.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Sep 23 01:56:08 CEST 2007


Revision: 29034
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29034&view=rev
Author:   thebluegr
Date:     2007-09-22 16:56:08 -0700 (Sat, 22 Sep 2007)

Log Message:
-----------
Make sure that picture fill doesn't go out of the picture's bounds, since pre-AGI pictures have different dimensions

Modified Paths:
--------------
    scummvm/trunk/engines/agi/picture.cpp

Modified: scummvm/trunk/engines/agi/picture.cpp
===================================================================
--- scummvm/trunk/engines/agi/picture.cpp	2007-09-22 23:39:47 UTC (rev 29033)
+++ scummvm/trunk/engines/agi/picture.cpp	2007-09-22 23:56:08 UTC (rev 29034)
@@ -291,7 +291,7 @@
 		putVirtPixel(c, y);
 		if (isOkFillHere(c, y - 1)) {
 			if (newspanUp) {
-				lpush(c + 320 * (y - 1));
+				lpush(c + (_width * 2) * (y - 1));
 				newspanUp = 0;
 			}
 		} else {
@@ -300,7 +300,7 @@
 
 		if (isOkFillHere(c, y + 1)) {
 			if (newspanDown) {
-				lpush(c + 320 * (y + 1));
+				lpush(c + (_width * 2) * (y + 1));
 				newspanDown = 0;
 			}
 		} else {
@@ -310,7 +310,7 @@
 }
 
 void PictureMgr::agiFill(unsigned int x, unsigned int y) {
-	lpush(x + 320 * y);
+	lpush(x + (_width * 2) * y);
 
 	for (;;) {
 		uint16 c = lpop();
@@ -319,8 +319,8 @@
 		if (c == 0xffff)
 			break;
 
-		x = c % 320;
-		y = c / 320;
+		x = c % (_width * 2);
+		y = c / (_width * 2);
 
 		fillScanline(x, y);
 	}
@@ -477,7 +477,7 @@
 	pen_x = (pen_x * 2) - pen_size;
 	if (pen_x < 0) pen_x = 0;
 
-	temp16 = 320 - (2 * pen_size);
+	temp16 = (_width * 2) - (2 * pen_size);
 	if (pen_x >= temp16)
 		pen_x = temp16;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list