ref: minor refactoring

This commit is contained in:
Alibek Omarov
2026-02-23 21:46:01 +05:00
parent 109579fa92
commit c63c0ba04b
4 changed files with 8 additions and 11 deletions

View File

@@ -40,23 +40,20 @@ qboolean R_CullBox( const vec3_t mins, const vec3_t maxs )
R_CullModel
=============
*/
int R_CullModel( cl_entity_t *e, const vec3_t absmin, const vec3_t absmax )
qboolean R_CullModel( cl_entity_t *e, const vec3_t absmin, const vec3_t absmax )
{
if( e == tr.viewent )
{
if( ENGINE_GET_PARM( PARM_DEV_OVERVIEW ))
return 1;
return true;
if( RP_NORMALPASS() && !ENGINE_GET_PARM( PARM_THIRDPERSON ) && CL_IsViewEntityLocalPlayer())
return 0;
return false;
return 1;
return true;
}
if( R_CullBox( absmin, absmax ))
return 1;
return 0;
return R_CullBox( absmin, absmax );
}
/*

View File

@@ -328,7 +328,7 @@ qboolean R_BeamCull( const vec3_t start, const vec3_t end, qboolean pvsOnly );
//
// gl_cull.c
//
int R_CullModel( cl_entity_t *e, const vec3_t absmin, const vec3_t absmax );
qboolean R_CullModel( cl_entity_t *e, const vec3_t absmin, const vec3_t absmax );
qboolean R_CullBox( const vec3_t mins, const vec3_t maxs );
int R_CullSurface( msurface_t *surf, gl_frustum_t *frustum, uint clipflags );

View File

@@ -219,7 +219,7 @@ static qboolean R_StudioComputeBBox( vec3_t bbox[8] )
return false;
// check if we have valid mins\maxs
if( !VectorCompare( vec3_origin, RI.currentmodel->mins ))
if( !VectorIsNull( RI.currentmodel->mins ) && !VectorIsNull( RI.currentmodel->maxs ))
{
// clipping bounding box
VectorCopy( RI.currentmodel->mins, mins );

View File

@@ -211,7 +211,7 @@ static qboolean R_StudioComputeBBox( vec3_t bbox[8] )
return false;
// check if we have valid mins\maxs
if( !VectorCompare( vec3_origin, RI.currentmodel->mins ))
if( !VectorIsNull( RI.currentmodel->mins ) && !VectorIsNull( RI.currentmodel->maxs ))
{
// clipping bounding box
VectorCopy( RI.currentmodel->mins, mins );