vk: studio: minor changes around FIXMEs

accidentally fixes #174
This commit is contained in:
Ivan Avdeev 2023-09-15 14:00:37 -04:00
parent 2e1cb8173e
commit e27bfdc682

View File

@ -36,6 +36,7 @@
// TODO get rid of this // TODO get rid of this
#define ENGINE_GET_PARM_ (*gEngine.EngineGetParm) #define ENGINE_GET_PARM_ (*gEngine.EngineGetParm)
#define ENGINE_GET_PARM( parm ) ENGINE_GET_PARM_( ( parm ), 0 ) #define ENGINE_GET_PARM( parm ) ENGINE_GET_PARM_( ( parm ), 0 )
#define CL_IsViewEntityLocalPlayer() ( ENGINE_GET_PARM( PARM_VIEWENT_INDEX ) == ENGINE_GET_PARM( PARM_PLAYER_INDEX ) )
// FIXME VK should not be declared here // FIXME VK should not be declared here
colorVec R_LightVec( const float *start, const float *end, float *lightspot, float *lightvec ); colorVec R_LightVec( const float *start, const float *end, float *lightspot, float *lightvec );
@ -3001,7 +3002,6 @@ static int R_StudioDrawModel( int flags )
if( !R_StudioCheckBBox( )) if( !R_StudioCheckBBox( ))
return 0; return 0;
// FIXME VK r_stats.c_studio_models_drawn++;
g_studio.framecount++; // render data cache cookie g_studio.framecount++; // render data cache cookie
if( m_pStudioHeader->numbodyparts == 0 ) if( m_pStudioHeader->numbodyparts == 0 )
@ -3089,6 +3089,7 @@ static void R_StudioDrawModelInternal( cl_entity_t *e, int flags )
static void R_DrawStudioModel( cl_entity_t *e ) static void R_DrawStudioModel( cl_entity_t *e )
{ {
/* FIXME VK /* FIXME VK
* RP_ENVVIEW is never set even in gl/soft renderers
if( FBitSet( RI.params, RP_ENVVIEW )) if( FBitSet( RI.params, RP_ENVVIEW ))
return; return;
*/ */
@ -3131,11 +3132,15 @@ void R_RunViewmodelEvents( void )
return; return;
/* FIXME VK /* FIXME VK
* RP_NORMALPASS is noop?
// ignore in thirdperson, camera view or client is died // ignore in thirdperson, camera view or client is died
if( !RP_NORMALPASS() || ENGINE_GET_PARM( PARM_LOCAL_HEALTH ) <= 0 || !CL_IsViewEntityLocalPlayer()) if( !RP_NORMALPASS() || ENGINE_GET_PARM( PARM_LOCAL_HEALTH ) <= 0 || !CL_IsViewEntityLocalPlayer())
return; return;
*/ */
if( ENGINE_GET_PARM( PARM_LOCAL_HEALTH ) <= 0 || !CL_IsViewEntityLocalPlayer())
return;
RI.currententity = gEngine.GetViewModel(); RI.currententity = gEngine.GetViewModel();
if( !RI.currententity->model || RI.currententity->model->type != mod_studio ) if( !RI.currententity->model || RI.currententity->model->type != mod_studio )
@ -3177,6 +3182,7 @@ void R_DrawViewModel( void )
return; return;
/* FIXME VK /* FIXME VK
* RP_NORMALPASS is noop?
// ignore in thirdperson, camera view or client is died // ignore in thirdperson, camera view or client is died
if( !RP_NORMALPASS() || ENGINE_GET_PARM( PARM_LOCAL_HEALTH ) <= 0 || !CL_IsViewEntityLocalPlayer()) if( !RP_NORMALPASS() || ENGINE_GET_PARM( PARM_LOCAL_HEALTH ) <= 0 || !CL_IsViewEntityLocalPlayer())
return; return;
@ -3186,6 +3192,9 @@ void R_DrawViewModel( void )
return; // invisible ? return; // invisible ?
*/ */
if( ENGINE_GET_PARM( PARM_LOCAL_HEALTH ) <= 0 || !CL_IsViewEntityLocalPlayer())
return;
RI.currententity = view; RI.currententity = view;
if( !RI.currententity->model ) if( !RI.currententity->model )
@ -3403,9 +3412,9 @@ static cl_entity_t *pfnGetViewEntity( void )
static void pfnGetEngineTimes( int *framecount, double *current, double *old ) static void pfnGetEngineTimes( int *framecount, double *current, double *old )
{ {
/* FIXME VK NOT IMPLEMENTED */ // TODO is framecount enough? Should it be "REAL" framecount?
/* if( framecount ) *framecount = tr.realframecount; */ /* if( framecount ) *framecount = tr.realframecount; */
if( framecount ) *framecount = 0; if( framecount ) *framecount = g_studio.framecount;
if( current ) *current = gpGlobals->time; if( current ) *current = gpGlobals->time;
if( old ) *old = gpGlobals->oldtime; if( old ) *old = gpGlobals->oldtime;
} }
@ -3463,15 +3472,10 @@ static void R_StudioDrawBones( void )
PRINT_NOT_IMPLEMENTED(); PRINT_NOT_IMPLEMENTED();
} }
static int fixme_studio_models_drawn;
static void pfnGetModelCounters( int **s, int **a ) static void pfnGetModelCounters( int **s, int **a )
{ {
*s = &g_studio.framecount; *s = &g_studio.framecount;
*a = &g_studio_stats.models_count;
/* FIXME VK NOT IMPLEMENTED */
/* *a = &r_stats.c_studio_models_drawn; */
*a = &fixme_studio_models_drawn;
} }
static void pfnGetAliasScale( float *x, float *y ) static void pfnGetAliasScale( float *x, float *y )