Browse Source

ref: fix late registration of studio cvars (thanks, @mittorn)

pull/2/head
Alibek Omarov 1 year ago
parent
commit
de19d78571
  1. 3
      ref/gl/gl_local.h
  2. 2
      ref/gl/gl_opengl.c
  3. 4
      ref/gl/gl_studio.c
  4. 1
      ref/soft/r_local.h
  5. 1
      ref/soft/r_main.c
  6. 4
      ref/soft/r_studio.c

3
ref/gl/gl_local.h

@ -738,7 +738,8 @@ extern convar_t r_lockfrustum;
extern convar_t r_traceglow; extern convar_t r_traceglow;
extern convar_t r_vbo; extern convar_t r_vbo;
extern convar_t r_vbo_dlightmode; extern convar_t r_vbo_dlightmode;
extern convar_t r_studio_sort_textures;
extern convar_t r_studio_drawelements;
// //
// engine shared convars // engine shared convars

2
ref/gl/gl_opengl.c

@ -843,6 +843,8 @@ void GL_InitCommands( void )
gEngfuncs.Cvar_RegisterVariable( &r_lockpvs ); gEngfuncs.Cvar_RegisterVariable( &r_lockpvs );
gEngfuncs.Cvar_RegisterVariable( &r_lockfrustum ); gEngfuncs.Cvar_RegisterVariable( &r_lockfrustum );
gEngfuncs.Cvar_RegisterVariable( &r_traceglow ); gEngfuncs.Cvar_RegisterVariable( &r_traceglow );
gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures );
gEngfuncs.Cvar_RegisterVariable( &r_studio_drawelements );
gEngfuncs.Cvar_RegisterVariable( &gl_extensions ); gEngfuncs.Cvar_RegisterVariable( &gl_extensions );
gEngfuncs.Cvar_RegisterVariable( &gl_texture_nearest ); gEngfuncs.Cvar_RegisterVariable( &gl_texture_nearest );

4
ref/gl/gl_studio.c

@ -121,9 +121,9 @@ typedef struct
} studio_draw_state_t; } studio_draw_state_t;
// studio-related cvars // studio-related cvars
static CVAR_DEFINE_AUTO( r_studio_sort_textures, "0", FCVAR_GLCONFIG, "change draw order for additive meshes" ); CVAR_DEFINE_AUTO( r_studio_sort_textures, "0", FCVAR_GLCONFIG, "change draw order for additive meshes" );
CVAR_DEFINE_AUTO( r_studio_drawelements, "1", FCVAR_GLCONFIG, "use glDrawElements for studiomodels" );
static cvar_t *cl_righthand = NULL; static cvar_t *cl_righthand = NULL;
static CVAR_DEFINE_AUTO( r_studio_drawelements, "1", FCVAR_GLCONFIG, "use glDrawElements for studiomodels" );
static r_studio_interface_t *pStudioDraw; static r_studio_interface_t *pStudioDraw;
static studio_draw_state_t g_studio; // global studio state static studio_draw_state_t g_studio; // global studio state

1
ref/soft/r_local.h

@ -1096,6 +1096,7 @@ extern convar_t sw_surfcacheoverride;
extern convar_t sw_texfilt; extern convar_t sw_texfilt;
extern convar_t r_traceglow; extern convar_t r_traceglow;
extern convar_t sw_noalphabrushes; extern convar_t sw_noalphabrushes;
extern convar_t r_studio_sort_textures;
extern struct qfrustum_s { extern struct qfrustum_s {
mplane_t screenedge[4]; mplane_t screenedge[4];

1
ref/soft/r_main.c

@ -1918,6 +1918,7 @@ qboolean GAME_EXPORT R_Init( void )
gEngfuncs.Cvar_RegisterVariable( &sw_texfilt ); gEngfuncs.Cvar_RegisterVariable( &sw_texfilt );
#endif #endif
gEngfuncs.Cvar_RegisterVariable( &r_novis ); gEngfuncs.Cvar_RegisterVariable( &r_novis );
gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures );
r_temppool = Mem_AllocPool( "ref_soft zone" ); r_temppool = Mem_AllocPool( "ref_soft zone" );

4
ref/soft/r_studio.c

@ -117,7 +117,7 @@ typedef struct
} studio_draw_state_t; } studio_draw_state_t;
// studio-related cvars // studio-related cvars
static CVAR_DEFINE_AUTO( r_studio_sort_textures, "0", FCVAR_GLCONFIG, "change draw order for additive meshes" ); 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 *cl_righthand = NULL;
static r_studio_interface_t *pStudioDraw; static r_studio_interface_t *pStudioDraw;
@ -141,8 +141,6 @@ R_StudioInit
*/ */
void R_StudioInit( void ) void R_StudioInit( void )
{ {
gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures );
Matrix3x4_LoadIdentity( g_studio.rotationmatrix ); Matrix3x4_LoadIdentity( g_studio.rotationmatrix );
// g-cont. cvar disabled by Valve // g-cont. cvar disabled by Valve

Loading…
Cancel
Save