|
|
@ -88,11 +88,7 @@ static void Mod_FreeUserData( model_t *mod ) |
|
|
|
#ifndef XASH_DEDICATED |
|
|
|
#ifndef XASH_DEDICATED |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( clgame.drawFuncs.Mod_ProcessUserData != NULL ) |
|
|
|
ref.dllFuncs.Mod_ProcessRenderData( mod, false, NULL ); |
|
|
|
{ |
|
|
|
|
|
|
|
// let the client.dll free custom data
|
|
|
|
|
|
|
|
clgame.drawFuncs.Mod_ProcessUserData( mod, false, NULL ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
@ -111,9 +107,6 @@ void Mod_FreeModel( model_t *mod ) |
|
|
|
if( mod->type != mod_brush || mod->name[0] != '*' ) |
|
|
|
if( mod->type != mod_brush || mod->name[0] != '*' ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Mod_FreeUserData( mod ); |
|
|
|
Mod_FreeUserData( mod ); |
|
|
|
#ifndef XASH_DEDICATED |
|
|
|
|
|
|
|
ref.dllFuncs.Mod_UnloadTextures( mod ); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
Mem_FreePool( &mod->mempool ); |
|
|
|
Mem_FreePool( &mod->mempool ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -295,8 +288,8 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) |
|
|
|
Mod_LoadSpriteModel( mod, buf, &loaded, 0 ); |
|
|
|
Mod_LoadSpriteModel( mod, buf, &loaded, 0 ); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case IDALIASHEADER: |
|
|
|
case IDALIASHEADER: |
|
|
|
// REFTODO: move alias loader to engine
|
|
|
|
// REFTODO: move server-related code here
|
|
|
|
ref.dllFuncs.Mod_LoadModel( mod_alias, mod, buf, &loaded, 0 ); |
|
|
|
loaded = true; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case Q1BSP_VERSION: |
|
|
|
case Q1BSP_VERSION: |
|
|
|
case HLBSP_VERSION: |
|
|
|
case HLBSP_VERSION: |
|
|
@ -310,18 +303,7 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) |
|
|
|
else Con_Printf( S_ERROR "%s has unknown format\n", tempname ); |
|
|
|
else Con_Printf( S_ERROR "%s has unknown format\n", tempname ); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if( loaded ) |
|
|
|
if( !loaded ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Mod_FreeModel( mod ); |
|
|
|
|
|
|
|
Mem_Free( buf ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( crash ) Host_Error( "Could not load model %s\n", tempname ); |
|
|
|
|
|
|
|
else Con_Printf( S_ERROR "Could not load model %s\n", tempname ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
if( world.loading ) |
|
|
|
if( world.loading ) |
|
|
|
SetBits( mod->flags, MODEL_WORLD ); // mark worldmodel
|
|
|
|
SetBits( mod->flags, MODEL_WORLD ); // mark worldmodel
|
|
|
@ -337,15 +319,22 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash ) |
|
|
|
#ifndef XASH_DEDICATED |
|
|
|
#ifndef XASH_DEDICATED |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( clgame.drawFuncs.Mod_ProcessUserData != NULL ) |
|
|
|
loaded = ref.dllFuncs.Mod_ProcessRenderData( mod, true, buf ); |
|
|
|
{ |
|
|
|
|
|
|
|
// let the client.dll load custom data
|
|
|
|
|
|
|
|
clgame.drawFuncs.Mod_ProcessUserData( mod, true, buf ); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( !loaded ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Mod_FreeModel( mod ); |
|
|
|
|
|
|
|
Mem_Free( buf ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( crash ) Host_Error( "Could not load model %s\n", tempname ); |
|
|
|
|
|
|
|
else Con_Printf( S_ERROR "Could not load model %s\n", tempname ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
p = &mod_crcinfo[mod - mod_known]; |
|
|
|
p = &mod_crcinfo[mod - mod_known]; |
|
|
|
mod->needload = NL_PRESENT; |
|
|
|
mod->needload = NL_PRESENT; |
|
|
|
|
|
|
|
|
|
|
|