From 2b61290666120e5dfbf7441d2677c0cbe9a8f3be Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 13 Jun 2013 17:11:00 +0000 Subject: [PATCH] engine: remove preceding assertion failure, continue loop then instead. Interestingly, that test case then appears to be drawn fully. Heh. Also, move one clamp from r1874 one up in the data flow chain. Doesn't seem to break textured overhead map view with Last Pissed Time. git-svn-id: https://svn.eduke32.com/eduke32@3878 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 5350e6904..6c001432b 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -6721,13 +6721,15 @@ static void fillpolygon(int32_t npoints) for (z=npoints-1; z>=0; z--) { const int32_t zz=xb1[z]; - const int32_t y1=ry1[z], y2=ry1[zz]; // NOTE: clamp for crash prevention... :-/ // r1874 says: "Fix more overheadmap crashes, this time with 'Last // Pissed Time'" - const int32_t day1 = clamp(y1>>12, 0, ydim-1); - const int32_t day2 = clamp(y2>>12, 0, ydim-1); + const int32_t y1 = clamp(ry1[z], 0, (ydim<<12)-1); + const int32_t y2 = clamp(ry1[zz], 0, (ydim<<12)-1); + + const int32_t day1 = y1>>12; + const int32_t day2 = y2>>12; if (day1 != day2) { @@ -6797,7 +6799,8 @@ static void fillpolygon(int32_t npoints) if (x1 > x2) continue; - Bassert((unsigned)x1 < xdim+0u || (unsigned)x2 < xdim+0u); + if ((unsigned)x1 >= xdim+0u || (unsigned)x2 >= xdim+0u) + continue; if (globalpolytype < 1) {