namespace gfx::bitmaps;
-#define bool _bool
-#include "gif_lib.h"
-#undef bool
-
import "Display"
+#if !defined(__EMSCRIPTEN__)
+
+#include "gif_lib.h"
+
static int ReadData(GifFileType * gifFile, GifByteType * bytes, int size)
{
File f = gifFile->UserData;
return f.Read(bytes, 1, size);
}
-static int WriteData(GifFileType * gifFile, GifByteType * bytes, int size)
+/*static int WriteData(GifFileType * gifFile, GifByteType * bytes, int size)
{
- // File f = gifFile->UserData;
- // f.Write(bytes, 1, size);
+ File f = gifFile->UserData;
+ return f.Write(bytes, 1, size);
}
-
-static char * extensions[] = { "gif", null };
+*/
+static const char * extensions[] = { "gif", null };
class GIFFormat : BitmapFormat
{
{
bool result = false;
-#if GIFLIB_MAJOR > 5
+#if (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1))
GifFileType * gifFile = DGifOpen(f, ReadData, null);
#else
GifFileType * gifFile = DGifOpen(f, ReadData);
result = true;
}
}
+#if (GIFLIB_MAJOR > 5 || (GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1))
+ DGifCloseFile(gifFile, null);
+#else
DGifCloseFile(gifFile);
+#endif
}
if(!result)
return result;
}
- bool Save(Bitmap bitmap, char * filename, void * options)
+ bool Save(Bitmap bitmap, const char * filename, void * options)
{
bool result = false;
return result;
}
- ColorAlpha * LoadPalette(char * fileName, char * type)
+ ColorAlpha * LoadPalette(const char * fileName, const char * type)
{
ColorAlpha * result = null;
return result;
}
}
+
+#endif // !defined(__EMSCRIPTEN__)