by using setspritez() instead of setsprite() for the sectnum updating.
* Change 'yax-nextwall(0/1)' to 'upwall/downwall' in the corruption checker, makes it much nicer to read.

git-svn-id: https://svn.eduke32.com/eduke32@1959 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-08-09 16:03:56 +00:00
parent 3ca7ed1c2e
commit 26a25bdce5
2 changed files with 34 additions and 38 deletions

View file

@ -4375,7 +4375,7 @@ end_after_dragging:
daspr->x += dax; daspr->x += dax;
daspr->y += day; daspr->y += day;
setsprite(daspr-sprite, (const vec3_t *)daspr); setspritez(daspr-sprite, (const vec3_t *)daspr);
} }
} }
} }
@ -4404,7 +4404,7 @@ end_after_dragging:
vec.x = dax; vec.x = dax;
vec.y = day; vec.y = day;
vec.z = sprite[daspr].z; vec.z = sprite[daspr].z;
if (setsprite(daspr, &vec) == -1 && osec>=0) if (setspritez(daspr, &vec) == -1 && osec>=0)
Bmemcpy(&sprite[daspr], &ovec, sizeof(vec3_t)); Bmemcpy(&sprite[daspr], &ovec, sizeof(vec3_t));
#if 0 #if 0
daz = spriteheight(daspr, NULL); daz = spriteheight(daspr, NULL);

View file

@ -1848,12 +1848,12 @@ void ExtShowWallData(int16_t wallnum) //F6
} }
// formerly Show2dText and Show3dText // formerly Show2dText and Show3dText
static void ShowFileText(const char *name, int32_t do3d) static void ShowFileText(const char *name)
{ {
int32_t fp,t; int32_t fp,t, in3dmode=(qsetmode==200);
uint8_t x=0,y=4,xmax=0,xx=0,col=0; uint8_t x=0,y=4,xmax=0,xx=0,col=0;
if (!do3d) if (!in3dmode)
{ {
clearmidstatbar16(); clearmidstatbar16();
drawgradient(); drawgradient();
@ -1862,7 +1862,7 @@ static void ShowFileText(const char *name, int32_t do3d)
if ((fp=kopen4load(name,0)) == -1) if ((fp=kopen4load(name,0)) == -1)
{ {
Bsprintf(tempbuf, "ERROR: file '%s' not found.", name); Bsprintf(tempbuf, "ERROR: file '%s' not found.", name);
if (do3d) if (in3dmode)
printext256(1*4,4*8,whitecol,-1,tempbuf,0); printext256(1*4,4*8,whitecol,-1,tempbuf,0);
else else
printext16(1*4,ydim-STATUS2DSIZ+4*8,editorcolors[11],-1,tempbuf,0); printext16(1*4,ydim-STATUS2DSIZ+4*8,editorcolors[11],-1,tempbuf,0);
@ -1886,7 +1886,7 @@ static void ShowFileText(const char *name, int32_t do3d)
} }
tempbuf[x]=0; tempbuf[x]=0;
if (do3d) if (in3dmode)
printext256(xx*4,(y*6)+2,whitecol,-1,tempbuf,1); printext256(xx*4,(y*6)+2,whitecol,-1,tempbuf,1);
else else
printext16(xx*4,ydim-STATUS2DSIZ+(y*6)+2,editorcolors[11],-1,tempbuf,1); printext16(xx*4,ydim-STATUS2DSIZ+(y*6)+2,editorcolors[11],-1,tempbuf,1);
@ -2722,14 +2722,8 @@ void ExtShowSpriteData(int16_t spritenum) //F6
{ {
UNREFERENCED_PARAMETER(spritenum); UNREFERENCED_PARAMETER(spritenum);
if (qsetmode != 200) if (qsetmode != 200)
ShowFileText("sehelp.hlp", 0); ShowFileText("sehelp.hlp");
/* if (qsetmode == 200) // In 3D mode }
return;
while (KEY_PRESSED(KEYSC_F6));
ResetKeys();
ContextHelp(spritenum); // Get context sensitive help */
}// end ExtShowSpriteData
// Floor Over Floor (duke3d) // Floor Over Floor (duke3d)
@ -2930,7 +2924,6 @@ static void SE40Code(int32_t x,int32_t y,int32_t z,int32_t a,int32_t h)
void ExtEditSectorData(int16_t sectnum) //F7 void ExtEditSectorData(int16_t sectnum) //F7
{ {
// if (qsetmode != 200) ShowFileText("sthelp.hlp", 0);
if (qsetmode == 200) if (qsetmode == 200)
return; return;
@ -5270,9 +5263,9 @@ static void Keys3d(void)
if (autospritehelp && helpon==0) if (autospritehelp && helpon==0)
{ {
if (AIMING_AT_SPRITE && sprite[searchwall].picnum==SECTOREFFECTOR) if (AIMING_AT_SPRITE && sprite[searchwall].picnum==SECTOREFFECTOR)
ShowFileText("sehelp.hlp", 1); ShowFileText("sehelp.hlp");
else if (AIMING_AT_CEILING_OR_FLOOR) else if (AIMING_AT_CEILING_OR_FLOOR)
ShowFileText("sthelp.hlp", 1); ShowFileText("sthelp.hlp");
} }
// . Search & fix panning to the right (3D) // . Search & fix panning to the right (3D)
@ -7826,7 +7819,7 @@ static void Keys2d(void)
} }
if (keystatus[KEYSC_F9]) // F9 f1=3b if (keystatus[KEYSC_F9]) // F9 f1=3b
ShowFileText("sthelp.hlp", 0); ShowFileText("sthelp.hlp");
/* start Mapster32 */ /* start Mapster32 */
@ -11256,6 +11249,9 @@ void ExtCheckKeys(void)
} while (0) } while (0)
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
static char *yupdownwall[2] = {"upwall","downwall"};
static char *YUPDOWNWALL[2] = {"UPWALL","DOWNWALL"};
static int32_t walls_have_equal_endpoints(int32_t w1, int32_t w2) static int32_t walls_have_equal_endpoints(int32_t w1, int32_t w2)
{ {
int32_t n1 = wall[w1].point2, n2 = wall[w2].point2; int32_t n1 = wall[w1].point2, n2 = wall[w2].point2;
@ -11285,8 +11281,8 @@ outofloop:
{ {
if (!tryfixingp) if (!tryfixingp)
{ {
OSD_Printf(" will set wall %d's yax-nextwall(%d) to %d on tryfix\n", OSD_Printf(" will set wall %d's %s to %d on tryfix\n",
wallnum, cf, lastwall[0]); wallnum, yupdownwall[cf], lastwall[0]);
} }
else else
{ {
@ -11298,8 +11294,8 @@ outofloop:
yax_setnextwall(lastwall[0], !cf, wallnum); yax_setnextwall(lastwall[0], !cf, wallnum);
} }
OSD_Printf("auto-correction: set wall %d's yax-nextwall(%d) to %d%s\n", OSD_Printf("auto-correction: set wall %d's %s to %d%s\n",
wallnum, cf, lastwall[0], setreverse?" and its reverse link":""); wallnum, yupdownwall[cf], lastwall[0], setreverse?" and its reverse link":"");
} }
} }
else if (!tryfixingp) else if (!tryfixingp)
@ -11483,22 +11479,22 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
if (ynw >= 0) if (ynw >= 0)
{ {
if (ynw >= numwalls) if (ynw >= numwalls)
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's YAX-NEXTWALL(%d)=%d out of range: numwalls=%d", CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's %s=%d out of range: numwalls=%d",
j, cf, ynw, numwalls); j, YUPDOWNWALL[cf], ynw, numwalls);
else else
{ {
int32_t ynextwallok = 1; int32_t ynextwallok = 1;
if (j == ynw) if (j == ynw)
{ {
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's YAX-NEXTWALL(%d) is itself", CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's %s is itself",
j, cf); j, YUPDOWNWALL[cf]);
ynextwallok = 0; ynextwallok = 0;
} }
else if (!walls_have_equal_endpoints(j, ynw)) else if (!walls_have_equal_endpoints(j, ynw))
{ {
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's and its YAX-NEXTWALL(%d)=%d's endpoints are inconsistent", CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's and its %s=%d's "
j, cf, ynw); "endpoints are inconsistent", j, YUPDOWNWALL[cf], ynw);
ynextwallok = 0; ynextwallok = 0;
} }
@ -11509,9 +11505,9 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
if (bunchnum < 0 || bunchnum >= numyaxbunches) if (bunchnum < 0 || bunchnum >= numyaxbunches)
{ {
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d has YAX-NEXTWALL(%d)=%d, " CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d has %s=%d, "
"but its bunchnum(%d)=%d is invalid\n", j, cf, ynw, "but its bunchnum(%d)=%d is invalid\n",
cf, bunchnum); j, YUPDOWNWALL[cf], ynw, cf, bunchnum);
} }
else if (onumct < MAXCORRUPTTHINGS) else if (onumct < MAXCORRUPTTHINGS)
{ {
@ -11526,20 +11522,20 @@ int32_t CheckMapCorruption(int32_t printfromlev, uint64_t tryfixing)
ynwp2 = yax_getnextwall(ynw, !cf); ynwp2 = yax_getnextwall(ynw, !cf);
if (ynwp2 != j) if (ynwp2 != j)
{ {
CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's YAX-NEXTWALL(%d)=%d's reverse link wrong" CORRUPTCHK_PRINT(4, CORRUPT_WALL|j, "WALL %d's %s=%d's reverse link wrong"
" (expected %d, have %d)", j, cf, ynw, j, ynwp2); " (expected %d, have %d)", j, YUPDOWNWALL[cf], ynw, j, ynwp2);
if (onumct < MAXCORRUPTTHINGS) if (onumct < MAXCORRUPTTHINGS)
{ {
if (tryfixing & (1ull<<onumct)) if (tryfixing & (1ull<<onumct))
{ {
yax_setnextwall(ynw, !cf, j); yax_setnextwall(ynw, !cf, j);
OSD_Printf(CCHK_CORRECTED "auto-correction: set wall %d's yax-nextwall(%d)=%d's yax-nextwall(%d) to %d\n", OSD_Printf(CCHK_CORRECTED "auto-correction: set wall %d's %s=%d's %s to %d\n",
j, cf, ynw, !cf, j); j, yupdownwall[cf], ynw, yupdownwall[!cf], j);
} }
else if (4>=printfromlev) else if (4>=printfromlev)
{ {
OSD_Printf(" will set wall %d's yax-nextwall(%d)=%d's yax-nextwall(%d) to %d on tryfix\n", OSD_Printf(" will set wall %d's %s=%d's %s to %d on tryfix\n",
j, cf, ynw, !cf, j); j, yupdownwall[cf], ynw, yupdownwall[!cf], j);
} }
} }
} }