mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
reset all models and set mod_numknown to 0 upon gamedir changes.
fixes issue described at: http://celephais.net/board/view_thread.php?id=60452&start=825 also see http://forums.inside3d.com/viewtopic.php?f=12&t=5509 git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@942 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
14181eee15
commit
b5e0d90e28
3 changed files with 16 additions and 0 deletions
|
@ -195,6 +195,20 @@ void Mod_ClearAll (void)
|
|||
}
|
||||
}
|
||||
|
||||
void Mod_ResetAll (void)
|
||||
{
|
||||
int i;
|
||||
qmodel_t *mod;
|
||||
|
||||
for (i=0 , mod=mod_known ; i<mod_numknown ; i++, mod++)
|
||||
{
|
||||
if (!mod->needload) //otherwise Mod_ClearAll() did it already
|
||||
TexMgr_FreeTexturesForOwner (mod);
|
||||
memset(mod, 0, sizeof(qmodel_t));
|
||||
}
|
||||
mod_numknown = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
Mod_FindName
|
||||
|
|
|
@ -449,6 +449,7 @@ typedef struct qmodel_s
|
|||
|
||||
void Mod_Init (void);
|
||||
void Mod_ClearAll (void);
|
||||
void Mod_ResetAll (void); // for gamedir changes (Host_Game_f)
|
||||
qmodel_t *Mod_ForName (const char *name, qboolean crash);
|
||||
void *Mod_Extradata (qmodel_t *mod); // handles caching
|
||||
void Mod_TouchModel (const char *name);
|
||||
|
|
|
@ -201,6 +201,7 @@ void Host_Game_f (void)
|
|||
|
||||
//clear out and reload appropriate data
|
||||
Cache_Flush ();
|
||||
Mod_ResetAll();
|
||||
if (!isDedicated)
|
||||
{
|
||||
TexMgr_NewGame ();
|
||||
|
|
Loading…
Reference in a new issue