[Scummvm-cvs-logs] SF.net SVN: scummvm:[45560] scummvm/trunk/engines/scumm/gfx.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sat Oct 31 14:34:31 CET 2009


Revision: 45560
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45560&view=rev
Author:   eriktorbjorn
Date:     2009-10-31 13:34:31 +0000 (Sat, 31 Oct 2009)

Log Message:
-----------
Fixed flashlight drawing in 16 bpp games. (Which probably means PC-Engine Loom
is the only game where it makes any difference.)

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/gfx.cpp

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2009-10-31 13:15:49 UTC (rev 45559)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2009-10-31 13:34:31 UTC (rev 45560)
@@ -1374,17 +1374,24 @@
 	// rounded corners.
 	static const int corner_data[] = { 8, 6, 4, 3, 2, 2, 1, 1 };
 	int minrow = 0;
-	int maxcol = _flashlight.w - 1;
+	int maxcol = (_flashlight.w - 1) * _bytesPerPixel;
 	int maxrow = (_flashlight.h - 1) * vs->pitch;
 
 	for (i = 0; i < 8; i++, minrow += vs->pitch, maxrow -= vs->pitch) {
 		int d = corner_data[i];
 
 		for (j = 0; j < d; j++) {
-			_flashlight.buffer[minrow + j] = 0;
-			_flashlight.buffer[minrow + maxcol - j] = 0;
-			_flashlight.buffer[maxrow + j] = 0;
-			_flashlight.buffer[maxrow + maxcol - j] = 0;
+			if (_bytesPerPixel == 2) {
+				WRITE_UINT16(&_flashlight.buffer[minrow + 2 * j], 0);
+				WRITE_UINT16(&_flashlight.buffer[minrow + maxcol - 2 * j], 0);
+				WRITE_UINT16(&_flashlight.buffer[maxrow + 2 * j], 0);
+				WRITE_UINT16(&_flashlight.buffer[maxrow + maxcol - 2 * j], 0);
+			} else {
+				_flashlight.buffer[minrow + j] = 0;
+				_flashlight.buffer[minrow + maxcol - j] = 0;
+				_flashlight.buffer[maxrow + j] = 0;
+				_flashlight.buffer[maxrow + maxcol - j] = 0;
+			}
 		}
 	}
 


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