Mapster32: In 3D mode, [,] auto-aligns walls to the left.

git-svn-id: https://svn.eduke32.com/eduke32@3281 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-12-13 22:21:22 +00:00
parent a8b445355b
commit 049e63d7f3
2 changed files with 9 additions and 6 deletions

View file

@ -10403,13 +10403,15 @@ void AlignWallPoint2(int32_t w0)
// 2: iterate point2's
// 4: carry pixel width from first wall over to the rest
// 8: align TROR nextwalls
// 16: iterate lastwall()s (point2 in reverse)
int32_t AutoAlignWalls(int32_t w0, uint32_t flags, int32_t nrecurs)
{
static int32_t numaligned, wall0, cstat0;
static uint32_t lenrepquot;
const int32_t totheleft = flags&16;
int32_t z0 = GetWallBaseZ(w0);
int32_t w1 = wall[w0].point2;
int32_t w1 = totheleft ? lastwall(w0) : wall[w0].point2;
const int32_t tilenum = wall[w0].picnum;
if (nrecurs == 0)
@ -10496,7 +10498,7 @@ int32_t AutoAlignWalls(int32_t w0, uint32_t flags, int32_t nrecurs)
break;
w0 = w1;
z0 = GetWallBaseZ(w0);
w1 = wall[w0].point2;
w1 = totheleft ? lastwall(w0) : wall[w0].point2;
continue;
}
@ -10508,7 +10510,7 @@ int32_t AutoAlignWalls(int32_t w0, uint32_t flags, int32_t nrecurs)
if (wall[w1].nextwall < 0 || !(flags&2))
break;
w1 = NEXTWALL(w1).point2;
w1 = totheleft ? lastwall(wall[w1].nextwall) : NEXTWALL(w1).point2;
}
return numaligned;

View file

@ -5186,10 +5186,11 @@ static void Keys3d(void)
}
// . Search & fix panning to the right (3D)
if (AIMING_AT_WALL_OR_MASK && PRESSED_KEYSC(PERIOD))
if (AIMING_AT_WALL_OR_MASK && ((tsign=PRESSED_KEYSC(PERIOD)) || PRESSED_KEYSC(COMMA)))
{
int32_t naligned=AutoAlignWalls(searchwall, eitherCTRL|((!eitherSHIFT)<<1)|
(eitherALT<<2)|((!!keystatus[KEYSC_QUOTE])<<3), 0);
uint32_t flags = eitherCTRL | ((!eitherSHIFT)<<1) | (tsign?0:16) |
(eitherALT<<2) | ((!!keystatus[KEYSC_QUOTE])<<3);
int32_t naligned=AutoAlignWalls(searchwall, flags, 0);
message("Aligned %d wall%s based on wall %d%s%s%s%s", naligned,
naligned==1?"":"s", searchwall,
eitherCTRL?", recursing nextwalls":"",