aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/native/TexturePacker/src
diff options
context:
space:
mode:
authorRechi <Rechi@users.noreply.github.com>2020-01-19 08:54:37 -0800
committerRechi <Rechi@users.noreply.github.com>2020-01-19 08:54:37 -0800
commit5366c067c4bc1bdd77cc4a9c9ff717a1cabce2ef (patch)
tree206b18eff4dff82d37652fa305f08f3852643226 /tools/depends/native/TexturePacker/src
parent02aca732970c6dbb2462905003af5298d1540125 (diff)
[modernize] use-default-member-init
Diffstat (limited to 'tools/depends/native/TexturePacker/src')
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp46
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/GifHelper.h30
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/IDecoder.h26
3 files changed, 41 insertions, 61 deletions
diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
index fbacf02924..41ca2704a5 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
@@ -30,11 +30,11 @@
class Gifreader
{
public:
- unsigned char* buffer;
- unsigned int buffSize;
- unsigned int readPosition;
+ unsigned char* buffer = nullptr;
+ unsigned int buffSize = 0;
+ unsigned int readPosition = 0;
- Gifreader() : buffer(nullptr), buffSize(0), readPosition(0) {}
+ Gifreader() = default;
};
int ReadFromVfs(GifFileType* gif, GifByteType* gifbyte, int len)
@@ -43,14 +43,7 @@ int ReadFromVfs(GifFileType* gif, GifByteType* gifbyte, int len)
return gifFile->Read(gifbyte, len);
}
-GifHelper::GifHelper() :
- m_imageSize(0),
- m_pitch(0),
- m_loops(0),
- m_numFrames(0),
- m_filename(""),
- m_gif(nullptr),
- m_pTemplate(nullptr)
+GifHelper::GifHelper()
{
m_gifFile = new CFile();
}
@@ -472,27 +465,14 @@ void GifHelper::ClearFrameAreaToTransparency(unsigned char* dest, const GifFrame
}
}
-GifFrame::GifFrame() :
- m_pImage(nullptr),
- m_delay(0),
- m_top(0),
- m_left(0),
- m_disposal(0),
- m_height(0),
- m_width(0),
- m_imageSize(0)
-{}
-
-
-GifFrame::GifFrame(const GifFrame& src) :
- m_pImage(nullptr),
- m_delay(src.m_delay),
- m_top(src.m_top),
- m_left(src.m_left),
- m_disposal(src.m_disposal),
- m_height(src.m_height),
- m_width(src.m_width),
- m_imageSize(src.m_imageSize)
+GifFrame::GifFrame(const GifFrame& src)
+ : m_delay(src.m_delay),
+ m_top(src.m_top),
+ m_left(src.m_left),
+ m_disposal(src.m_disposal),
+ m_height(src.m_height),
+ m_width(src.m_width),
+ m_imageSize(src.m_imageSize)
{
if (src.m_pImage)
{
diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.h b/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
index d35a81cf71..1e897a7e41 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
@@ -60,21 +60,21 @@ class GifFrame
friend class GifHelper;
public:
- GifFrame();
+ GifFrame() = default;
virtual ~GifFrame();
- unsigned char* m_pImage;
- unsigned int m_delay;
+ unsigned char* m_pImage = nullptr;
+ unsigned int m_delay = 0;
private:
GifFrame(const GifFrame& src);
- unsigned int m_top;
- unsigned int m_left;
- unsigned int m_disposal;
- unsigned int m_height;
- unsigned int m_width;
- unsigned int m_imageSize;
+ unsigned int m_top = 0;
+ unsigned int m_left = 0;
+ unsigned int m_disposal = 0;
+ unsigned int m_height = 0;
+ unsigned int m_width = 0;
+ unsigned int m_imageSize = 0;
std::vector<GifColor> m_palette;
};
@@ -101,15 +101,15 @@ public:
private:
std::vector<FramePtr> m_frames;
- unsigned int m_imageSize;
- unsigned int m_pitch;
- unsigned int m_loops;
- unsigned int m_numFrames;
+ unsigned int m_imageSize = 0;
+ unsigned int m_pitch = 0;
+ unsigned int m_loops = 0;
+ unsigned int m_numFrames = 0;
std::string m_filename;
- GifFileType* m_gif;
+ GifFileType* m_gif = nullptr;
std::vector<GifColor> m_globalPalette;
- unsigned char* m_pTemplate;
+ unsigned char* m_pTemplate = nullptr;
CFile* m_gifFile;
unsigned int m_width;
diff --git a/tools/depends/native/TexturePacker/src/decoder/IDecoder.h b/tools/depends/native/TexturePacker/src/decoder/IDecoder.h
index b7fc660392..6e68aba1f1 100644
--- a/tools/depends/native/TexturePacker/src/decoder/IDecoder.h
+++ b/tools/depends/native/TexturePacker/src/decoder/IDecoder.h
@@ -26,30 +26,30 @@
class RGBAImage
{
public:
- RGBAImage() : pixels(NULL), width(0), height(0), bbp(0), pitch(0) {}
+ RGBAImage() = default;
- char *pixels;//image data
- int width;// width
- int height;// height
- int bbp;// bits per pixel
- int pitch;// rowsize in bytes
+ char* pixels = nullptr; // image data
+ int width = 0; // width
+ int height = 0; // height
+ int bbp = 0; // bits per pixel
+ int pitch = 0; // rowsize in bytes
};
class DecodedFrame
{
- public:
- DecodedFrame() : delay(0) { }
- RGBAImage rgbaImage; /* rgbaimage for this frame */
- int delay; /* Frame delay in ms */
+public:
+ DecodedFrame() = default;
+ RGBAImage rgbaImage; /* rgbaimage for this frame */
+ int delay = 0; /* Frame delay in ms */
};
class DecodedFrames
{
public:
- DecodedFrames(): user(NULL), destroyFN(nullptr) {}
+ DecodedFrames() = default;
std::vector<DecodedFrame> frameList;
- void *user; /* used internally*/
- void (*destroyFN)(void *);
+ void* user = nullptr; /* used internally*/
+ void (*destroyFN)(void*) = nullptr;
void clear()
{