diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index bddfc307..a66c1f41 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -738,7 +738,8 @@ extern convar_t r_lockfrustum; extern convar_t r_traceglow; extern convar_t r_vbo; extern convar_t r_vbo_dlightmode; - +extern convar_t r_studio_sort_textures; +extern convar_t r_studio_drawelements; // // engine shared convars diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index ec594488..dcae951d 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -843,6 +843,8 @@ void GL_InitCommands( void ) gEngfuncs.Cvar_RegisterVariable( &r_lockpvs ); gEngfuncs.Cvar_RegisterVariable( &r_lockfrustum ); 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_texture_nearest ); diff --git a/ref/gl/gl_studio.c b/ref/gl/gl_studio.c index e212fbe6..2fe5aafd 100644 --- a/ref/gl/gl_studio.c +++ b/ref/gl/gl_studio.c @@ -121,9 +121,9 @@ typedef struct } studio_draw_state_t; // 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_DEFINE_AUTO( r_studio_drawelements, "1", FCVAR_GLCONFIG, "use glDrawElements for studiomodels" ); static r_studio_interface_t *pStudioDraw; static studio_draw_state_t g_studio; // global studio state diff --git a/ref/soft/r_local.h b/ref/soft/r_local.h index d4e132df..31f9fd4a 100644 --- a/ref/soft/r_local.h +++ b/ref/soft/r_local.h @@ -1096,6 +1096,7 @@ extern convar_t sw_surfcacheoverride; extern convar_t sw_texfilt; extern convar_t r_traceglow; extern convar_t sw_noalphabrushes; +extern convar_t r_studio_sort_textures; extern struct qfrustum_s { mplane_t screenedge[4]; diff --git a/ref/soft/r_main.c b/ref/soft/r_main.c index eff23f10..b8770c61 100644 --- a/ref/soft/r_main.c +++ b/ref/soft/r_main.c @@ -1918,6 +1918,7 @@ qboolean GAME_EXPORT R_Init( void ) gEngfuncs.Cvar_RegisterVariable( &sw_texfilt ); #endif gEngfuncs.Cvar_RegisterVariable( &r_novis ); + gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures ); r_temppool = Mem_AllocPool( "ref_soft zone" ); diff --git a/ref/soft/r_studio.c b/ref/soft/r_studio.c index 50affdeb..e7429599 100644 --- a/ref/soft/r_studio.c +++ b/ref/soft/r_studio.c @@ -117,7 +117,7 @@ typedef struct } studio_draw_state_t; // 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 r_studio_interface_t *pStudioDraw; @@ -141,8 +141,6 @@ R_StudioInit */ void R_StudioInit( void ) { - gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures ); - Matrix3x4_LoadIdentity( g_studio.rotationmatrix ); // g-cont. cvar disabled by Valve