Save the vpath in the model.

This will be used for restricting searches for auxiliary model files.
This commit is contained in:
Bill Currie 2014-01-23 09:16:05 +09:00
parent 83c47aacef
commit 328b997843
2 changed files with 2 additions and 2 deletions

View file

@ -350,6 +350,7 @@ typedef enum {mod_brush, mod_sprite, mod_alias, mod_iqm} modtype_t;
typedef struct model_s {
char name[MAX_QPATH];
const struct vpath_s *vpath;// virtual path where this model was found
qboolean needload; // bmodels and sprites don't cache normally
aliashdr_t *aliashdr; // if not null, alias model is not cached
qboolean hasfullbrights;

View file

@ -178,14 +178,13 @@ Mod_RealLoadModel (model_t *mod, qboolean crash, cache_allocator_t allocator)
return NULL;
}
// allocate a new model
if (loadname)
free (loadname);
loadname = QFS_FileBase (mod->name);
loadmodel = mod;
// fill it in
mod->vpath = qfs_foundfile.vpath;
mod->fullbright = 0;
mod->shadow_alpha = 255;
mod->min_light = 0.0;