mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 13:10:34 +00:00
[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:
parent
3f9873a754
commit
3e30b7b9e2
3 changed files with 9 additions and 0 deletions
|
@ -66,6 +66,7 @@ typedef struct colcache_s colcache_t;
|
||||||
|
|
||||||
colcache_t *ColorCache_New (void);
|
colcache_t *ColorCache_New (void);
|
||||||
void ColorCache_Delete (colcache_t *cache);
|
void ColorCache_Delete (colcache_t *cache);
|
||||||
|
void ColorCache_Shutdown (void);
|
||||||
byte ConvertColor (const byte *rgb, const byte *pal, colcache_t *cache);
|
byte ConvertColor (const byte *rgb, const byte *pal, colcache_t *cache);
|
||||||
tex_t *ConvertImage (const tex_t *tex, const byte *pal);
|
tex_t *ConvertImage (const tex_t *tex, const byte *pal);
|
||||||
|
|
||||||
|
|
|
@ -105,6 +105,13 @@ ColorCache_Delete (colcache_t *cache)
|
||||||
FREE (colcache, cache);
|
FREE (colcache, cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ColorCache_Shutdown (void)
|
||||||
|
{
|
||||||
|
ALLOC_FREE_BLOCKS (colcache);
|
||||||
|
ALLOC_FREE_BLOCKS (colcache_color);
|
||||||
|
}
|
||||||
|
|
||||||
byte
|
byte
|
||||||
ConvertColor (const byte *rgb, const byte *pal, colcache_t *cache)
|
ConvertColor (const byte *rgb, const byte *pal, colcache_t *cache)
|
||||||
{
|
{
|
||||||
|
|
|
@ -162,6 +162,7 @@ static void
|
||||||
BI_shutdown (void *data)
|
BI_shutdown (void *data)
|
||||||
{
|
{
|
||||||
ECS_DelRegistry (canvas_sys.reg);
|
ECS_DelRegistry (canvas_sys.reg);
|
||||||
|
ColorCache_Shutdown ();
|
||||||
}
|
}
|
||||||
|
|
||||||
static byte default_palette[256][3];
|
static byte default_palette[256][3];
|
||||||
|
|
Loading…
Reference in a new issue