diff options
Diffstat (limited to 'tools/depends/native/TexturePacker/src/decoder/PNGDecoder.cpp')
-rw-r--r-- | tools/depends/native/TexturePacker/src/decoder/PNGDecoder.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tools/depends/native/TexturePacker/src/decoder/PNGDecoder.cpp b/tools/depends/native/TexturePacker/src/decoder/PNGDecoder.cpp index 96ca0b461f..e5ca91b5c6 100644 --- a/tools/depends/native/TexturePacker/src/decoder/PNGDecoder.cpp +++ b/tools/depends/native/TexturePacker/src/decoder/PNGDecoder.cpp @@ -214,7 +214,6 @@ bool PNGDecoder::LoadFile(const std::string &filename, DecodedFrames &frames) // read the png into image_data through row_pointers png_read_image(png_ptr, row_pointers); - frames.user = NULL; DecodedFrame frame; frame.rgbaImage.pixels = (char *)image_data; @@ -222,6 +221,9 @@ bool PNGDecoder::LoadFile(const std::string &filename, DecodedFrames &frames) frame.rgbaImage.width = temp_width; frame.rgbaImage.bbp = 32; frame.rgbaImage.pitch = 4 * temp_width; + + frame.decoder = this; + frames.frameList.push_back(frame); // clean up png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); @@ -229,14 +231,9 @@ bool PNGDecoder::LoadFile(const std::string &filename, DecodedFrames &frames) return true; } -void PNGDecoder::FreeDecodedFrames(DecodedFrames &frames) +void PNGDecoder::FreeDecodedFrame(DecodedFrame &frame) { - for (unsigned int i = 0; i < frames.frameList.size(); i++) - { - delete [] frames.frameList[i].rgbaImage.pixels; - } - - frames.clear(); + delete [] frame.rgbaImage.pixels; } void PNGDecoder::FillSupportedExtensions() |