aboutsummaryrefslogtreecommitdiff
path: root/image/png.h
diff options
context:
space:
mode:
authorPaul Gilbert2019-08-01 22:00:29 -0700
committerPaul Gilbert2019-08-01 22:05:40 -0700
commit8a8ac63636850e18043fb5314c570b672eba2d6e (patch)
tree13f87e7ed0c25762a431a143d9e8c3ec9e4a8acf /image/png.h
parentd680b0b02983350c16e106c50aea152eefc6b585 (diff)
downloadscummvm-rg350-8a8ac63636850e18043fb5314c570b672eba2d6e.tar.gz
scummvm-rg350-8a8ac63636850e18043fb5314c570b672eba2d6e.tar.bz2
scummvm-rg350-8a8ac63636850e18043fb5314c570b672eba2d6e.zip
IMAGE: Add a paletted transparency mode flag to PNGDecoder
Previously, the PNGDecoder would always convert images that have a palette with a transparent color(s) to a full RGBA surface automatically. There needed to be a way to diable this and keep the image paletted for the Glk engine, since some Infocom V6 game Blorb files reuse the palettes from previous images, so I couldn't have the decoder using the dummy palette that comes with the image
Diffstat (limited to 'image/png.h')
-rw-r--r--image/png.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/image/png.h b/image/png.h
index adbc6d7a68..f983da467e 100644
--- a/image/png.h
+++ b/image/png.h
@@ -57,8 +57,9 @@ public:
const Graphics::Surface *getSurface() const { return _outputSurface; }
const byte *getPalette() const { return _palette; }
uint16 getPaletteColorCount() const { return _paletteColorCount; }
+ int getTransparentColor() const { return _transparentColor; }
void setSkipSignature(bool skip) { _skipSignature = skip; }
-
+ void setKeepTransparencyPaletted(bool keep) { _keepTransparencyPaletted = keep; }
private:
Graphics::PixelFormat getByteOrderRgbaPixelFormat() const;
@@ -68,6 +69,10 @@ private:
// flag to skip the png signature check for headless png files
bool _skipSignature;
+ // Flag to keep paletted images paletted, even when the image has transparency
+ bool _keepTransparencyPaletted;
+ int _transparentColor;
+
Graphics::Surface *_outputSurface;
};