mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 19:31:05 +00:00
Adapt linedef type 53-58 to UDMF
This commit is contained in:
parent
5b1a42af4c
commit
c8bb18b389
3 changed files with 20 additions and 85 deletions
|
@ -79,28 +79,6 @@ void T_MoveCeiling(ceiling_t *ceiling)
|
|||
P_RemoveThinker(&ceiling->thinker);
|
||||
return;
|
||||
case bounceCeiling:
|
||||
{
|
||||
fixed_t dest = (ceiling->direction == 1) ? ceiling->topheight : ceiling->bottomheight;
|
||||
|
||||
if (dest == lines[ceiling->texture].frontsector->ceilingheight)
|
||||
dest = lines[ceiling->texture].backsector->ceilingheight;
|
||||
else
|
||||
dest = lines[ceiling->texture].frontsector->ceilingheight;
|
||||
|
||||
if (dest < ceiling->sector->ceilingheight) // must move down
|
||||
{
|
||||
ceiling->direction = -1;
|
||||
ceiling->bottomheight = dest;
|
||||
}
|
||||
else // must move up
|
||||
{
|
||||
ceiling->direction = 1;
|
||||
ceiling->topheight = dest;
|
||||
}
|
||||
|
||||
ceiling->delaytimer = ceiling->delay;
|
||||
break;
|
||||
}
|
||||
case bounceCeilingCrush:
|
||||
{
|
||||
fixed_t dest = (ceiling->direction == 1) ? ceiling->topheight : ceiling->bottomheight;
|
||||
|
@ -108,12 +86,12 @@ void T_MoveCeiling(ceiling_t *ceiling)
|
|||
if (dest == lines[ceiling->texture].frontsector->ceilingheight)
|
||||
{
|
||||
dest = lines[ceiling->texture].backsector->ceilingheight;
|
||||
ceiling->speed = ceiling->origspeed = FixedDiv(abs(lines[ceiling->texture].dy), 4*FRACUNIT); // return trip, use dy
|
||||
ceiling->speed = ceiling->origspeed = lines[ceiling->texture].args[3] << (FRACBITS - 2); // return trip, use args[3]
|
||||
}
|
||||
else
|
||||
{
|
||||
dest = lines[ceiling->texture].frontsector->ceilingheight;
|
||||
ceiling->speed = ceiling->origspeed = FixedDiv(abs(lines[ceiling->texture].dx), 4*FRACUNIT); // going frontways, use dx
|
||||
ceiling->speed = ceiling->origspeed = lines[ceiling->texture].args[2] << (FRACBITS - 2); // going frontways, use args[2]
|
||||
}
|
||||
|
||||
if (dest < ceiling->sector->ceilingheight) // must move down
|
||||
|
@ -344,30 +322,8 @@ INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
|
|||
break;
|
||||
|
||||
case bounceCeiling:
|
||||
ceiling->speed = P_AproxDistance(line->dx, line->dy); // same speed as elevateContinuous
|
||||
ceiling->speed = FixedDiv(ceiling->speed,4*FRACUNIT);
|
||||
ceiling->origspeed = ceiling->speed;
|
||||
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
|
||||
{
|
||||
ceiling->direction = 1;
|
||||
ceiling->topheight = line->frontsector->ceilingheight;
|
||||
}
|
||||
else // Move down
|
||||
{
|
||||
ceiling->direction = -1;
|
||||
ceiling->bottomheight = line->frontsector->ceilingheight;
|
||||
}
|
||||
|
||||
// Any delay?
|
||||
ceiling->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
|
||||
ceiling->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
|
||||
|
||||
ceiling->texture = (fixed_t)(line - lines); // hack: use texture to store sourceline number
|
||||
break;
|
||||
|
||||
case bounceCeilingCrush:
|
||||
ceiling->speed = abs(line->dx); // same speed as elevateContinuous
|
||||
ceiling->speed = FixedDiv(ceiling->speed,4*FRACUNIT);
|
||||
ceiling->speed = line->args[2] << (FRACBITS - 2); // same speed as elevateContinuous
|
||||
ceiling->origspeed = ceiling->speed;
|
||||
if (line->frontsector->ceilingheight >= sec->ceilingheight) // Move up
|
||||
{
|
||||
|
@ -381,8 +337,8 @@ INT32 EV_DoCeiling(mtag_t tag, line_t *line, ceiling_e type)
|
|||
}
|
||||
|
||||
// Any delay?
|
||||
ceiling->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
|
||||
ceiling->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
|
||||
ceiling->delay = line->args[5];
|
||||
ceiling->delaytimer = line->args[4]; // Initial delay
|
||||
|
||||
ceiling->texture = (fixed_t)(line - lines); // hack: use texture to store sourceline number
|
||||
break;
|
||||
|
|
|
@ -202,24 +202,16 @@ void T_MoveFloor(floormove_t *movefloor)
|
|||
remove = true;
|
||||
break;
|
||||
case bounceFloor: // Graue 03-12-2004
|
||||
if (movefloor->floordestheight == lines[movefloor->texture].frontsector->floorheight)
|
||||
movefloor->floordestheight = lines[movefloor->texture].backsector->floorheight;
|
||||
else
|
||||
movefloor->floordestheight = lines[movefloor->texture].frontsector->floorheight;
|
||||
movefloor->direction = (movefloor->floordestheight < movefloor->sector->floorheight) ? -1 : 1;
|
||||
movefloor->delaytimer = movefloor->delay;
|
||||
remove = false;
|
||||
break;
|
||||
case bounceFloorCrush: // Graue 03-27-2004
|
||||
if (movefloor->floordestheight == lines[movefloor->texture].frontsector->floorheight)
|
||||
{
|
||||
movefloor->floordestheight = lines[movefloor->texture].backsector->floorheight;
|
||||
movefloor->speed = movefloor->origspeed = FixedDiv(abs(lines[movefloor->texture].dy), 4*FRACUNIT); // return trip, use dy
|
||||
movefloor->speed = movefloor->origspeed = lines[movefloor->texture].args[3] << (FRACBITS - 2); // return trip, use args[3]
|
||||
}
|
||||
else
|
||||
{
|
||||
movefloor->floordestheight = lines[movefloor->texture].frontsector->floorheight;
|
||||
movefloor->speed = movefloor->origspeed = FixedDiv(abs(lines[movefloor->texture].dx), 4*FRACUNIT); // forward again, use dx
|
||||
movefloor->speed = movefloor->origspeed = lines[movefloor->texture].args[2] << (FRACBITS - 2); // forward again, use args[2]
|
||||
}
|
||||
movefloor->direction = (movefloor->floordestheight < movefloor->sector->floorheight) ? -1 : 1;
|
||||
movefloor->delaytimer = movefloor->delay;
|
||||
|
@ -1850,32 +1842,11 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
|
|||
dofloor->direction = -1; // down
|
||||
break;
|
||||
|
||||
// Linetypes 2/3.
|
||||
// Move floor up and down indefinitely like the old elevators.
|
||||
// Move floor up and down indefinitely.
|
||||
// bounceFloor has slowdown at the top and bottom of movement.
|
||||
case bounceFloor:
|
||||
dofloor->speed = P_AproxDistance(line->dx, line->dy); // same speed as elevateContinuous
|
||||
dofloor->speed = FixedDiv(dofloor->speed,4*FRACUNIT);
|
||||
dofloor->origspeed = dofloor->speed; // it gets slowed down at the top and bottom
|
||||
dofloor->floordestheight = line->frontsector->floorheight;
|
||||
|
||||
if (dofloor->floordestheight >= sec->floorheight)
|
||||
dofloor->direction = 1; // up
|
||||
else
|
||||
dofloor->direction = -1; // down
|
||||
|
||||
// Any delay?
|
||||
dofloor->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
|
||||
dofloor->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
|
||||
|
||||
dofloor->texture = (fixed_t)(line - lines); // hack: store source line number
|
||||
break;
|
||||
|
||||
// Linetypes 6/7.
|
||||
// Like 2/3, but no slowdown at the top and bottom of movement,
|
||||
// and the speed is line->dx the first way, line->dy for the
|
||||
// return trip. Good for crushers.
|
||||
case bounceFloorCrush:
|
||||
dofloor->speed = FixedDiv(abs(line->dx),4*FRACUNIT);
|
||||
dofloor->speed = line->args[2] << (FRACBITS - 2); // same speed as elevateContinuous
|
||||
dofloor->origspeed = dofloor->speed;
|
||||
dofloor->floordestheight = line->frontsector->floorheight;
|
||||
|
||||
|
@ -1885,8 +1856,8 @@ void EV_DoFloor(mtag_t tag, line_t *line, floor_e floortype)
|
|||
dofloor->direction = -1; // down
|
||||
|
||||
// Any delay?
|
||||
dofloor->delay = sides[line->sidenum[0]].textureoffset >> FRACBITS;
|
||||
dofloor->delaytimer = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Initial delay
|
||||
dofloor->delay = line->args[5];
|
||||
dofloor->delaytimer = line->args[4]; // Initial delay
|
||||
|
||||
dofloor->texture = (fixed_t)(line - lines); // hack: store source line number
|
||||
break;
|
||||
|
|
|
@ -3090,6 +3090,10 @@ static void P_ConvertBinaryMap(void)
|
|||
case 55: //Continuous ceiling mover
|
||||
lines[i].args[0] = tag;
|
||||
lines[i].args[1] = (lines[i].special == 53) ? 2 : lines[i].special - 54;
|
||||
lines[i].args[2] = P_AproxDistance(lines[i].dx, lines[i].dy) >> FRACBITS;
|
||||
lines[i].args[3] = lines[i].args[2];
|
||||
lines[i].args[4] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
|
||||
lines[i].args[5] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||
lines[i].special = 53;
|
||||
break;
|
||||
case 56: //Continuous two-speed floor/ceiling mover
|
||||
|
@ -3097,6 +3101,10 @@ static void P_ConvertBinaryMap(void)
|
|||
case 58: //Continuous two-speed ceiling mover
|
||||
lines[i].args[0] = tag;
|
||||
lines[i].args[1] = (lines[i].special == 56) ? 2 : lines[i].special - 57;
|
||||
lines[i].args[2] = abs(lines[i].dx) >> FRACBITS;
|
||||
lines[i].args[3] = abs(lines[i].dy) >> FRACBITS;
|
||||
lines[i].args[4] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
|
||||
lines[i].args[5] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||
lines[i].special = 56;
|
||||
break;
|
||||
case 59: //Activate moving platform
|
||||
|
|
Loading…
Reference in a new issue