679 lines
19 KiB
Diff
679 lines
19 KiB
Diff
diff --git a/src/extra/gd/gd.c b/src/extra/gd/gd.c
|
|
index 6296472..dc6a9a7 100644
|
|
--- a/src/extra/gd/gd.c
|
|
+++ b/src/extra/gd/gd.c
|
|
@@ -1995,7 +1995,7 @@ gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX
|
|
else
|
|
{
|
|
/* Find or create the best match */
|
|
- mapTo = gdImageColorResolveAlpha (dst,
|
|
+ nc = gdImageColorResolveAlpha (dst,
|
|
gdTrueColorGetRed (c),
|
|
gdTrueColorGetGreen (c),
|
|
gdTrueColorGetBlue (c),
|
|
diff --git a/src/extra/gd/gd.h b/src/extra/gd/gd.h
|
|
index 619ddd3..8c19354 100644
|
|
--- a/src/extra/gd/gd.h
|
|
+++ b/src/extra/gd/gd.h
|
|
@@ -308,24 +308,6 @@ int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a);
|
|
|
|
void gdImageColorDeallocate(gdImagePtr im, int color);
|
|
|
|
-/* Converts a truecolor image to a palette-based image,
|
|
- using a high-quality two-pass quantization routine
|
|
- which attempts to preserve alpha channel information
|
|
- as well as R/G/B color information when creating
|
|
- a palette. If ditherFlag is set, the image will be
|
|
- dithered to approximate colors better, at the expense
|
|
- of some obvious "speckling." colorsWanted can be
|
|
- anything up to 256. If the original source image
|
|
- includes photographic information or anything that
|
|
- came out of a JPEG, 256 is strongly recommended.
|
|
-
|
|
- Better yet, don't use this function -- write real
|
|
- truecolor PNGs and JPEGs. The disk space gain of
|
|
- conversion to palette is not great (for small images
|
|
- it can be negative) and the quality loss is ugly. */
|
|
-
|
|
-void gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted);
|
|
-
|
|
/* Specifies a color index (if a palette image) or an
|
|
RGB color (if a truecolor image) which should be
|
|
considered 100% transparent. FOR TRUECOLOR IMAGES,
|
|
diff --git a/src/extra/gd/gd_gd2.c b/src/extra/gd/gd_gd2.c
|
|
index 602b869..05d8dcb 100644
|
|
--- a/src/extra/gd/gd_gd2.c
|
|
+++ b/src/extra/gd/gd_gd2.c
|
|
@@ -361,7 +361,7 @@ gdImageCreateFromGd2Ctx (gdIOCtxPtr in)
|
|
xhi = im->sx;
|
|
};
|
|
/*GD2_DBG(printf("y=%d: ",y)); */
|
|
- if (fmt == GD2_FMT_RAW)
|
|
+ if (fmt != GD2_FMT_COMPRESSED)
|
|
{
|
|
for (x = xlo; x < xhi; x++)
|
|
{
|
|
@@ -617,7 +617,7 @@ gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w, int h)
|
|
|
|
for (x = xlo; x < xhi; x++)
|
|
{
|
|
- if (fmt == GD2_FMT_RAW)
|
|
+ if (fmt != GD2_FMT_COMPRESSED)
|
|
{
|
|
if (im->trueColor)
|
|
{
|
|
diff --git a/src/extra/gd/gd_png.c b/src/extra/gd/gd_png.c
|
|
index b37fc2c..c7f3aa0 100644
|
|
--- a/src/extra/gd/gd_png.c
|
|
+++ b/src/extra/gd/gd_png.c
|
|
@@ -131,7 +131,6 @@ gdImageCreateFromPngCtx (gdIOCtx * infile)
|
|
gdImagePtr im = NULL;
|
|
int i, j, *open;
|
|
volatile int transparent = -1;
|
|
- volatile int palette_allocated = FALSE;
|
|
|
|
/* Make sure the signature can't match by dumb luck -- TBB */
|
|
memset (sig, 0, sizeof (sig));
|
|
@@ -177,6 +176,7 @@ gdImageCreateFromPngCtx (gdIOCtx * infile)
|
|
}
|
|
#endif
|
|
open = NULL;
|
|
+ palette = NULL;
|
|
|
|
png_set_sig_bytes (png_ptr, 8); /* we already read the 8 signature bytes */
|
|
|
|
@@ -254,7 +254,6 @@ gdImageCreateFromPngCtx (gdIOCtx * infile)
|
|
gdImageDestroy(im);
|
|
return NULL;
|
|
}
|
|
- palette_allocated = TRUE;
|
|
if (bit_depth < 8)
|
|
{
|
|
num_palette = 1 << bit_depth;
|
|
@@ -321,8 +320,7 @@ gdImageCreateFromPngCtx (gdIOCtx * infile)
|
|
fprintf (stderr, "gd-png error: cannot allocate image data\n");
|
|
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
|
|
gdImageDestroy(im);
|
|
- if (palette_allocated)
|
|
- gdFree (palette);
|
|
+ gdFree(palette);
|
|
return NULL;
|
|
}
|
|
if ((row_pointers = (png_bytepp) gdMalloc (height * sizeof (png_bytep))) == NULL)
|
|
@@ -331,8 +329,7 @@ gdImageCreateFromPngCtx (gdIOCtx * infile)
|
|
png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
|
|
gdFree (image_data);
|
|
gdImageDestroy(im);
|
|
- if (palette_allocated)
|
|
- gdFree (palette);
|
|
+ gdFree(palette);
|
|
return NULL;
|
|
}
|
|
|
|
@@ -429,8 +426,7 @@ gdImageCreateFromPngCtx (gdIOCtx * infile)
|
|
}
|
|
#endif
|
|
|
|
- if (palette_allocated)
|
|
- gdFree (palette);
|
|
+ gdFree (palette);
|
|
gdFree (image_data);
|
|
gdFree (row_pointers);
|
|
|
|
diff --git a/src/extra/gd/gd_topal.c b/src/extra/gd/gd_topal.c
|
|
index 4ca86c9..69ca4d1 100644
|
|
--- a/src/extra/gd/gd_topal.c
|
|
+++ b/src/extra/gd/gd_topal.c
|
|
@@ -1031,7 +1031,6 @@ find_best_colors (gdImagePtr im,
|
|
inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0;
|
|
inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1;
|
|
inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2;
|
|
- inc3 = inc3 * (2 * STEP_C3) + STEP_C3 * STEP_C3;
|
|
/* Now loop over all cells in box, updating distance per Thomas method */
|
|
bptr = bestdist;
|
|
cptr = bestcolor;
|
|
@@ -1499,200 +1498,3 @@ zeroHistogram (hist4d histogram)
|
|
}
|
|
}
|
|
}
|
|
-
|
|
-/* Here we go at last. */
|
|
-void
|
|
-gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
|
|
-{
|
|
- my_cquantize_ptr cquantize = 0;
|
|
- int i;
|
|
- size_t arraysize;
|
|
- if (!im->trueColor)
|
|
- {
|
|
- /* Nothing to do! */
|
|
- return;
|
|
- }
|
|
- if (colorsWanted > gdMaxColors)
|
|
- {
|
|
- colorsWanted = gdMaxColors;
|
|
- }
|
|
- im->pixels = gdCalloc (sizeof (unsigned char *), im->sy);
|
|
- if (!im->pixels)
|
|
- {
|
|
- /* No can do */
|
|
- goto outOfMemory;
|
|
- }
|
|
- for (i = 0; (i < im->sy); i++)
|
|
- {
|
|
- im->pixels[i] = (unsigned char *) gdCalloc (sizeof (unsigned char), im->sx);
|
|
- if (!im->pixels[i])
|
|
- {
|
|
- goto outOfMemory;
|
|
- }
|
|
- }
|
|
- cquantize = (my_cquantize_ptr) gdCalloc (sizeof (my_cquantizer), 1);
|
|
- if (!cquantize)
|
|
- {
|
|
- /* No can do */
|
|
- goto outOfMemory;
|
|
- }
|
|
- /* Allocate the histogram/inverse colormap storage */
|
|
- cquantize->histogram = (hist4d) gdMalloc (HIST_C0_ELEMS * sizeof (hist3d));
|
|
- for (i = 0; i < HIST_C0_ELEMS; i++)
|
|
- {
|
|
- int j;
|
|
- cquantize->histogram[i] = (hist3d) gdCalloc (HIST_C1_ELEMS,
|
|
- sizeof (hist2d));
|
|
- if (!cquantize->histogram[i])
|
|
- {
|
|
- goto outOfMemory;
|
|
- }
|
|
- for (j = 0; (j < HIST_C1_ELEMS); j++)
|
|
- {
|
|
- cquantize->histogram[i][j] = (hist2d) gdCalloc (HIST_C2_ELEMS * HIST_C3_ELEMS,
|
|
- sizeof (histcell));
|
|
- if (!cquantize->histogram[i][j])
|
|
- {
|
|
- goto outOfMemory;
|
|
- }
|
|
- }
|
|
- }
|
|
- cquantize->fserrors = (FSERRPTR) gdMalloc (4 * sizeof (FSERROR));
|
|
- init_error_limit (cquantize);
|
|
- arraysize = (size_t) ((im->sx + 2) *
|
|
- (4 * sizeof (FSERROR)));
|
|
- /* Allocate Floyd-Steinberg workspace. */
|
|
- cquantize->fserrors = gdCalloc (arraysize, 1);
|
|
- if (!cquantize->fserrors)
|
|
- {
|
|
- goto outOfMemory;
|
|
- }
|
|
- cquantize->on_odd_row = FALSE;
|
|
-
|
|
- /* Do the work! */
|
|
- zeroHistogram (cquantize->histogram);
|
|
- prescan_quantize (im, cquantize);
|
|
- select_colors (im, cquantize, 256);
|
|
- /* TBB HACK REMOVE */
|
|
- {
|
|
- FILE *out = fopen ("palettemap.png", "wb");
|
|
- int i;
|
|
- gdImagePtr im2 = gdImageCreateTrueColor (256, 256);
|
|
- for (i = 0; (i < 256); i++)
|
|
- {
|
|
- gdImageFilledRectangle (im2, (i % 16) * 16, (i / 16) * 16,
|
|
- (i % 16) * 16 + 15, (i / 16) * 16 + 15,
|
|
- gdTrueColorAlpha (im->red[i], im->green[i],
|
|
- im->blue[i], im->alpha[i]));
|
|
- }
|
|
- gdImagePng (im2, out);
|
|
- fclose (out);
|
|
- gdImageDestroy (im2);
|
|
- }
|
|
- zeroHistogram (cquantize->histogram);
|
|
- if (dither)
|
|
- {
|
|
- pass2_fs_dither (im, cquantize);
|
|
- }
|
|
- else
|
|
- {
|
|
- pass2_no_dither (im, cquantize);
|
|
- }
|
|
- if (cquantize->transparentIsPresent)
|
|
- {
|
|
- int mt = -1;
|
|
- for (i = 0; (i < im->colorsTotal); i++)
|
|
- {
|
|
- if (im->alpha[i] > mt)
|
|
- {
|
|
- mt = im->alpha[i];
|
|
- }
|
|
- }
|
|
- for (i = 0; (i < im->colorsTotal); i++)
|
|
- {
|
|
- if (im->alpha[i] == mt)
|
|
- {
|
|
- im->alpha[i] = gdAlphaTransparent;
|
|
- }
|
|
- }
|
|
- }
|
|
- if (cquantize->opaqueIsPresent)
|
|
- {
|
|
- int mo = 128;
|
|
- int moIndex = -1;
|
|
- for (i = 0; (i < im->colorsTotal); i++)
|
|
- {
|
|
- if (im->alpha[i] < mo)
|
|
- {
|
|
- moIndex = i;
|
|
- mo = im->alpha[i];
|
|
- }
|
|
- }
|
|
- for (i = 0; (i < im->colorsTotal); i++)
|
|
- {
|
|
- if (im->alpha[i] == mo)
|
|
- {
|
|
- im->alpha[i] = gdAlphaOpaque;
|
|
- }
|
|
- }
|
|
- }
|
|
- /* Success! Get rid of the truecolor image data. */
|
|
- im->trueColor = 0;
|
|
- /* Junk the truecolor pixels */
|
|
- for (i = 0; i < im->sy; i++)
|
|
- {
|
|
- gdFree (im->tpixels[i]);
|
|
- }
|
|
- gdFree (im->tpixels);
|
|
- im->tpixels = 0;
|
|
- /* Tediously free stuff. */
|
|
-outOfMemory:
|
|
- if (im->trueColor)
|
|
- {
|
|
- if (im->pixels)
|
|
- {
|
|
- /* On failure only */
|
|
- for (i = 0; i < im->sy; i++)
|
|
- {
|
|
- if (im->pixels[i])
|
|
- {
|
|
- gdFree (im->pixels[i]);
|
|
- }
|
|
- }
|
|
- gdFree (im->pixels);
|
|
- }
|
|
- im->pixels = 0;
|
|
- }
|
|
-
|
|
- if (!cquantize)
|
|
- return;
|
|
-
|
|
- for (i = 0; i < HIST_C0_ELEMS; i++)
|
|
- {
|
|
- if (cquantize->histogram[i])
|
|
- {
|
|
- int j;
|
|
- for (j = 0; j < HIST_C1_ELEMS; j++)
|
|
- {
|
|
- if (cquantize->histogram[i][j])
|
|
- {
|
|
- gdFree (cquantize->histogram[i][j]);
|
|
- }
|
|
- }
|
|
- gdFree (cquantize->histogram[i]);
|
|
- }
|
|
- }
|
|
- if (cquantize->histogram)
|
|
- {
|
|
- gdFree (cquantize->histogram);
|
|
- }
|
|
- if (cquantize->fserrors)
|
|
- {
|
|
- gdFree (cquantize->fserrors);
|
|
- }
|
|
- if (cquantize->error_limiter_storage)
|
|
- {
|
|
- gdFree (cquantize->error_limiter_storage);
|
|
- }
|
|
- gdFree (cquantize);
|
|
-}
|
|
diff --git a/src/extra/gd/gd_wbmp.c b/src/extra/gd/gd_wbmp.c
|
|
index 5281337..f1258da 100644
|
|
--- a/src/extra/gd/gd_wbmp.c
|
|
+++ b/src/extra/gd/gd_wbmp.c
|
|
@@ -105,7 +105,10 @@ gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out)
|
|
|
|
/* create the WBMP */
|
|
if ((wbmp = createwbmp (gdImageSX (image), gdImageSY (image), WBMP_WHITE)) == NULL)
|
|
- fprintf (stderr, "Could not create WBMP\n");
|
|
+ {
|
|
+ fprintf (stderr, "Could not create WBMP\n");
|
|
+ return;
|
|
+ }
|
|
|
|
/* fill up the WBMP structure */
|
|
pos = 0;
|
|
diff --git a/src/extra/gd/gdcache.c b/src/extra/gd/gdcache.c
|
|
index e4770f5..ff65b97 100644
|
|
--- a/src/extra/gd/gdcache.c
|
|
+++ b/src/extra/gd/gdcache.c
|
|
@@ -1,5 +1,6 @@
|
|
#include "gd.h"
|
|
#include "gdhelpers.h"
|
|
+#include <assert.h>
|
|
|
|
#ifdef HAVE_LIBTTF
|
|
#define NEED_CACHE 1
|
|
@@ -130,7 +131,9 @@ gdCacheGet (gdCache_head_t * head, void *keydata)
|
|
else
|
|
{ /* cache full - replace least-recently-used */
|
|
/* preveprev becomes new end of list */
|
|
- prevprev->next = NULL;
|
|
+ assert (prevprev);
|
|
+ if (prevprev)
|
|
+ prevprev->next = NULL;
|
|
elem = prev;
|
|
(*(head->gdCacheRelease)) (elem->userdata);
|
|
}
|
|
diff --git a/src/extra/gd/gdft.c b/src/extra/gd/gdft.c
|
|
index b1e9414..422e1ae 100644
|
|
--- a/src/extra/gd/gdft.c
|
|
+++ b/src/extra/gd/gdft.c
|
|
@@ -636,6 +636,7 @@ gdft_draw_bitmap (gdImage * im, int fg, FT_Bitmap bitmap, int pen_x, int pen_y)
|
|
}
|
|
tc_elem = (tweencolor_t *) gdCacheGet (
|
|
tc_cache, &tc_key);
|
|
+ if (!tc_elem) return tc_cache->error;
|
|
if (im->trueColor)
|
|
{
|
|
*tpixel = tc_elem->tweencolor;
|
|
diff --git a/src/extra/gd/testac.c b/src/extra/gd/testac.c
|
|
index 55a5434..47d466d 100644
|
|
--- a/src/extra/gd/testac.c
|
|
+++ b/src/extra/gd/testac.c
|
|
@@ -115,13 +115,6 @@ testDrawing (
|
|
Otherwise the file would typically be slightly larger. */
|
|
gdImageSaveAlpha (im_out, !blending);
|
|
|
|
- /* If requested, convert from truecolor to palette. */
|
|
- if (palette)
|
|
- {
|
|
- /* Dithering, 256 colors. */
|
|
- gdImageTrueColorToPalette (im_out, 1, 256);
|
|
- }
|
|
-
|
|
gdImagePng (im_out, out);
|
|
fclose (out);
|
|
|
|
diff --git a/src/extra/trio/strio.c b/src/extra/trio/strio.c
|
|
index 0e7196c..c6796af 100644
|
|
--- a/src/extra/trio/strio.c
|
|
+++ b/src/extra/trio/strio.c
|
|
@@ -20,8 +20,6 @@
|
|
* - StrToLongDouble
|
|
*/
|
|
|
|
-static const char rcsid[] = "@(#)$Id: strio.c,v 1.1 2001/06/07 08:23:02 fjfranklin Exp $";
|
|
-
|
|
#if defined(unix) || defined(__xlC__)
|
|
# define PLATFORM_UNIX
|
|
#elif defined(WIN32) || defined(_WIN32)
|
|
diff --git a/src/extra/trio/trio.c b/src/extra/trio/trio.c
|
|
index 83a2ce9..930e210 100644
|
|
--- a/src/extra/trio/trio.c
|
|
+++ b/src/extra/trio/trio.c
|
|
@@ -41,8 +41,6 @@
|
|
* immediately followed by an 's'.
|
|
*/
|
|
|
|
-static const char rcsid[] = "@(#)$Id: trio.c,v 1.1 2001/06/07 08:23:02 fjfranklin Exp $";
|
|
-
|
|
#if defined(unix) || defined(__xlC__) /* AIX xlC workaround */
|
|
# define PLATFORM_UNIX
|
|
#elif defined(AMIGA) && defined(__GNUC__)
|
|
diff --git a/src/font.c b/src/font.c
|
|
index b3927c9..6b88499 100644
|
|
--- a/src/font.c
|
|
+++ b/src/font.c
|
|
@@ -535,6 +535,8 @@ static void ipa_font_add_api (wmfAPI* API,char* name)
|
|
float wmf_ipa_font_stringwidth (wmfAPI* API,wmfFont* font,char* str)
|
|
{ FT_Face face = WMF_FONT_FTFACE (font);
|
|
|
|
+ if (!face) return 0.0;
|
|
+
|
|
FT_Vector delta;
|
|
|
|
FT_Bool use_kerning;
|
|
@@ -592,6 +594,8 @@ float wmf_ipa_font_stringwidth (wmfAPI* API,wmfFont* font,char* str)
|
|
static float ipa_char_position (wmfFont* font,char* str,char* last)
|
|
{ FT_Face face = WMF_FONT_FTFACE (font);
|
|
|
|
+ if (!face) return 0.0;
|
|
+
|
|
FT_Vector delta;
|
|
|
|
FT_Bool use_kerning;
|
|
@@ -1218,14 +1222,19 @@ static char* ipa_font_gs_readline (wmfAPI* API,FILE* in)
|
|
line = more;
|
|
|
|
if (line == 0)
|
|
- { fContinue = wmf_false;
|
|
+ {
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (line == 0) return (0);
|
|
|
|
- if (fReadExtra) while (buf[strlen(buf)-1] != '\n') fgets (buf,128,in);
|
|
+ if (fReadExtra)
|
|
+ {
|
|
+ while (buf[strlen(buf)-1] != '\n')
|
|
+ if (fgets (buf,128,in) == 0)
|
|
+ break;
|
|
+ }
|
|
|
|
/* Strip the string */
|
|
|
|
diff --git a/src/ipa/ipa/bmp.h b/src/ipa/ipa/bmp.h
|
|
index 568d26e..94a1a17 100644
|
|
--- a/src/ipa/ipa/bmp.h
|
|
+++ b/src/ipa/ipa/bmp.h
|
|
@@ -947,8 +947,8 @@ static int DecodeImage (wmfBMP* bmp,BMPSource* src,unsigned int compression,unsi
|
|
}
|
|
/* ?? TODO if (QuantumTick (y,image->rows)) MagickMonitor (LoadImageText,y,image->rows); */
|
|
}
|
|
- byte = ReadBlobByte (src); /* end of line */
|
|
- byte = ReadBlobByte (src);
|
|
+ ReadBlobByte (src); /* end of line */
|
|
+ ReadBlobByte (src);
|
|
|
|
return 1;
|
|
}
|
|
diff --git a/src/ipa/svg.c b/src/ipa/svg.c
|
|
index 0692296..9c4adf7 100644
|
|
--- a/src/ipa/svg.c
|
|
+++ b/src/ipa/svg.c
|
|
@@ -156,7 +156,6 @@ static void wmf_svg_draw_text (wmfAPI* API,wmfDrawText_t* draw_text)
|
|
svgPoint pt;
|
|
|
|
float font_height;
|
|
- float font_ratio;
|
|
|
|
float sin_theta;
|
|
float cos_theta;
|
|
@@ -172,8 +171,6 @@ static void wmf_svg_draw_text (wmfAPI* API,wmfDrawText_t* draw_text)
|
|
pt = svg_translate (API,draw_text->pt);
|
|
|
|
font_height = svg_height (API,(float) draw_text->font_height);
|
|
- font_ratio = svg_width (API,(float) (draw_text->font_height * draw_text->font_ratio));
|
|
- font_ratio /= font_height;
|
|
|
|
theta = - WMF_TEXT_ANGLE (draw_text->dc->font);
|
|
|
|
diff --git a/src/ipa/xgd/font.h b/src/ipa/xgd/font.h
|
|
index 79b5d87..5b15e57 100644
|
|
--- a/src/ipa/xgd/font.h
|
|
+++ b/src/ipa/xgd/font.h
|
|
@@ -157,10 +157,6 @@ static void gd_draw_ftbitmap (wmfAPI* API,FT_Bitmap* bitmap,gdPoint pt,wmfRGB* f
|
|
|
|
fg_pixel = gdImageColorResolve (gd->image,fg->r,fg->g,fg->b);
|
|
|
|
- if (bitmap->pixel_mode == ft_pixel_mode_mono)
|
|
- { color = fg_pixel;
|
|
- }
|
|
-
|
|
for (row = 0; row < rows; row++)
|
|
{ buffer = bitmap->buffer + row * bitmap->pitch;
|
|
|
|
diff --git a/src/meta.c b/src/meta.c
|
|
index cf046a5..ea14f94 100644
|
|
--- a/src/meta.c
|
|
+++ b/src/meta.c
|
|
@@ -441,7 +441,6 @@ static void write_b64 (wmfAPI * API, const unsigned char * buffer, unsigned long
|
|
b32 = (b32 << 16);
|
|
*ptr++ = B64[(b32 >> 18) ];
|
|
*ptr++ = B64[(b32 >> 12) & 0x3f];
|
|
- remaining -= 1;
|
|
}
|
|
|
|
*ptr++ = '\n';
|
|
diff --git a/src/player.c b/src/player.c
|
|
index 9b66eb7..813a2bf 100644
|
|
--- a/src/player.c
|
|
+++ b/src/player.c
|
|
@@ -554,7 +554,7 @@ static wmf_error_t WmfPlayMetaFile (wmfAPI* API)
|
|
|
|
case META_SETVIEWPORTORG:
|
|
SCAN_DIAGNOSTIC (API,"New Record: SETVIEWPORTORG");
|
|
- changed = meta_orgext (API,&Record);
|
|
+ meta_orgext (API,&Record);
|
|
if (SCAN (API)) wmf_write (API, Size, Function, "setviewportorg",
|
|
atts->atts, Record.parameter, Record.size * 2);
|
|
SCAN_DIAGNOSTIC (API,"\n");
|
|
diff --git a/src/player/meta.h b/src/player/meta.h
|
|
index d656dfd..b9762e3 100644
|
|
--- a/src/player/meta.h
|
|
+++ b/src/player/meta.h
|
|
@@ -412,16 +412,12 @@ static int meta_arc (wmfAPI* API,wmfRecord* Record)
|
|
d_pt.y = c_pt.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
/* fallthrough */
|
|
+ default:
|
|
case '2':
|
|
d_pt.x = c_pt.x;
|
|
d_pt.y = drawarc.TL.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
break;
|
|
-
|
|
- default:
|
|
- WMF_ERROR (API,"Glitch!");
|
|
- API->err = wmf_E_Glitch;
|
|
- break;
|
|
}
|
|
break;
|
|
|
|
@@ -445,16 +441,12 @@ static int meta_arc (wmfAPI* API,wmfRecord* Record)
|
|
d_pt.y = drawarc.BR.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
/* fallthrough */
|
|
+ default:
|
|
case '3':
|
|
d_pt.x = drawarc.TL.x;
|
|
d_pt.y = c_pt.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
break;
|
|
-
|
|
- default:
|
|
- WMF_ERROR (API,"Glitch!");
|
|
- API->err = wmf_E_Glitch;
|
|
- break;
|
|
}
|
|
break;
|
|
|
|
@@ -478,20 +470,17 @@ static int meta_arc (wmfAPI* API,wmfRecord* Record)
|
|
d_pt.y = c_pt.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
/* fallthrough */
|
|
+ default:
|
|
case '4':
|
|
d_pt.x = c_pt.x;
|
|
d_pt.y = drawarc.BR.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
break;
|
|
-
|
|
- default:
|
|
- WMF_ERROR (API,"Glitch!");
|
|
- API->err = wmf_E_Glitch;
|
|
- break;
|
|
}
|
|
break;
|
|
|
|
case '4':
|
|
+ default:
|
|
switch (Qe)
|
|
{
|
|
case '4':
|
|
@@ -511,23 +500,14 @@ static int meta_arc (wmfAPI* API,wmfRecord* Record)
|
|
d_pt.y = drawarc.TL.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
/* fallthrough */
|
|
+ default:
|
|
case '1':
|
|
d_pt.x = drawarc.BR.x;
|
|
d_pt.y = c_pt.y;
|
|
D_Coord_Register (API,d_pt,scope);
|
|
break;
|
|
-
|
|
- default:
|
|
- WMF_ERROR (API,"Glitch!");
|
|
- API->err = wmf_E_Glitch;
|
|
- break;
|
|
}
|
|
break;
|
|
-
|
|
- default:
|
|
- WMF_ERROR (API,"Glitch!");
|
|
- API->err = wmf_E_Glitch;
|
|
- break;
|
|
}
|
|
|
|
return (changed);
|
|
@@ -2428,7 +2408,7 @@ static int meta_dc_color (wmfAPI* API,wmfRecord* Record,wmfAttributes* attrlist)
|
|
hash[5] = hex[(color.b >> 4) & 0x0f];
|
|
hash[6] = hex[ color.b & 0x0f];
|
|
hash[7] = 0;
|
|
- value = wmf_attr_add (API, attrlist, "color", hash);
|
|
+ wmf_attr_add (API, attrlist, "color", hash);
|
|
}
|
|
|
|
if (SCAN (API)) wmf_ipa_color_add (API,&color);
|
|
@@ -3152,7 +3132,7 @@ static int meta_pen_create (wmfAPI* API,wmfRecord* Record,wmfAttributes* attrlis
|
|
hash[5] = hex[(color.b >> 4) & 0x0f];
|
|
hash[6] = hex[ color.b & 0x0f];
|
|
hash[7] = 0;
|
|
- value = wmf_attr_add (API, attrlist, "color", hash);
|
|
+ wmf_attr_add (API, attrlist, "color", hash);
|
|
}
|
|
|
|
WMF_PEN_SET_COLOR (pen,&color);
|
|
@@ -3254,7 +3234,7 @@ static int meta_brush_create (wmfAPI* API,wmfRecord* Record,wmfAttributes* attrl
|
|
hash[5] = hex[(color.b >> 4) & 0x0f];
|
|
hash[6] = hex[ color.b & 0x0f];
|
|
hash[7] = 0;
|
|
- value = wmf_attr_add (API, attrlist, "color", hash);
|
|
+ wmf_attr_add (API, attrlist, "color", hash);
|
|
}
|
|
|
|
WMF_BRUSH_SET_COLOR (brush,&color);
|
|
diff --git a/src/recorder.c b/src/recorder.c
|
|
index b5e6431..ff371a7 100644
|
|
--- a/src/recorder.c
|
|
+++ b/src/recorder.c
|
|
@@ -48,6 +48,9 @@ static void s_rbox_set (wmfAPI * API, wmfConstruct * construct,
|
|
{
|
|
WMF_ERROR (API, "Hmm. Record out of range...");
|
|
API->err = wmf_E_Glitch;
|
|
+ rbox->start = NULL;
|
|
+ rbox->end = NULL;
|
|
+ rbox->ptr = NULL;
|
|
return;
|
|
}
|
|
rbox->start = construct->buffer + construct->rec_offset[n ];
|