[image] Allow color conversion caches to be cleaned up

More leaks, but only ruamoko takes advantage of it so far.
This commit is contained in:
Bill Currie 2023-03-05 17:14:25 +09:00
parent 3f9873a754
commit 3e30b7b9e2
3 changed files with 9 additions and 0 deletions

View file

@ -66,6 +66,7 @@ typedef struct colcache_s colcache_t;
colcache_t *ColorCache_New (void);
void ColorCache_Delete (colcache_t *cache);
void ColorCache_Shutdown (void);
byte ConvertColor (const byte *rgb, const byte *pal, colcache_t *cache);
tex_t *ConvertImage (const tex_t *tex, const byte *pal);

View file

@ -105,6 +105,13 @@ ColorCache_Delete (colcache_t *cache)
FREE (colcache, cache);
}
void
ColorCache_Shutdown (void)
{
ALLOC_FREE_BLOCKS (colcache);
ALLOC_FREE_BLOCKS (colcache_color);
}
byte
ConvertColor (const byte *rgb, const byte *pal, colcache_t *cache)
{

View file

@ -162,6 +162,7 @@ static void
BI_shutdown (void *data)
{
ECS_DelRegistry (canvas_sys.reg);
ColorCache_Shutdown ();
}
static byte default_palette[256][3];