aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorArne Morten Kvarving <cptspiff@gmail.com>2015-01-09 14:22:45 +0100
committerwsnipex <wsnipex@a1.net>2015-01-10 11:51:08 +0100
commitba16dfd1a151367e35cd4950add15e276c3e650a (patch)
tree7a00731374966a35383f7c85127ec9d6558cce5d /tools
parent35f5eb82e508446bd1c28381dcd2e676117e4f61 (diff)
fixed: gif support in TexturePacker using giflib4
Diffstat (limited to 'tools')
-rw-r--r--tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
index 19d72c3ea4..53a865281e 100644
--- a/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
+++ b/tools/depends/native/TexturePacker/src/decoder/GifHelper.cpp
@@ -284,9 +284,9 @@ bool GifHelper::gcbToFrame(GifFrame &frame, unsigned int imgIdx)
int transparent = -1;
frame.m_delay = 0;
frame.m_disposal = 0;
+#if GIFLIB_MAJOR >= 5
if (m_gif->ExtensionBlockCount > 0)
{
-#if GIFLIB_MAJOR >= 5
GraphicsControlBlock gcb;
if (!DGifSavedExtensionToGCB(m_gif, imgIdx, &gcb))
{
@@ -301,7 +301,10 @@ bool GifHelper::gcbToFrame(GifFrame &frame, unsigned int imgIdx)
frame.m_delay = gcb.DelayTime * 10;
frame.m_disposal = gcb.DisposalMode;
transparent = gcb.TransparentColor;
+ }
#else
+ if (m_gif->ImageCount > 0)
+ {
ExtensionBlock* extb = m_gif->SavedImages[imgIdx].ExtensionBlocks;
while (extb && extb->Function != GRAPHICS_EXT_FUNC_CODE)
extb++;
@@ -315,8 +318,8 @@ bool GifHelper::gcbToFrame(GifFrame &frame, unsigned int imgIdx)
else
transparent = -1;
}
-#endif
}
+#endif
if (transparent >= 0 && (unsigned)transparent < frame.m_palette.size())
frame.m_palette[transparent].x = 0;