[Scummvm-cvs-logs] SF.net SVN: scummvm:[44122] scummvm/trunk/engines/gob/video.cpp

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Thu Sep 17 00:19:55 CEST 2009


Revision: 44122
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44122&view=rev
Author:   strangerke
Date:     2009-09-16 22:19:54 +0000 (Wed, 16 Sep 2009)

Log Message:
-----------
Playtoons - Add patterns to drawCircle

Modified Paths:
--------------
    scummvm/trunk/engines/gob/video.cpp

Modified: scummvm/trunk/engines/gob/video.cpp
===================================================================
--- scummvm/trunk/engines/gob/video.cpp	2009-09-16 21:22:28 UTC (rev 44121)
+++ scummvm/trunk/engines/gob/video.cpp	2009-09-16 22:19:54 UTC (rev 44122)
@@ -367,11 +367,15 @@
 	int16 ddFy = -2 * radius;
 	int16 x = 0;
 	int16 y = radius;
+	int16 tmpPattern = (_vm->_draw->_pattern & 0xFF);
 
-	putPixel(x0, y0 + radius, color, dest);
-	putPixel(x0, y0 - radius, color, dest);
-	putPixel(x0 + radius, y0, color, dest);
-	putPixel(x0 - radius, y0, color, dest);
+	if (tmpPattern == 0) {
+		putPixel(x0, y0 + radius, color, dest);
+		putPixel(x0, y0 - radius, color, dest);
+		putPixel(x0 + radius, y0, color, dest);
+		putPixel(x0 - radius, y0, color, dest);
+	} else
+		warning ("Video::drawCircle - pattern %d", _vm->_draw->_pattern);
 
 	while (x < y) {
 		if (f >= 0) {
@@ -382,14 +386,35 @@
 		x++;
 		ddFx += 2;
 		f += ddFx + 1;
-		putPixel(x0 + x, y0 + y, color, dest);
-		putPixel(x0 - x, y0 + y, color, dest);
-		putPixel(x0 + x, y0 - y, color, dest);
-		putPixel(x0 - x, y0 - y, color, dest);
-		putPixel(x0 + y, y0 + x, color, dest);
-		putPixel(x0 - y, y0 + x, color, dest);
-		putPixel(x0 + y, y0 - x, color, dest);
-		putPixel(x0 - y, y0 - x, color, dest);
+
+		switch (tmpPattern) {
+		case -1:
+			fillRect(dest, x0 - y, y0 + x, x0 + y, y0 + x, color);
+			fillRect(dest, x0 - x, y0 + y, x0 + x, y0 + y, color);
+			fillRect(dest, x0 - y, y0 - x, x0 + y, y0 - x, color);
+			fillRect(dest, x0 - x, y0 - y, x0 + x, y0 - y, color);
+			break;
+		case 0:
+			putPixel(x0 + x, y0 + y, color, dest);
+			putPixel(x0 - x, y0 + y, color, dest);
+			putPixel(x0 + x, y0 - y, color, dest);
+			putPixel(x0 - x, y0 - y, color, dest);
+			putPixel(x0 + y, y0 + x, color, dest);
+			putPixel(x0 - y, y0 + x, color, dest);
+			putPixel(x0 + y, y0 - x, color, dest);
+			putPixel(x0 - y, y0 - x, color, dest);
+			break;
+		default:
+			fillRect(dest, x0 + y - tmpPattern, y0 + x - tmpPattern, x0 + y, y0 + x, color);
+			fillRect(dest, x0 + x - tmpPattern, y0 + y - tmpPattern, x0 + x, y0 + y, color);
+			fillRect(dest, x0 - y, y0 + x - tmpPattern, x0 - y + tmpPattern, y0 + x, color);
+			fillRect(dest, x0 - x, y0 + y - tmpPattern, x0 - x + tmpPattern, y0 + y, color);
+			fillRect(dest, x0 + y - tmpPattern, y0 - x, x0 + y, y0 - x + tmpPattern, color);
+			fillRect(dest, x0 + x - tmpPattern, y0 - y, x0 + x, y0 - y + tmpPattern, color);
+			fillRect(dest, x0 - y, y0 - x, x0 - y + tmpPattern, y0 - x + tmpPattern, color);
+			fillRect(dest, x0 - x, y0 - y, x0 - x + tmpPattern, y0 - y + tmpPattern, color);
+			break;
+		}
 	}
 }
 


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