From 235a82f13daac8c5a64a2734415e3cef605d7cc0 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Fri, 25 Nov 2011 13:46:48 +0000 Subject: [PATCH] Fix two bugs with the loop punching code that made it practically useless. git-svn-id: https://svn.eduke32.com/eduke32@2131 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 36361eb2f..2fd1eb06b 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -3872,9 +3872,19 @@ void overheadeditor(void) // determine start wall for (i=0; i0 && wall[j-1].point2==j) + continue; + + if (clockdir(j)==CLOCKDIR_CCW) { - YAX_SKIPWALL(highlight[i]); + YAX_SKIPWALL(j); if (loopstartwall >= 0) { @@ -3882,8 +3892,9 @@ void overheadeditor(void) goto end_yax; } - loopstartwall = highlight[i]; + loopstartwall = j; } + } if (loopstartwall == -1) { @@ -4007,7 +4018,7 @@ void overheadeditor(void) for (SECTORS_OF_BUNCH(bunchnum, !cf, i)) for (WALLS_OF_SECTOR(i, j)) { - if (inside(wall[i].x, wall[i].y, numsectors-1)==1) + if (inside(wall[j].x, wall[j].y, numsectors-1)==1) { numsectors--; newnumwalls = -1; @@ -7802,6 +7813,7 @@ static int32_t checkautoinsert(int32_t dax, int32_t day, int16_t danumwalls) return(0); } +// wallstart has to be the starting wall of a loop! static int32_t clockdir(int16_t wallstart) //Returns: 0 is CW, 1 is CCW { int16_t i, themin; @@ -8195,6 +8207,7 @@ static void clearministatbar16(void) enddrawing(); } +// startwall has to be the starting wall of a loop! static int16_t loopinside(int32_t x, int32_t y, int16_t startwall) { int32_t x1, y1, x2, y2;