[Scummvm-cvs-logs] CVS: scummvm gfx.cpp,1.113,1.114

Max Horn fingolfin at users.sourceforge.net
Fri Aug 23 16:17:04 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv17782

Modified Files:
	gfx.cpp 
Log Message:
modified version of patch #598622: Round corners for flashlight

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gfx.cpp,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- gfx.cpp	20 Aug 2002 02:20:40 -0000	1.113
+++ gfx.cpp	23 Aug 2002 23:16:39 -0000	1.114
@@ -643,8 +643,24 @@
 
 	blit(flashBuffer, bgbak, flashW*8, flashH);
 
-	// TODO - flashlight should have round corners
+	// Round the corners. To do so, we simply hard-code a set of nicely
+	// rounded corners.
+	int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
+	int minrow = 0;
+	int maxcol = flashW * 8 - 1;
+	int maxrow = (flashH - 1) * 320;
+
+	for (i = 0; i < 8; i++, minrow += 320, maxrow -= 320) {
+		int d = corner_data[i];
 
+		for (j = 0; j < d; j++) {
+			flashBuffer[minrow + j] = 0;
+			flashBuffer[minrow + maxcol - j] = 0;
+			flashBuffer[maxrow + j] = 0;
+			flashBuffer[maxrow + maxcol - j] = 0;
+		}
+	}
+	
 	_flashlightIsDrawn = true;
 }
 





More information about the Scummvm-git-logs mailing list