mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-22 09:56:22 +01:00
engine: common: move model cvars to static allocation
This commit is contained in:
parent
05579927a5
commit
e7ece41ba0
@ -2051,7 +2051,7 @@ static void Mod_LoadTextureData( dbspmodel_t *bmod, int textureIndex )
|
||||
// 2. Internal from map
|
||||
|
||||
// Try WAD texture (force while r_wadtextures is 1)
|
||||
if(( r_wadtextures->value && bmod->wadlist.count > 0 ) || mipTex->offsets[0] <= 0 )
|
||||
if(( r_wadtextures.value && bmod->wadlist.count > 0 ) || mipTex->offsets[0] <= 0 )
|
||||
{
|
||||
char texpath[MAX_VA_STRING];
|
||||
int wadIndex = Mod_FindTextureInWadList( &bmod->wadlist, mipTex->name, texpath, sizeof( texpath ));
|
||||
|
@ -119,9 +119,9 @@ typedef struct world_static_s
|
||||
extern world_static_t world;
|
||||
extern poolhandle_t com_studiocache;
|
||||
extern model_t *loadmodel;
|
||||
extern convar_t *mod_studiocache;
|
||||
extern convar_t *r_wadtextures;
|
||||
extern convar_t *r_showhull;
|
||||
extern convar_t mod_studiocache;
|
||||
extern convar_t r_wadtextures;
|
||||
extern convar_t r_showhull;
|
||||
|
||||
//
|
||||
// model.c
|
||||
|
@ -239,7 +239,7 @@ hull_t *Mod_HullForStudio( model_t *model, float frame, int sequence, vec3_t ang
|
||||
bSkipShield = false;
|
||||
*numhitboxes = 0; // assume error
|
||||
|
||||
if( mod_studiocache->value )
|
||||
if( mod_studiocache.value )
|
||||
{
|
||||
bonecache = Mod_CheckStudioCache( model, frame, sequence, angles, origin, size, pcontroller, pblending );
|
||||
|
||||
@ -286,7 +286,7 @@ hull_t *Mod_HullForStudio( model_t *model, float frame, int sequence, vec3_t ang
|
||||
// tell trace code about hitbox count
|
||||
*numhitboxes = (bSkipShield) ? (mod_studiohdr->numhitboxes - 1) : (mod_studiohdr->numhitboxes);
|
||||
|
||||
if( mod_studiocache->value )
|
||||
if( mod_studiocache.value )
|
||||
Mod_AddToStudioCache( frame, sequence, angles, origin, size, pcontroller, pblending, model, studio_hull, *numhitboxes );
|
||||
|
||||
return studio_hull;
|
||||
|
@ -28,9 +28,9 @@ static model_info_t mod_crcinfo[MAX_MODELS];
|
||||
static model_t mod_known[MAX_MODELS];
|
||||
static int mod_numknown = 0;
|
||||
poolhandle_t com_studiocache; // cache for submodels
|
||||
convar_t *mod_studiocache;
|
||||
convar_t *r_wadtextures;
|
||||
convar_t *r_showhull;
|
||||
CVAR_DEFINE( mod_studiocache, "r_studiocache", "1", FCVAR_ARCHIVE, "enables studio cache for speedup tracing hitboxes" );
|
||||
CVAR_DEFINE_AUTO( r_wadtextures, "0", 0, "completely ignore textures in the bsp-file if enabled" );
|
||||
CVAR_DEFINE_AUTO( r_showhull, "0", 0, "draw collision hulls 1-3" );
|
||||
model_t *loadmodel;
|
||||
|
||||
/*
|
||||
@ -134,9 +134,9 @@ Mod_Init
|
||||
void Mod_Init( void )
|
||||
{
|
||||
com_studiocache = Mem_AllocPool( "Studio Cache" );
|
||||
mod_studiocache = Cvar_Get( "r_studiocache", "1", FCVAR_ARCHIVE, "enables studio cache for speedup tracing hitboxes" );
|
||||
r_wadtextures = Cvar_Get( "r_wadtextures", "0", 0, "completely ignore textures in the bsp-file if enabled" );
|
||||
r_showhull = Cvar_Get( "r_showhull", "0", 0, "draw collision hulls 1-3" );
|
||||
Cvar_RegisterVariable( &mod_studiocache );
|
||||
Cvar_RegisterVariable( &r_wadtextures );
|
||||
Cvar_RegisterVariable( &r_showhull );
|
||||
|
||||
Cmd_AddCommand( "mapstats", Mod_PrintWorldStats_f, "show stats for currently loaded map" );
|
||||
Cmd_AddCommand( "modellist", Mod_Modellist_f, "display loaded models list" );
|
||||
@ -403,7 +403,7 @@ static void Mod_PurgeStudioCache( void )
|
||||
int i;
|
||||
|
||||
// refresh hull data
|
||||
SetBits( r_showhull->flags, FCVAR_CHANGED );
|
||||
SetBits( r_showhull.flags, FCVAR_CHANGED );
|
||||
#if !XASH_DEDICATED
|
||||
Mod_ReleaseHullPolygons();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user