xplanet: ver. bump to 1.3.1
This commit is contained in:
@@ -1,130 +1,55 @@
|
||||
diff -wbBur xplanet-1.3.0/src/libimage/gif.c /home/sergej/tmp/BUILD/staging-i686/sergej/build/xplanet/src/xplanet-1.3.0/src/libimage/gif.c
|
||||
--- xplanet-1.3.0/src/libimage/gif.c 2006-03-26 01:50:51.000000000 +0300
|
||||
+++ /home/sergej/tmp/BUILD/staging-i686/sergej/build/xplanet/src/xplanet-1.3.0/src/libimage/gif.c 2013-07-30 18:21:17.412474692 +0400
|
||||
@@ -20,7 +20,7 @@
|
||||
--- a/src/libimage/gif.c
|
||||
+++ b/src/libimage/gif.c
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
-
|
||||
+#define FALSE 0
|
||||
+#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gif_lib.h>
|
||||
|
||||
/*
|
||||
@@ -42,11 +42,11 @@
|
||||
int color_index;
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
- infile = DGifOpenFileName(filename);
|
||||
+ infile = DGifOpenFileName(filename, NULL);
|
||||
|
||||
if (infile == NULL)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
@@ -179,7 +180,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if GIFLIB_MAJOR >= 5
|
||||
+ if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) {
|
||||
+#else
|
||||
if (DGifCloseFile(GifFile) == GIF_ERROR) {
|
||||
+#endif
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
{
|
||||
if (DGifGetRecordType(infile, &record_type) == GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
@@ -240,7 +245,7 @@
|
||||
* Also non of the parameter are allocated by this routine.
|
||||
* This function returns GIF_OK if succesfull, GIF_ERROR otherwise.
|
||||
******************************************************************************/
|
||||
-static int
|
||||
+int
|
||||
QuantizeBuffer(unsigned int Width,
|
||||
unsigned int Height,
|
||||
int *ColorMapSize,
|
||||
@@ -493,7 +498,11 @@
|
||||
static void QuitGifError(GifFileType *GifFile)
|
||||
{
|
||||
fprintf(stderr, "Error writing GIF file\n");
|
||||
+#if GIFLIB_MAJOR >= 5
|
||||
+ if (GifFile != NULL) EGifCloseFile(GifFile, NULL);
|
||||
+#else
|
||||
if (GifFile != NULL) EGifCloseFile(GifFile);
|
||||
+#endif
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
case IMAGE_DESC_RECORD_TYPE:
|
||||
if (DGifGetImageDesc(infile) == GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -107,14 +107,14 @@
|
||||
GifByteType *ext;
|
||||
if (DGifGetExtension(infile, &ext_code, &ext) == GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
while (ext != NULL)
|
||||
{
|
||||
if (DGifGetExtensionNext(infile, &ext) == GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@
|
||||
return(0);
|
||||
int
|
||||
@@ -589,7 +598,11 @@
|
||||
Ptr += width;
|
||||
}
|
||||
|
||||
- colormap = MakeMapObject(colormap_size, NULL);
|
||||
+ colormap = GifMakeMapObject(colormap_size, NULL);
|
||||
+#if GIFLIB_MAJOR >= 5
|
||||
+ if (EGifCloseFile(GifFile, NULL) == GIF_ERROR)
|
||||
+#else
|
||||
if (EGifCloseFile(GifFile) == GIF_ERROR)
|
||||
+#endif
|
||||
|
||||
for (i = 0; i < width * height; i++)
|
||||
{
|
||||
@@ -187,10 +187,10 @@
|
||||
blue[i] = (GifByteType) rgb[3*i+2];
|
||||
}
|
||||
|
||||
- if (QuantizeBuffer(width, height, &colormap_size, red, green, blue,
|
||||
+ if (GifQuantizeBuffer(width, height, &colormap_size, red, green, blue,
|
||||
buffer, colormap->Colors) == GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -198,24 +198,24 @@
|
||||
free(green);
|
||||
free(blue);
|
||||
|
||||
- outfile = EGifOpenFileName((char *) filename, FALSE);
|
||||
+ outfile = EGifOpenFileName((char *) filename, FALSE, NULL);
|
||||
if (outfile == NULL)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (EGifPutScreenDesc(outfile, width, height, colormap_size, 0, colormap)
|
||||
== GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
|
||||
if (EGifPutImageDesc(outfile, 0, 0, width, height, FALSE, NULL)
|
||||
== GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
{
|
||||
if (EGifPutLine(outfile, ptr, width) == GIF_ERROR)
|
||||
{
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
return(0);
|
||||
}
|
||||
ptr += width;
|
||||
@@ -233,7 +233,7 @@
|
||||
EGifSpew(outfile);
|
||||
|
||||
if (EGifCloseFile(outfile) == GIF_ERROR)
|
||||
- PrintGifError();
|
||||
+ printf("%s\n", GifErrorString(GIF_ERROR));
|
||||
|
||||
free(buffer);
|
||||
|
||||
QuitGifError(GifFile);
|
||||
|
||||
Reference in New Issue
Block a user