diff --git a/source/build/include/build.h b/source/build/include/build.h index d25c8b62d..7e5971f96 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -892,6 +892,8 @@ EXTERN char *faketiledata[MAXTILES]; EXTERN char spritecol2d[MAXTILES][2]; EXTERN uint8_t tilecols[MAXTILES]; +EXTERN char editwall[(MAXWALLS+7)>>3]; + extern uint8_t vgapal16[4*256]; extern uint32_t drawlinepat; diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 37c062519..5ced9c7e4 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -9497,6 +9497,7 @@ static void enginePrepareLoadBoard(buildvfs_kfd fil, vec3_t *dapos, int16_t *daa Bmemset(show2dsector, 0, sizeof(show2dsector)); Bmemset(show2dsprite, 0, sizeof(show2dsprite)); Bmemset(show2dwall, 0, sizeof(show2dwall)); + Bmemset(editwall, 0, sizeof(editwall)); #ifdef USE_STRUCT_TRACKERS Bmemset(sectorchanged, 0, sizeof(sectorchanged)); Bmemset(spritechanged, 0, sizeof(spritechanged)); @@ -11277,9 +11278,12 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags) for (w=0; w>3] & (1<<(w&7))) { - wall[w].cstat |= (1<<14); + editwall[w>>3] |= 1<<(w&7); if (flags&2) - wall[lastwall(w)].cstat |= (1<<14); + { + int wn = lastwall(w); + editwall[wn>>3] |= 1<<(wn&7); + } } } } @@ -11296,10 +11300,11 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags) if (editstatus) { - wall[pointhighlight].cstat |= (1<<14); + editwall[pointhighlight>>3] |= 1<<(pointhighlight&7); if (linehighlight >= 0 && linehighlight < MAXWALLS) - wall[linehighlight].cstat |= (1<<14); - wall[lastwall(pointhighlight)].cstat |= (1<<14); + editwall[linehighlight>>3] |= 1<<(linehighlight&7); + int wn = lastwall(pointhighlight); + editwall[wn>>3] |= 1<<(wn&7); } do @@ -11310,7 +11315,7 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags) wall[tempshort].x = dax; wall[tempshort].y = day; - wall[tempshort].cstat |= (1<<14); + editwall[tempshort>>3] |= 1<<(tempshort&7); } else { @@ -11323,7 +11328,7 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags) tempshort = wall[thelastwall].nextwall; wall[tempshort].x = dax; wall[tempshort].y = day; - wall[tempshort].cstat |= (1<<14); + editwall[tempshort>>3] |= 1<<(tempshort&7); } else { diff --git a/source/duke3d/src/astub.cpp b/source/duke3d/src/astub.cpp index 136d18629..0a431c574 100644 --- a/source/duke3d/src/astub.cpp +++ b/source/duke3d/src/astub.cpp @@ -722,11 +722,11 @@ const char *ExtGetWallCaption(int16_t wallnum) static char tempbuf[64]; Bmemset(tempbuf,0,sizeof(tempbuf)); - - if (wall[wallnum].cstat & (1<<14)) + + if (editwall[wallnum>>3]&(1<<(wallnum&7))) { Bsprintf(tempbuf,"%d", wallength(wallnum)); - wall[wallnum].cstat &= ~(1<<14); + editwall[wallnum>>3] &= ~(1<<(wallnum&7)); return tempbuf; }