From b5a996ee217aea486eb78860fe7bab2b522f9678 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Fri, 8 Jan 2010 17:32:24 -0800 Subject: [PATCH] added gfximage_free to gfximage.{c,h} --- lib/gfximage.c | 9 +++++++++ lib/gfximage.h | 1 + lib/readers/swf.c | 9 +-------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/gfximage.c b/lib/gfximage.c index 58f18b3..f1eda7d 100644 --- a/lib/gfximage.c +++ b/lib/gfximage.c @@ -1,3 +1,4 @@ +#include #include #include #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); +} + diff --git a/lib/gfximage.h b/lib/gfximage.h index 161ac4f..6520205 100644 --- a/lib/gfximage.h +++ b/lib/gfximage.h @@ -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 diff --git a/lib/readers/swf.c b/lib/readers/swf.c index 7cb3580..98c340c 100644 --- a/lib/readers/swf.c +++ b/lib/readers/swf.c @@ -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); -- 1.7.10.4