From 46f3c9ea3793d146337c81bf8858d99238c05e86 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 27 Sep 2012 13:46:10 +0100 Subject: Add palette object. Optimise matching colour in case where we chose the palette. In other cases, we still have to seach all the colours, but that doesn't ever seem to be used. --- src/libnsfb.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libnsfb.c') diff --git a/src/libnsfb.c b/src/libnsfb.c index 6f14c99..a341088 100644 --- a/src/libnsfb.c +++ b/src/libnsfb.c @@ -15,6 +15,7 @@ #include "libnsfb_plot.h" #include "libnsfb_event.h" #include "nsfb.h" +#include "palette.h" #include "surface.h" /* exported interface documented in libnsfb.h */ @@ -50,6 +51,10 @@ int nsfb_free(nsfb_t *nsfb) { int ret; + + if (nsfb->palette != NULL) + nsfb_palette_free(nsfb->palette); + ret = nsfb->surface_rtns->finalise(nsfb); free(nsfb); return ret; -- cgit v1.2.3