From c63c0ba04b069fb04632630d3c405c0aa669b023 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 23 Feb 2026 21:46:01 +0500 Subject: [PATCH] ref: minor refactoring --- ref/gl/gl_cull.c | 13 +++++-------- ref/gl/gl_local.h | 2 +- ref/gl/gl_studio.c | 2 +- ref/soft/r_studio.c | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/ref/gl/gl_cull.c b/ref/gl/gl_cull.c index d432b073..b4fad790 100644 --- a/ref/gl/gl_cull.c +++ b/ref/gl/gl_cull.c @@ -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 ); } /* diff --git a/ref/gl/gl_local.h b/ref/gl/gl_local.h index 37ed0781..f28ee51b 100644 --- a/ref/gl/gl_local.h +++ b/ref/gl/gl_local.h @@ -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 ); diff --git a/ref/gl/gl_studio.c b/ref/gl/gl_studio.c index d8298e40..ddae6c0d 100644 --- a/ref/gl/gl_studio.c +++ b/ref/gl/gl_studio.c @@ -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 ); diff --git a/ref/soft/r_studio.c b/ref/soft/r_studio.c index 6437a0ac..acaf4940 100644 --- a/ref/soft/r_studio.c +++ b/ref/soft/r_studio.c @@ -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 );