mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[gl] Free alias model cache memory when clearing models
Like sw, gl uses the cache for alias models and thus needs to free the cache memory when unloading the model.
This commit is contained in:
parent
793525a50a
commit
3fbac33ee8
1 changed files with 10 additions and 0 deletions
|
@ -52,6 +52,14 @@
|
|||
|
||||
#include "compat.h"
|
||||
|
||||
static void
|
||||
gl_alias_clear (model_t *m, void *data)
|
||||
{
|
||||
m->needload = true;
|
||||
|
||||
Cache_Free (&m->cache);
|
||||
}
|
||||
|
||||
static void
|
||||
gl_Mod_LoadSkin (mod_alias_ctx_t *alias_ctx, byte *texels,
|
||||
int snum, int gnum, maliasskindesc_t *skindesc)
|
||||
|
@ -124,6 +132,8 @@ gl_Mod_FinalizeAliasModel (mod_alias_ctx_t *alias_ctx)
|
|||
header->mdl.scale_origin[2] -= (22 + 8);
|
||||
VectorScale (header->mdl.scale, 2, header->mdl.scale);
|
||||
}
|
||||
|
||||
alias_ctx->mod->clear = gl_alias_clear;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue