ref: soft: move ref_soft cvars to static allocation, remove dead cvars

This commit is contained in:
Alibek Omarov
2023-05-20 20:52:27 +03:00
parent 95a8d2f51f
commit 8680757844
10 changed files with 58 additions and 107 deletions

View File

@@ -117,9 +117,8 @@ typedef struct
} studio_draw_state_t;
// studio-related cvars
static cvar_t *r_studio_sort_textures;
static CVAR_DEFINE_AUTO( r_studio_sort_textures, "0", FCVAR_GLCONFIG, "change draw order for additive meshes" );
static cvar_t *cl_righthand = NULL;
static cvar_t *r_studio_drawelements;
static r_studio_interface_t *pStudioDraw;
static studio_draw_state_t g_studio; // global studio state
@@ -142,8 +141,7 @@ R_StudioInit
*/
void R_StudioInit( void )
{
r_studio_sort_textures = gEngfuncs.Cvar_Get( "r_studio_sort_textures", "0", FCVAR_ARCHIVE, "change draw order for additive meshes" );
r_drawviewmodel = gEngfuncs.Cvar_Get( "r_drawviewmodel", "1", 0, "draw firstperson weapon model" );
gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures );
Matrix3x4_LoadIdentity( g_studio.rotationmatrix );
@@ -2112,7 +2110,7 @@ static void R_StudioDrawPoints( void )
}
}
if( r_studio_sort_textures->value && need_sort )
if( r_studio_sort_textures.value && need_sort )
{
// resort opaque and translucent meshes draw order
qsort( g_studio.meshes, m_pSubModel->nummesh, sizeof( sortedmesh_t ), (void*)R_StudioMeshCompare );