mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 08:20:40 +00:00
Make alias model caching optional.
For now, only the glsl loader disables caching, but it stores the frame vertices in GL memory, so its hunk usage is relatively lower (and will be lower still when I get skins sorted out).
This commit is contained in:
parent
fb428f8067
commit
3669e3aa2e
9 changed files with 53 additions and 26 deletions
|
@ -52,6 +52,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
#include "d_iface.h"
|
||||
#include "r_local.h"
|
||||
|
||||
extern int alias_cache; //FIXME extern
|
||||
aliashdr_t *pheader;
|
||||
|
||||
stvert_t *stverts;
|
||||
|
@ -377,12 +378,17 @@ Mod_LoadAliasModel (model_t *mod, void *buffer, cache_allocator_t allocator)
|
|||
Mod_LoadExternalSkins (mod);
|
||||
|
||||
// move the complete, relocatable alias model to the cache
|
||||
end = Hunk_LowMark ();
|
||||
total = end - start;
|
||||
if (alias_cache) {
|
||||
end = Hunk_LowMark ();
|
||||
total = end - start;
|
||||
|
||||
mem = allocator (&mod->cache, total, loadname);
|
||||
if (mem)
|
||||
memcpy (mem, pheader, total);
|
||||
mem = allocator (&mod->cache, total, loadname);
|
||||
if (mem)
|
||||
memcpy (mem, pheader, total);
|
||||
|
||||
Hunk_FreeToLowMark (start);
|
||||
Hunk_FreeToLowMark (start);
|
||||
mod->aliashdr = 0;
|
||||
} else {
|
||||
mod->aliashdr = pheader;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue