[Scummvm-cvs-logs] scummvm master -> 8305f9c2a0e3de16a0e39fc8af65ef71decff092
fuzzie
fuzzie at fuzzie.org
Thu Apr 14 21:10:28 CEST 2011
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c60e773981 GRAPHICS: Handle 4bpp paletted PNG files.
8305f9c2a0 SWORD25: Simplify text rendering code slightly.
Commit: c60e773981be82ae0be2c649e9a079da4dae26a9
https://github.com/scummvm/scummvm/commit/c60e773981be82ae0be2c649e9a079da4dae26a9
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-04-14T12:08:03-07:00
Commit Message:
GRAPHICS: Handle 4bpp paletted PNG files.
Changed paths:
graphics/png.cpp
diff --git a/graphics/png.cpp b/graphics/png.cpp
index 96dc083..f3a6a28 100644
--- a/graphics/png.cpp
+++ b/graphics/png.cpp
@@ -170,11 +170,18 @@ 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++) {
for (uint16 j = 0; j < output->w; j++) {
- index = *src;
+ if (_header.bitDepth != 4)
+ index = *src;
+ else if (!otherPixel)
+ index = (*src) >> 4;
+ else
+ index = (*src) & 0xf;
+
r = _palette[index * 4 + 0];
g = _palette[index * 4 + 1];
b = _palette[index * 4 + 2];
@@ -185,8 +192,12 @@ Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
else
*((uint32 *)output->getBasePtr(j, i)) = format.ARGBToColor(a, r, g, b);
- src++;
+ if (_header.bitDepth != 4 || otherPixel)
+ src++;
+ otherPixel = !otherPixel;
}
+ if (_header.bitDepth == 4)
+ src += output->w/2;
}
}
Commit: 8305f9c2a0e3de16a0e39fc8af65ef71decff092
https://github.com/scummvm/scummvm/commit/8305f9c2a0e3de16a0e39fc8af65ef71decff092
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-04-14T12:08:52-07:00
Commit Message:
SWORD25: Simplify text rendering code slightly.
Changed paths:
engines/sword25/gfx/text.cpp
diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index bbfc380..b1c1708 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -173,10 +173,8 @@ bool Text::doRender() {
Common::Rect curRect = fontPtr->getCharacterRect((byte)(*iter).text[i]);
Common::Rect renderRect(curX, curY, curX + curRect.width(), curY + curRect.height());
- int renderX = curX + (renderRect.left - renderRect.left);
- int renderY = curY + (renderRect.top - renderRect.top);
renderRect.translate(curRect.left - curX, curRect.top - curY);
- result = charMapPtr->blit(renderX, renderY, Image::FLIP_NONE, &renderRect, _modulationColor);
+ result = charMapPtr->blit(curX, curY, Image::FLIP_NONE, &renderRect, _modulationColor);
if (!result)
break;
More information about the Scummvm-git-logs
mailing list