diff options
author | Johannes Schickel | 2011-04-25 15:45:05 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-04-25 15:45:05 +0200 |
commit | 33a88e5cacb35e04c947abe38565423544605fcf (patch) | |
tree | 7a905702456bd61fd07e9e590c6f1e9be8d0f299 /graphics | |
parent | aee0fa34bf5ea2ce474a2ae67f7722df4929d4a5 (diff) | |
download | scummvm-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')
-rw-r--r-- | graphics/png.h | 6 |
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; } |