aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorAlyssa Milburn2011-04-14 21:47:56 +0200
committerAlyssa Milburn2011-04-14 21:47:56 +0200
commitcfacca1a26e233f3054d5b04858316a3c1ae8be7 (patch)
treec973966e31e68675c71083414b81782172654328 /graphics
parent8305f9c2a0e3de16a0e39fc8af65ef71decff092 (diff)
downloadscummvm-rg350-cfacca1a26e233f3054d5b04858316a3c1ae8be7.tar.gz
scummvm-rg350-cfacca1a26e233f3054d5b04858316a3c1ae8be7.tar.bz2
scummvm-rg350-cfacca1a26e233f3054d5b04858316a3c1ae8be7.zip
GRAPHICS: Tidy up 4bpp handling a little.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/png.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/graphics/png.cpp b/graphics/png.cpp
index f3a6a287fb..b256c87cf5 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;
}
}