[Scummvm-cvs-logs] scummvm master -> cfacca1a26e233f3054d5b04858316a3c1ae8be7

fuzzie fuzzie at fuzzie.org
Thu Apr 14 21:51:05 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cfacca1a26 GRAPHICS: Tidy up 4bpp handling a little.


Commit: cfacca1a26e233f3054d5b04858316a3c1ae8be7
    https://github.com/scummvm/scummvm/commit/cfacca1a26e233f3054d5b04858316a3c1ae8be7
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-04-14T12:47:56-07:00

Commit Message:
GRAPHICS: Tidy up 4bpp handling a little.

Changed paths:
    graphics/png.cpp



diff --git a/graphics/png.cpp b/graphics/png.cpp
index f3a6a28..b256c87 100644
--- a/graphics/png.cpp
+++ b/graphics/png.cpp
@@ -170,10 +170,11 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
 		}
 	} else {
 		byte index, r, g, b;
-		bool otherPixel = false;
 
 		// Convert the indexed surface to the target pixel format
 		for (uint16 i = 0; i < output->h; i++) {
+			bool otherPixel = false;
+
 			for (uint16 j = 0; j < output->w; j++) {
 				if (_header.bitDepth != 4)
 					index = *src;
@@ -196,8 +197,9 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
 					src++;
 				otherPixel = !otherPixel;
 			}
+			// The surface is a whole scanline wide, skip the rest of it.
 			if (_header.bitDepth == 4)
-				src += output->w/2;
+				src += output->w / 2;
 		}
 	}
 






More information about the Scummvm-git-logs mailing list