mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Adapt linedef types 403-404 to UDMF
This commit is contained in:
parent
0eabbf0170
commit
53976e4b52
4 changed files with 31 additions and 35 deletions
|
@ -448,8 +448,7 @@ INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
|
||||||
|
|
||||||
// Linedef executor excellence
|
// Linedef executor excellence
|
||||||
case moveCeilingByFrontSector:
|
case moveCeilingByFrontSector:
|
||||||
ceiling->speed = P_AproxDistance(line->dx, line->dy);
|
ceiling->speed = line->args[2] << (FRACBITS - 3);
|
||||||
ceiling->speed = FixedDiv(ceiling->speed,8*FRACUNIT);
|
|
||||||
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
|
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
|
||||||
{
|
{
|
||||||
ceiling->direction = 1;
|
ceiling->direction = 1;
|
||||||
|
@ -462,18 +461,11 @@ INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
|
||||||
}
|
}
|
||||||
|
|
||||||
// chained linedef executing ability
|
// chained linedef executing ability
|
||||||
if (line->flags & ML_BLOCKMONSTERS)
|
|
||||||
{
|
|
||||||
// only set it on ONE of the moving sectors (the smallest numbered)
|
// only set it on ONE of the moving sectors (the smallest numbered)
|
||||||
// and front side x offset must be positive
|
if (line->args[3] > 0)
|
||||||
if (firstone && sides[line->sidenum[0]].textureoffset > 0)
|
ceiling->texture = firstone ? line->args[3] - INT16_MAX - 2 : -1;
|
||||||
ceiling->texture = (sides[line->sidenum[0]].textureoffset>>FRACBITS) - 32769;
|
|
||||||
else
|
|
||||||
ceiling->texture = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// flat changing ability
|
// flat changing ability
|
||||||
else if (line->flags & ML_NOCLIMB)
|
else if (line->args[4])
|
||||||
ceiling->texture = line->frontsector->ceilingpic;
|
ceiling->texture = line->frontsector->ceilingpic;
|
||||||
else
|
else
|
||||||
ceiling->texture = -1;
|
ceiling->texture = -1;
|
||||||
|
|
|
@ -1864,11 +1864,8 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
|
||||||
dofloor->texture = (line->args[2] & 1) ? line->frontsector->floorpic : -1;
|
dofloor->texture = (line->args[2] & 1) ? line->frontsector->floorpic : -1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Linedef executor command, linetype 106.
|
|
||||||
// Line length = speed, front sector floor = destination height.
|
|
||||||
case moveFloorByFrontSector:
|
case moveFloorByFrontSector:
|
||||||
dofloor->speed = P_AproxDistance(line->dx, line->dy);
|
dofloor->speed = line->args[2] << (FRACBITS - 3);
|
||||||
dofloor->speed = FixedDiv(dofloor->speed,8*FRACUNIT);
|
|
||||||
dofloor->floordestheight = line->frontsector->floorheight;
|
dofloor->floordestheight = line->frontsector->floorheight;
|
||||||
|
|
||||||
if (dofloor->floordestheight >= sec->floorheight)
|
if (dofloor->floordestheight >= sec->floorheight)
|
||||||
|
@ -1877,19 +1874,11 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
|
||||||
dofloor->direction = -1; // down
|
dofloor->direction = -1; // down
|
||||||
|
|
||||||
// chained linedef executing ability
|
// chained linedef executing ability
|
||||||
if (line->flags & ML_BLOCKMONSTERS)
|
// Only set it on one of the moving sectors (the smallest numbered)
|
||||||
{
|
if (line->args[3] > 0)
|
||||||
// Only set it on one of the moving sectors (the
|
dofloor->texture = firstone ? line->args[3] - INT16_MAX - 2 : -1;
|
||||||
// smallest numbered) and only if the front side
|
|
||||||
// x offset is positive, indicating a valid tag.
|
|
||||||
if (firstone && sides[line->sidenum[0]].textureoffset > 0)
|
|
||||||
dofloor->texture = (sides[line->sidenum[0]].textureoffset>>FRACBITS) - 32769;
|
|
||||||
else
|
|
||||||
dofloor->texture = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// flat changing ability
|
// flat changing ability
|
||||||
else if (line->flags & ML_NOCLIMB)
|
else if (line->args[4])
|
||||||
dofloor->texture = line->frontsector->floorpic;
|
dofloor->texture = line->frontsector->floorpic;
|
||||||
else
|
else
|
||||||
dofloor->texture = -1; // nothing special to do after movement completes
|
dofloor->texture = -1; // nothing special to do after movement completes
|
||||||
|
|
|
@ -3523,6 +3523,22 @@ static void P_ConvertBinaryMap(void)
|
||||||
case 403: //Move tagged sector's floor
|
case 403: //Move tagged sector's floor
|
||||||
case 404: //Move tagged sector's ceiling
|
case 404: //Move tagged sector's ceiling
|
||||||
lines[i].args[0] = tag;
|
lines[i].args[0] = tag;
|
||||||
|
lines[i].args[1] = lines[i].special - 403;
|
||||||
|
lines[i].args[2] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
|
||||||
|
if (lines[i].flags & ML_BLOCKMONSTERS)
|
||||||
|
{
|
||||||
|
if (sides[lines[i].sidenum[0]].textureoffset > 0)
|
||||||
|
lines[i].args[3] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
|
else
|
||||||
|
lines[i].args[3] = 0;
|
||||||
|
lines[i].args[4] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lines[i].args[3] = 0;
|
||||||
|
lines[i].args[4] = !!(lines[i].flags & ML_NOCLIMB);
|
||||||
|
}
|
||||||
|
lines[i].special = 403;
|
||||||
break;
|
break;
|
||||||
case 405: //Move floor according to front texture offsets
|
case 405: //Move floor according to front texture offsets
|
||||||
case 407: //Move ceiling according to front texture offsets
|
case 407: //Move ceiling according to front texture offsets
|
||||||
|
|
|
@ -2270,11 +2270,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 403: // Move floor, linelen = speed, frontsector floor = dest height
|
case 403: // Move planes by front sector
|
||||||
|
if (line->args[1] != 1)
|
||||||
EV_DoFloor(line->args[0], line, moveFloorByFrontSector);
|
EV_DoFloor(line->args[0], line, moveFloorByFrontSector);
|
||||||
break;
|
if (line->args[1] != 0)
|
||||||
|
|
||||||
case 404: // Move ceiling, linelen = speed, frontsector ceiling = dest height
|
|
||||||
EV_DoCeiling(line->args[0], line, moveCeilingByFrontSector);
|
EV_DoCeiling(line->args[0], line, moveCeilingByFrontSector);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue