mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-13 06:13:18 +00:00
Adapt linedef type 405 and 407 to UDMF
This commit is contained in:
parent
53976e4b52
commit
8f39e23105
5 changed files with 23 additions and 19 deletions
|
@ -81,7 +81,7 @@ void T_MoveCeiling(ceiling_t *ceiling)
|
||||||
ceiling->sector->ceilingpic = ceiling->texture;
|
ceiling->sector->ceilingpic = ceiling->texture;
|
||||||
/* FALLTHRU */
|
/* FALLTHRU */
|
||||||
case raiseToHighest:
|
case raiseToHighest:
|
||||||
case moveCeilingByFrontTexture:
|
case moveCeilingByDistance:
|
||||||
ceiling->sector->ceilingdata = NULL;
|
ceiling->sector->ceilingdata = NULL;
|
||||||
ceiling->sector->ceilspeed = 0;
|
ceiling->sector->ceilspeed = 0;
|
||||||
P_RemoveThinker(&ceiling->thinker);
|
P_RemoveThinker(&ceiling->thinker);
|
||||||
|
@ -203,7 +203,7 @@ void T_MoveCeiling(ceiling_t *ceiling)
|
||||||
/* FALLTHRU */
|
/* FALLTHRU */
|
||||||
|
|
||||||
// in all other cases, just remove the active ceiling
|
// in all other cases, just remove the active ceiling
|
||||||
case moveCeilingByFrontTexture:
|
case moveCeilingByDistance:
|
||||||
ceiling->sector->ceilingdata = NULL;
|
ceiling->sector->ceilingdata = NULL;
|
||||||
ceiling->sector->ceilspeed = 0;
|
ceiling->sector->ceilspeed = 0;
|
||||||
P_RemoveThinker(&ceiling->thinker);
|
P_RemoveThinker(&ceiling->thinker);
|
||||||
|
@ -498,19 +498,19 @@ INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
|
||||||
ceiling->texture = (line->args[2] & 2) ? line->frontsector->ceilingpic : -1;
|
ceiling->texture = (line->args[2] & 2) ? line->frontsector->ceilingpic : -1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case moveCeilingByFrontTexture:
|
case moveCeilingByDistance:
|
||||||
if (line->flags & ML_NOCLIMB)
|
if (line->args[4])
|
||||||
ceiling->speed = INT32_MAX/2; // as above, "instant" is one tic
|
ceiling->speed = INT32_MAX/2; // as above, "instant" is one tic
|
||||||
else
|
else
|
||||||
ceiling->speed = FixedDiv(sides[line->sidenum[0]].textureoffset,8*FRACUNIT); // texture x offset
|
ceiling->speed = line->args[3] << (FRACBITS - 3);
|
||||||
if (sides[line->sidenum[0]].rowoffset > 0)
|
if (sides[line->sidenum[0]].rowoffset > 0)
|
||||||
{
|
{
|
||||||
ceiling->direction = 1; // up
|
ceiling->direction = 1; // up
|
||||||
ceiling->topheight = sec->ceilingheight + sides[line->sidenum[0]].rowoffset; // texture y offset
|
ceiling->topheight = sec->ceilingheight + (line->args[2] << FRACBITS);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ceiling->direction = -1; // down
|
ceiling->direction = -1; // down
|
||||||
ceiling->bottomheight = sec->ceilingheight + sides[line->sidenum[0]].rowoffset; // texture y offset
|
ceiling->bottomheight = sec->ceilingheight + (line->args[2] << FRACBITS);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1885,12 +1885,12 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case moveFloorByFrontTexture:
|
case moveFloorByDistance:
|
||||||
if (line->flags & ML_NOCLIMB)
|
if (line->args[4])
|
||||||
dofloor->speed = INT32_MAX/2; // as above, "instant" is one tic
|
dofloor->speed = INT32_MAX/2; // as above, "instant" is one tic
|
||||||
else
|
else
|
||||||
dofloor->speed = FixedDiv(sides[line->sidenum[0]].textureoffset,8*FRACUNIT); // texture x offset
|
dofloor->speed = line->args[3] << (FRACBITS - 3);
|
||||||
dofloor->floordestheight = sec->floorheight + sides[line->sidenum[0]].rowoffset; // texture y offset
|
dofloor->floordestheight = sec->floorheight + (line->args[2] << FRACBITS);
|
||||||
if (dofloor->floordestheight > sec->floorheight)
|
if (dofloor->floordestheight > sec->floorheight)
|
||||||
dofloor->direction = 1; // up
|
dofloor->direction = 1; // up
|
||||||
else
|
else
|
||||||
|
|
|
@ -3543,6 +3543,11 @@ static void P_ConvertBinaryMap(void)
|
||||||
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
|
||||||
lines[i].args[0] = tag;
|
lines[i].args[0] = tag;
|
||||||
|
lines[i].args[1] = (lines[i].special == 405) ? 0 : 1;
|
||||||
|
lines[i].args[2] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
|
||||||
|
lines[i].args[3] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||||
|
lines[i].args[4] = !!(lines[i].flags & ML_NOCLIMB);
|
||||||
|
lines[i].special = 405;
|
||||||
break;
|
break;
|
||||||
case 428: //Start platform movement
|
case 428: //Start platform movement
|
||||||
lines[i].args[0] = tag;
|
lines[i].args[0] = tag;
|
||||||
|
|
11
src/p_spec.c
11
src/p_spec.c
|
@ -2277,12 +2277,11 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
|
||||||
EV_DoCeiling(line->args[0], line, moveCeilingByFrontSector);
|
EV_DoCeiling(line->args[0], line, moveCeilingByFrontSector);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 405: // Move floor by front side texture offsets, offset x = speed, offset y = amount to raise/lower
|
case 405: // Move planes by distance
|
||||||
EV_DoFloor(line->args[0], line, moveFloorByFrontTexture);
|
if (line->args[1] != 1)
|
||||||
break;
|
EV_DoFloor(line->args[0], line, moveFloorByDistance);
|
||||||
|
if (line->args[1] != 0)
|
||||||
case 407: // Move ceiling by front side texture offsets, offset x = speed, offset y = amount to raise/lower
|
EV_DoCeiling(line->args[0], line, moveCeilingByDistance);
|
||||||
EV_DoCeiling(line->args[0], line, moveCeilingByFrontTexture);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 409: // Change tagged sectors' tag
|
case 409: // Change tagged sectors' tag
|
||||||
|
|
|
@ -271,7 +271,7 @@ typedef enum
|
||||||
moveCeilingByFrontSector,
|
moveCeilingByFrontSector,
|
||||||
instantMoveCeilingByFrontSector,
|
instantMoveCeilingByFrontSector,
|
||||||
|
|
||||||
moveCeilingByFrontTexture,
|
moveCeilingByDistance,
|
||||||
|
|
||||||
bounceCeiling,
|
bounceCeiling,
|
||||||
bounceCeilingCrush,
|
bounceCeilingCrush,
|
||||||
|
@ -325,7 +325,7 @@ typedef enum
|
||||||
moveFloorByFrontSector,
|
moveFloorByFrontSector,
|
||||||
instantMoveFloorByFrontSector,
|
instantMoveFloorByFrontSector,
|
||||||
|
|
||||||
moveFloorByFrontTexture,
|
moveFloorByDistance,
|
||||||
|
|
||||||
bounceFloor,
|
bounceFloor,
|
||||||
bounceFloorCrush,
|
bounceFloorCrush,
|
||||||
|
|
Loading…
Reference in a new issue