diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index e6e77122..57cf2f44 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -736,6 +736,7 @@ extern convar_t r_vbo_detail; extern convar_t r_vbo_overbrightmode; extern convar_t r_studio_sort_textures; extern convar_t r_studio_drawelements; +extern convar_t r_studio_builtin_renderer; extern convar_t r_shadows; extern convar_t r_ripple; extern convar_t r_ripple_updatetime; diff --git a/ref/gl/gl_opengl.c b/ref/gl/gl_opengl.c index 49e657eb..a09ea627 100644 --- a/ref/gl/gl_opengl.c +++ b/ref/gl/gl_opengl.c @@ -1149,6 +1149,7 @@ static void GL_InitCommands( void ) gEngfuncs.Cvar_RegisterVariable( &r_traceglow ); gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures ); gEngfuncs.Cvar_RegisterVariable( &r_studio_drawelements ); + gEngfuncs.Cvar_RegisterVariable( &r_studio_builtin_renderer ); gEngfuncs.Cvar_RegisterVariable( &r_ripple ); gEngfuncs.Cvar_RegisterVariable( &r_ripple_updatetime ); gEngfuncs.Cvar_RegisterVariable( &r_ripple_spawntime ); diff --git a/ref/gl/gl_studio.c b/ref/gl/gl_studio.c index ffe56fc7..6f31707d 100644 --- a/ref/gl/gl_studio.c +++ b/ref/gl/gl_studio.c @@ -122,6 +122,7 @@ typedef struct // studio-related cvars 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" ); +CVAR_DEFINE_AUTO( r_studio_builtin_renderer, "0", 0, "use built-in studio model renderer instead of the one provided by client library (debugging)" ); static cvar_t *cl_righthand = NULL; static r_studio_interface_t *pStudioDraw; @@ -3192,6 +3193,12 @@ static void R_StudioDrawModelInternal( cl_entity_t *e, int flags ) R_StudioDrawPlayer( flags, &e->curstate ); else R_StudioDrawModel( flags ); } + else if( unlikely( r_studio_builtin_renderer.value )) + { + if( e->player ) + R_StudioDrawPlayer( flags, R_StudioGetPlayerState( e->index - 1 )); + else R_StudioDrawModel( flags ); + } else { // select the properly method diff --git a/ref/soft/r_local.h b/ref/soft/r_local.h index a3a3f3ae..ace7a9f2 100644 --- a/ref/soft/r_local.h +++ b/ref/soft/r_local.h @@ -955,6 +955,7 @@ extern convar_t sw_texfilt; extern convar_t r_traceglow; extern convar_t sw_noalphabrushes; extern convar_t r_studio_sort_textures; +extern convar_t r_studio_builtin_renderer; extern struct qfrustum_s { diff --git a/ref/soft/r_main.c b/ref/soft/r_main.c index bca07765..c446e623 100644 --- a/ref/soft/r_main.c +++ b/ref/soft/r_main.c @@ -1341,6 +1341,7 @@ qboolean GAME_EXPORT R_Init( void ) #endif gEngfuncs.Cvar_RegisterVariable( &r_novis ); gEngfuncs.Cvar_RegisterVariable( &r_studio_sort_textures ); + gEngfuncs.Cvar_RegisterVariable( &r_studio_builtin_renderer ); r_temppool = Mem_AllocPool( "ref_soft zone" ); diff --git a/ref/soft/r_studio.c b/ref/soft/r_studio.c index d6850464..9e1e84f3 100644 --- a/ref/soft/r_studio.c +++ b/ref/soft/r_studio.c @@ -105,6 +105,7 @@ typedef struct // studio-related cvars CVAR_DEFINE_AUTO( r_studio_sort_textures, "0", FCVAR_GLCONFIG, "change draw order for additive meshes" ); +CVAR_DEFINE_AUTO( r_studio_builtin_renderer, "0", 0, "use built-in studio model renderer instead of the one provided by client library (debugging)" ); static cvar_t *cl_righthand = NULL; static r_studio_interface_t *pStudioDraw; @@ -2822,6 +2823,13 @@ static void R_StudioDrawModelInternal( cl_entity_t *e, int flags ) else R_StudioDrawModel( flags ); } + else if( unlikely( r_studio_builtin_renderer.value )) + { + if( e->player ) + R_StudioDrawPlayer( flags, R_StudioGetPlayerState( e->index - 1 )); + else + R_StudioDrawModel( flags ); + } else { // select the properly method