aboutsummaryrefslogtreecommitdiff
path: root/graphics/png.h
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-25 15:45:05 +0200
committerJohannes Schickel2011-04-25 15:45:05 +0200
commit33a88e5cacb35e04c947abe38565423544605fcf (patch)
tree7a905702456bd61fd07e9e590c6f1e9be8d0f299 /graphics/png.h
parentaee0fa34bf5ea2ce474a2ae67f7722df4929d4a5 (diff)
downloadscummvm-rg350-33a88e5cacb35e04c947abe38565423544605fcf.tar.gz
scummvm-rg350-33a88e5cacb35e04c947abe38565423544605fcf.tar.bz2
scummvm-rg350-33a88e5cacb35e04c947abe38565423544605fcf.zip
PNG: This PNG::getPalette.
Formerly the palette parameter was a value copy, which was assigned in getPalette. That did not make much sense, thus I changed it to be a reference. Since I am not quite sure whether this really shouldn't make a palette copy I added an TODO comment about it.
Diffstat (limited to 'graphics/png.h')
-rw-r--r--graphics/png.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/graphics/png.h b/graphics/png.h
index 70f2e4ba27..00c084da8e 100644
--- a/graphics/png.h
+++ b/graphics/png.h
@@ -121,9 +121,13 @@ public:
*
* Note that the palette's format is RGBA.
*/
- void getPalette(byte *palette, uint16 &entries) {
+ void getPalette(byte *&palette, uint16 &entries) {
if (_header.colorType != kIndexed)
error("Palette requested for a non-indexed PNG");
+ // TODO: It might be that this should really return a copy of the
+ // palette, but since the implementation was like this I changed
+ // the palette pointer to be a reference instead of a value copy.
+ // Someone should check this code and verify this is as intended.
palette = _palette;
entries = _paletteEntries;
}