diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index 44abe42e9..5d502a898 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -88,7 +88,7 @@ ifneq (0,$(DEBUGANYWAY)) endif W_NO_UNUSED_RESULT := $(shell echo '' | $(CC) -E -Wno-unused-result - 2>/dev/null && echo -Wno-unused-result) -W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(WNO_UNUSED_RESULT)) +W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(W_NO_UNUSED_RESULT)) BASECFLAGS=$(debug) -W -Wall -Wimplicit -Werror-implicit-function-declaration \ -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \ diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index f507f2534..9bc23fb95 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -114,7 +114,7 @@ extern const char *SaveBoard(const char *fn, uint32_t flags); #define CORRUPT_SPRITE (1<<19) #define CORRUPT_MASK (CORRUPT_SECTOR|CORRUPT_WALL|CORRUPT_SPRITE) #define MAXCORRUPTTHINGS 64 -extern int32_t numcorruptthings, corruptthings[MAXCORRUPTTHINGS]; +extern int32_t corruptlevel, numcorruptthings, corruptthings[MAXCORRUPTTHINGS]; extern int32_t autocorruptcheck; extern int32_t CheckMapCorruption(int32_t printfromlev, int32_t tryfixing); diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 0d7bea360..4a1a03bac 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -1259,16 +1259,25 @@ static inline void drawline16base(int32_t bx, int32_t by, int32_t x1, int32_t y1 drawline16(bx+x1, by+y1, bx+x2, by+y2, col); } -static void drawsmalllabel(const char *text, char col, char backcol, - int32_t x1, int32_t y1, int32_t x2, int32_t y2) +static void drawsmalllabel(const char *text, char col, char backcol, int32_t dax, int32_t day) { - printext16(x1,y1, col,backcol, text,1); - drawline16(x1-1,y1-1, x2-3,y1-1, backcol); - drawline16(x1-1,y2+1, x2-3,y2+1, backcol); + int32_t x1, y1, x2, y2; - drawline16(x1-2,y1, x1-2,y2, backcol); - drawline16(x2-2,y1, x2-2,y2, backcol); - drawline16(x2-3,y1, x2-3,y2, backcol); + x1 = halfxdim16+dax-(Bstrlen(text)<<1); + y1 = midydim16+day-4; + x2 = x1 + (Bstrlen(text)<<2)+2; + y2 = y1 + 7; + + if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) + { + printext16(x1,y1, col,backcol, text,1); + drawline16(x1-1,y1-1, x2-3,y1-1, backcol); + drawline16(x1-1,y2+1, x2-3,y2+1, backcol); + + drawline16(x1-2,y1, x1-2,y2, backcol); + drawline16(x2-2,y1, x2-2,y2, backcol); + drawline16(x2-3,y1, x2-3,y2, backcol); + } } // backup highlighted sectors with sprites as mapinfo for later restoration @@ -1944,13 +1953,7 @@ void overheadeditor(void) if (m32_sideview) day += vdisp; - x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); - y1 = midydim16+day-4; - x2 = x1 + (Bstrlen(dabuffer)<<2)+2; - y2 = y1 + 7; - if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) - drawsmalllabel(dabuffer, editorcolors[0], editorcolors[7], - x1,y1, x2,y2); + drawsmalllabel(dabuffer, editorcolors[0], editorcolors[7], dax, day); } } } @@ -1985,14 +1988,7 @@ void overheadeditor(void) if (m32_sideview) day += getscreenvdisp(getflorzofslope(sectorofwall(i), dax,day)-pos.z, zoom); - x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); - y1 = midydim16+day-4; - x2 = x1 + (Bstrlen(dabuffer)<<2)+2; - y2 = y1 + 7; - - if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) - drawsmalllabel(dabuffer, editorcolors[0], editorcolors[31], - x1,y1, x2,y2); + drawsmalllabel(dabuffer, editorcolors[0], editorcolors[31], dax, day); } } } @@ -2022,12 +2018,6 @@ void overheadeditor(void) if (m32_sideview) day += getscreenvdisp(sprite[i].z-pos.z, zoom); - x1 = halfxdim16+dax-(Bstrlen(dabuffer)<<1); - y1 = midydim16+day-4; - x2 = x1 + (Bstrlen(dabuffer)<<2)+2; - y2 = y1 + 7; - - if ((x1 > 3) && (x2 < xdim) && (y1 > 1) && (y2 < ydim16)) { int32_t blocking = (sprite[i].cstat&1); @@ -2038,8 +2028,7 @@ void overheadeditor(void) if ((i == pointhighlight-16384) && (totalclock & 32)) col += (2<<2); - drawsmalllabel(dabuffer, editorcolors[0], editorcolors[col], - x1,y1, x2,y2); + drawsmalllabel(dabuffer, editorcolors[0], editorcolors[col], dax, day); } } j--; @@ -2084,16 +2073,24 @@ void overheadeditor(void) if (joinsector[0] >= 0) col = editorcolors[11]; - if (numcorruptthings>0 && (pointhighlight&16384)==0) + if (numcorruptthings>0) { - for (i=0; iparms[0], "now")) { - CheckMapCorruption(1, 0); + if (CheckMapCorruption(1, 0)==0) + OSD_Printf("All OK.\n"); + return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "tryfix")) { CheckMapCorruption(3, 1); + return OSDCMD_OK; } else if (isdigit(parm->parms[0][0])) { @@ -9987,8 +9990,8 @@ void ExtCheckKeys(void) if (autocorruptcheck>0 && totalclock > corruptchecktimer) { - if (CheckMapCorruption(3, 0)>=4) - message("Corruption detected. See OSD for details."); + if (CheckMapCorruption(3, 0)>=3) + printmessage16("Corruption detected. See OSD for details."); corruptchecktimer = totalclock + 120*autocorruptcheck; } } @@ -10084,7 +10087,10 @@ int32_t CheckMapCorruption(int32_t printfromlev, int32_t tryfixing) CORRUPTCHK_PRINT(5, 0, CCHK_PANIC "WALL LIMIT EXCEEDED (MAXWALLS=%d)!!!", MAXWALLS); if (numsectors>MAXSECTORS || numwalls>MAXWALLS) + { + corruptlevel = bad; return bad; + } seen_nextwalls = Bcalloc((numwalls+7)>>3,1); if (!seen_nextwalls) return 5; @@ -10253,6 +10259,8 @@ int32_t CheckMapCorruption(int32_t printfromlev, int32_t tryfixing) Bfree(seen_nextwalls); Bfree(lastnextwallsource); + corruptlevel = errlevel; + return errlevel; } ////