added gfximage_free to gfximage.{c,h}
authorMatthias Kramm <kramm@quiss.org>
Sat, 9 Jan 2010 01:32:24 +0000 (17:32 -0800)
committerMatthias Kramm <kramm@quiss.org>
Sat, 9 Jan 2010 01:32:24 +0000 (17:32 -0800)
lib/gfximage.c
lib/gfximage.h
lib/readers/swf.c

index 58f18b3..f1eda7d 100644 (file)
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include <math.h>
 #include <memory.h>
 #include "jpeg.h"
@@ -340,3 +341,11 @@ gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight)
     image2->height = newheight;
     return image2;
 }
+
+void gfximage_free(gfximage_t*b)
+{
+    free(b->data);
+    b->data = 0;
+    free(b);
+}
+
index 161ac4f..6520205 100644 (file)
@@ -6,5 +6,6 @@
 void gfximage_save_jpeg(gfximage_t*image, const char*filename, int quality);
 void gfximage_save_png(gfximage_t*image, const char*filename);
 gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight);
+void gfximage_free(gfximage_t*b);
 
 #endif
index 7cb3580..98c340c 100644 (file)
@@ -183,7 +183,7 @@ gfxline_t* swfline_to_gfxline(SHAPELINE*line, int linestyle, int fillstyle0)
 
 //---- bitmap handling ----
 
-gfximage_t* gfximage_new(RGBA*data, int width, int height)
+static gfximage_t* gfximage_new(RGBA*data, int width, int height)
 {
     gfximage_t* b = (gfximage_t*)rfx_calloc(sizeof(gfximage_t));
     b->data = (gfxcolor_t*)data;
@@ -192,13 +192,6 @@ gfximage_t* gfximage_new(RGBA*data, int width, int height)
     return b;
 }
 
-void gfximage_free(gfximage_t*b)
-{
-    free(b->data); //!
-    b->data = 0;
-    free(b);
-}
-
 static gfximage_t* findimage(render_t*r, U16 id)
 {
     character_t*c = (character_t*)map16_get_id(r->id2char, id);