From 7553bb043fd6c82c76286113542147efad6979c2 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 4 Aug 2019 02:52:06 +0000 Subject: [PATCH] Skip drawing invalid polygons in polymost_drawpoly() git-svn-id: https://svn.eduke32.com/eduke32@7880 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/polymost.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 6fb89dac8..461c3ec8c 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -2121,6 +2121,8 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32 py[j] = dpxy[i].y; dd[j] = (dpxy[i].x * xtex.d + dpxy[i].y * ytex.d + otex.d); + if (dd[j] <= 0.f) // invalid polygon + return; uu[j] = (dpxy[i].x * xtex.u + dpxy[i].y * ytex.u + otex.u); vv[j] = (dpxy[i].x * xtex.v + dpxy[i].y * ytex.v + otex.v); j++;