mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
ref: gl: reorganize checks in R_CullSurface
This commit is contained in:
@@ -67,16 +67,15 @@ int R_CullSurface( const msurface_t *surf, const gl_frustum_t *frustum, uint cli
|
||||
{
|
||||
cl_entity_t *e = RI.currententity;
|
||||
|
||||
if( unlikely( !e || !surf || !surf->texinfo || !surf->texinfo->texture ))
|
||||
if( surf->visframe != tr.framecount && e == CL_GetEntityByIndex( 0 ))
|
||||
return CULL_VISFRAME;
|
||||
|
||||
if( unlikely( !surf->texinfo || !surf->texinfo->texture ))
|
||||
return CULL_OTHER;
|
||||
|
||||
if( unlikely( r_nocull.value ))
|
||||
return CULL_VISIBLE;
|
||||
|
||||
// world surfaces can be culled by vis frame too
|
||||
if( e == CL_GetEntityByIndex( 0 ) && surf->visframe != tr.framecount )
|
||||
return CULL_VISFRAME;
|
||||
|
||||
// only static ents can be culled by frustum
|
||||
if( !R_StaticEntity( e ))
|
||||
frustum = NULL;
|
||||
|
||||
@@ -165,6 +165,9 @@ qboolean GL_FrustumCullSphere( const gl_frustum_t *out, const vec3_t center, flo
|
||||
if( unlikely( r_nocull.value ))
|
||||
return false;
|
||||
|
||||
if( !iClipFlags )
|
||||
return false;
|
||||
|
||||
for( i = FRUSTUM_PLANES, bit = 1; i > 0; i--, bit <<= 1 )
|
||||
{
|
||||
const mplane_t *p = &out->planes[FRUSTUM_PLANES - i];
|
||||
|
||||
Reference in New Issue
Block a user