aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLukas Rusak <lorusak@gmail.com>2023-04-13 10:36:23 -0700
committerLukas Rusak <lorusak@gmail.com>2023-04-23 21:03:15 -0700
commit4779eef75c9d71c40dcc3200a4e7b1f8c9f43117 (patch)
treeef2364b140281854b57e361e692ff02f9fb1179d /tools
parentdee5c55e7d7307f718c7744706f13793f7bcab44 (diff)
TexturePacker: GIFDecoder: pass filename as std::string
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/GIFDecoder.cpp2
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp6
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/GifHelper.h5
3 files changed, 6 insertions, 7 deletions
diff --git a/tools/depends/native/TexturePacker/src/decoder/GIFDecoder.cpp b/tools/depends/native/TexturePacker/src/decoder/GIFDecoder.cpp
index 468bc754d1..f804f3dbea 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GIFDecoder.cpp
+++ b/tools/depends/native/TexturePacker/src/decoder/GIFDecoder.cpp
@@ -36,7 +36,7 @@ bool GIFDecoder::LoadFile(const std::string &filename, DecodedFrames &frames)
bool result = false;
GifHelper gifImage;
- if (gifImage.LoadGif(filename.c_str()))
+ if (gifImage.LoadGif(filename))
{
auto extractedFrames = gifImage.GetFrames();
n = extractedFrames.size();
diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
index 41ca2704a5..29329d94e9 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
@@ -174,7 +174,7 @@ bool GifHelper::LoadGifMetaData(GifFileType* gif)
return true;
}
-bool GifHelper::LoadGifMetaData(const char* file)
+bool GifHelper::LoadGifMetaData(const std::string& file)
{
m_gifFile->Close();
if (!m_gifFile->Open(file) || !Open(m_gif, m_gifFile, ReadFromVfs))
@@ -200,10 +200,10 @@ bool GifHelper::Slurp(GifFileType* gif)
return true;
}
-bool GifHelper::LoadGif(const char* file)
+bool GifHelper::LoadGif(const std::string& file)
{
m_filename = file;
- if (!LoadGifMetaData(m_filename.c_str()))
+ if (!LoadGifMetaData(m_filename))
return false;
try
diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.h b/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
index 1e897a7e41..fff7533ef5 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.h
@@ -90,8 +90,7 @@ public:
GifHelper();
virtual ~GifHelper();
-
- bool LoadGif(const char* file);
+ bool LoadGif(const std::string& file);
std::vector<FramePtr>& GetFrames() { return m_frames; }
unsigned int GetPitch() const { return m_pitch; }
@@ -120,7 +119,7 @@ private:
const char* Reason(int reason);
- bool LoadGifMetaData(const char* file);
+ bool LoadGifMetaData(const std::string& file);
bool Slurp(GifFileType* gif);
void InitTemplateAndColormap();
bool LoadGifMetaData(GifFileType* gif);