aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/native/TexturePacker/src/decoder/IDecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/depends/native/TexturePacker/src/decoder/IDecoder.h')
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/IDecoder.h24
1 files changed, 2 insertions, 22 deletions
diff --git a/tools/depends/native/TexturePacker/src/decoder/IDecoder.h b/tools/depends/native/TexturePacker/src/decoder/IDecoder.h
index c9ac346514..0896cbfac7 100644
--- a/tools/depends/native/TexturePacker/src/decoder/IDecoder.h
+++ b/tools/depends/native/TexturePacker/src/decoder/IDecoder.h
@@ -33,8 +33,7 @@ class IDecoder
public:
virtual ~IDecoder() = default;
virtual bool CanDecode(const std::string &filename) = 0;
- virtual bool LoadFile(const std::string &filename, DecodedFrames &frames) = 0;
- virtual void FreeDecodedFrame(DecodedFrame &frame) = 0;
+ virtual bool LoadFile(const std::string& filename, DecodedFrames& frames) = 0;
virtual const char* GetImageFormatName() = 0;
virtual const char* GetDecoderName() = 0;
@@ -56,7 +55,7 @@ class RGBAImage
public:
RGBAImage() = default;
- char* pixels = nullptr; // image data
+ std::vector<uint8_t> pixels;
int width = 0; // width
int height = 0; // height
int bbp = 0; // bits per pixel
@@ -69,7 +68,6 @@ public:
DecodedFrame() = default;
RGBAImage rgbaImage; /* rgbaimage for this frame */
int delay = 0; /* Frame delay in ms */
- IDecoder* decoder = nullptr; /* Pointer to decoder */
};
class DecodedFrames
@@ -77,22 +75,4 @@ class DecodedFrames
public:
DecodedFrames() = default;
std::vector<DecodedFrame> frameList;
-
- void clear()
- {
- for (auto f : frameList)
- {
- if (f.decoder != NULL)
- {
- f.decoder->FreeDecodedFrame(f);
- }
- else
- {
- fprintf(stderr,
- "ERROR: %s - can not determine decoder type for frame!\n",
- __FUNCTION__);
- }
- }
- frameList.clear();
- }
};