cause the model to load into a calloced buffer rather than the hunk temp

region to avoid the data getting corrupted by cache shufflings. This
/should/ fix the bad extents bug (Closes: #37)
This commit is contained in:
Bill Currie 2002-10-11 02:54:02 +00:00
parent 00b798c5b6
commit d7e7b7de7d

View file

@ -168,12 +168,10 @@ Mod_LoadModel (model_t *mod, qboolean crash)
model_t *
Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
{
byte stackbuf[1024]; // avoid dirtying the cache heap
unsigned int *buf;
// load the file
buf = (unsigned int *) COM_LoadStackFile (mod->name, stackbuf,
sizeof (stackbuf));
buf = (unsigned int *) COM_LoadFile (mod->name, 0);
if (!buf) {
if (crash)
Sys_Error ("Mod_LoadModel: %s not found", mod->name);
@ -228,6 +226,7 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
Mod_LoadExternalTextures (mod);
break;
}
free (buf);
return mod;
}