aboutsummaryrefslogtreecommitdiff
path: root/graphics/png.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 16:24:52 +0200
committerJohannes Schickel2011-04-17 16:24:52 +0200
commit39b993fb02749a2a1988f64d3443580f2e1c03ef (patch)
tree582ee5e5230d2445fe8e63ba3fdcce4320cced34 /graphics/png.cpp
parent7ac3ae108a69587693e0820cde43a63c34a186ec (diff)
downloadscummvm-rg350-39b993fb02749a2a1988f64d3443580f2e1c03ef.tar.gz
scummvm-rg350-39b993fb02749a2a1988f64d3443580f2e1c03ef.tar.bz2
scummvm-rg350-39b993fb02749a2a1988f64d3443580f2e1c03ef.zip
GRAPHICS: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
Diffstat (limited to 'graphics/png.cpp')
-rw-r--r--graphics/png.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/graphics/png.cpp b/graphics/png.cpp
index b256c87cf5..19f763272e 100644
--- a/graphics/png.cpp
+++ b/graphics/png.cpp
@@ -112,7 +112,7 @@ PNG::~PNG() {
Graphics::Surface *PNG::getSurface(const PixelFormat &format) {
Graphics::Surface *output = new Graphics::Surface();
- output->create(_unfilteredSurface->w, _unfilteredSurface->h, format.bytesPerPixel);
+ output->create(_unfilteredSurface->w, _unfilteredSurface->h, format);
byte *src = (byte *)_unfilteredSurface->pixels;
byte a = 0xFF;
@@ -388,7 +388,8 @@ void PNG::constructImage() {
delete _unfilteredSurface;
}
_unfilteredSurface = new Graphics::Surface();
- _unfilteredSurface->create(_header.width, _header.height, (getNumColorChannels() * _header.bitDepth + 7) / 8);
+ // TODO/FIXME: It seems we can not properly determine the format here. But maybe there is a way...
+ _unfilteredSurface->create(_header.width, _header.height, PixelFormat((getNumColorChannels() * _header.bitDepth + 7) / 8, 0, 0, 0, 0, 0, 0, 0, 0));
scanLine = new byte[_unfilteredSurface->pitch];
dest = (byte *)_unfilteredSurface->getBasePtr(0, 0);