From bec3208efd332a1ca6dcc4d5d115a16c94f5e32c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 12 Apr 2016 19:50:29 +0200 Subject: [PATCH] - added support for distancecheck property. --- src/gl/scene/gl_bsp.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gl/scene/gl_bsp.cpp b/src/gl/scene/gl_bsp.cpp index 28b08d536..d72dfae86 100644 --- a/src/gl/scene/gl_bsp.cpp +++ b/src/gl/scene/gl_bsp.cpp @@ -339,6 +339,17 @@ static inline void RenderThings(subsector_t * sub, sector_t * sector) // Handle all things in sector. for (AActor * thing = sec->thinglist; thing; thing = thing->snext) { + FIntCVar *cvar = thing->GetClass()->distancecheck; + if (cvar != NULL && *cvar >= 0) + { + double dist = thing->Distance2DSquared(camera); + double check = (double)**cvar; + if (dist >= check * check) + { + continue; + } + } + GLRenderer->ProcessSprite(thing, sector); } }