diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 609b6bbda..f00bc937d 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -392,7 +392,6 @@ EXTERN int32_t h_xsize[MAXTILES], h_ysize[MAXTILES]; EXTERN int8_t h_xoffs[MAXTILES], h_yoffs[MAXTILES]; extern const char *engineerrstr; -extern char noclip; EXTERN int32_t editorzrange[2]; diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index dc94fb6fc..32c0689bb 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -40,6 +40,8 @@ extern int32_t horiz; extern vec3_t pos; extern int16_t ang, cursectnum; +extern int8_t m32_clipping; // 0: none, 1: only white walls, 2: like game + extern int16_t editstatus, searchit; extern int32_t searchx, searchy, osearchx, osearchy; //search input diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index db5b72330..b1bfb3eae 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -27,7 +27,7 @@ static char kensig[64]; extern const char *ExtGetVer(void); -char noclip=0; +int8_t m32_clipping=2; // 0 1 2 3 4 5 6 7 // up, down, left, right, lshift, rctrl, lctrl, space @@ -836,15 +836,17 @@ void spriteoncfz(int32_t i, int32_t *czptr, int32_t *fzptr) static void move_and_update(int32_t xvect, int32_t yvect, int32_t addshr) { - if (noclip) + if (m32_clipping==0) { pos.x += xvect>>(14+addshr); pos.y += yvect>>(14+addshr); updatesector(pos.x,pos.y, &cursectnum); } else + { clipmove(&pos,&cursectnum, xvect>>addshr,yvect>>addshr, - 128,4<<8,4<<8, CLIPMASK0); + 128,4<<8,4<<8, (m32_clipping==1) ? 0 : CLIPMASK0); + } } static void mainloop_move(void) @@ -1040,7 +1042,7 @@ void editinput(void) mainloop_move(); - getzrange(&pos,cursectnum, &hiz,&hihit, &loz,&lohit, 128,CLIPMASK0); + getzrange(&pos,cursectnum, &hiz,&hihit, &loz,&lohit, 128, (m32_clipping==1)?0:CLIPMASK0); /* { int32_t his = !(hihit&32768), los = !(lohit&32768); @@ -1118,11 +1120,11 @@ void editinput(void) } } - if (!noclip) + if (m32_clipping) inpclamp(&goalz, hiz+(4<<8), loz-(4<<8)); if (zmode == 1) goalz = loz-zlock; - if (!noclip && (goalz < hiz+(4<<8))) + if (m32_clipping && (goalz < hiz+(4<<8))) goalz = ((loz+hiz)>>1); //ceiling&floor too close if (zmode == 1) pos.z = goalz; @@ -1137,7 +1139,7 @@ void editinput(void) pos.z += hvel; - if (!noclip) + if (m32_clipping) { if (pos.z > loz-(4<<8)) pos.z = loz-(4<<8), hvel = 0; if (pos.z < hiz+(4<<8)) pos.z = hiz+(4<<8), hvel = 0; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index ba2d6705c..dedcb66a8 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -5330,8 +5330,8 @@ static void Keys3d(void) if (YAXCHK(!AIMING_AT_CEILING_OR_FLOOR || yax_getbunch(searchsector, AIMING_AT_FLOOR) < 0)) #endif { - i = noclip; - noclip = 1; + i = m32_clipping; + m32_clipping = 0; switch (searchstat) { @@ -5371,7 +5371,7 @@ static void Keys3d(void) setslope(searchsector, YAX_FLOOR, sector[searchsector].floorheinum); asksave = 1; - noclip = i; + m32_clipping = i; } @@ -8835,8 +8835,11 @@ static int32_t osdcmd_sensitivity(const osdfuncparm_t *parm) static int32_t osdcmd_noclip(const osdfuncparm_t *parm) { UNREFERENCED_PARAMETER(parm); - noclip = !noclip; - OSD_Printf("Clipping %s\n", noclip?"disabled":"enabled"); + m32_clipping--; + if (m32_clipping < 0) + m32_clipping = 2; + OSD_Printf("Clipping %s\n", m32_clipping==0 ? "disabled" : + (m32_clipping==1 ? "non-masks only" : "enabled")); return OSDCMD_OK; } @@ -9321,7 +9324,7 @@ static int32_t registerosdcommands(void) OSD_RegisterFunction("initgroupfile","initgroupfile : adds a grp file into the game filesystem", osdcmd_initgroupfile); - OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip); + OSD_RegisterFunction("m32_clipping","m32_clipping: toggles clipping mode", osdcmd_noclip); OSD_RegisterFunction("quit","quit: exits the editor immediately", osdcmd_quit); OSD_RegisterFunction("exit","exit: exits the editor immediately", osdcmd_quit); @@ -11013,8 +11016,11 @@ static void Keys2d3d(void) if (keystatus[KEYSC_QUOTE] && PRESSED_KEYSC(N)) // 'N { - noclip = !noclip; - message("Clipping %s", noclip?"disabled":"enabled"); + m32_clipping--; + if (m32_clipping < 0) + m32_clipping = 2; + message("Clipping %s", m32_clipping==0 ? "disabled" : + (m32_clipping==1 ? "non-masks only" : "enabled")); } if (eitherCTRL && PRESSED_KEYSC(N)) // CTRL+N