mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Adapt polyobject waypoint movement linedef to UDMF
This commit is contained in:
parent
6e9afabd44
commit
2cbda0e5ac
3 changed files with 60 additions and 18 deletions
|
@ -2853,6 +2853,46 @@ udmf
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
488
|
||||
{
|
||||
title = "Move by Waypoints";
|
||||
prefix = "(488)";
|
||||
arg0
|
||||
{
|
||||
title = "PolyObject ID";
|
||||
type = 14;
|
||||
}
|
||||
arg1
|
||||
{
|
||||
title = "Speed";
|
||||
}
|
||||
arg2
|
||||
{
|
||||
title = "Waypoint sequence";
|
||||
}
|
||||
arg3
|
||||
{
|
||||
title = "Return behavior";
|
||||
type = 11;
|
||||
enum
|
||||
{
|
||||
0 = "Don't return";
|
||||
1 = "Return to first waypoint";
|
||||
2 = "Repeat sequence in reverse";
|
||||
}
|
||||
}
|
||||
arg4
|
||||
{
|
||||
title = "Flags";
|
||||
type = 12;
|
||||
enum
|
||||
{
|
||||
1 = "Move in reverse";
|
||||
2 = "Loop movement";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scrollpush
|
||||
|
|
|
@ -3700,6 +3700,21 @@ static void P_ConvertBinaryMap(void)
|
|||
lines[i].args[3] |= TMPR_OVERRIDE;
|
||||
lines[i].special = 484;
|
||||
break;
|
||||
case 488: //Polyobject - move by waypoints
|
||||
lines[i].args[0] = tag;
|
||||
lines[i].args[1] = sides[lines[i].sidenum[0]].textureoffset >> FRACBITS;
|
||||
lines[i].args[2] = sides[lines[i].sidenum[0]].rowoffset >> FRACBITS;
|
||||
if (lines[i].flags & ML_EFFECT3)
|
||||
lines[i].args[3] = PWR_WRAP;
|
||||
else if (lines[i].flags & ML_EFFECT2)
|
||||
lines[i].args[3] = PWR_COMEBACK;
|
||||
else
|
||||
lines[i].args[3] = PWR_STOP;
|
||||
if (lines[i].flags & ML_EFFECT1)
|
||||
lines[i].args[4] |= PWF_REVERSE;
|
||||
if (lines[i].flags & ML_EFFECT4)
|
||||
lines[i].args[4] |= PWF_LOOP;
|
||||
break;
|
||||
case 500: //Scroll front wall left
|
||||
case 501: //Scroll front wall right
|
||||
lines[i].args[0] = 0;
|
||||
|
|
23
src/p_spec.c
23
src/p_spec.c
|
@ -1178,24 +1178,11 @@ static boolean PolyWaypoint(line_t *line)
|
|||
{
|
||||
polywaypointdata_t pwd;
|
||||
|
||||
pwd.polyObjNum = Tag_FGet(&line->tags);
|
||||
pwd.speed = sides[line->sidenum[0]].textureoffset / 8;
|
||||
pwd.sequence = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Sequence #
|
||||
|
||||
// Behavior after reaching the last waypoint?
|
||||
if (line->flags & ML_EFFECT3)
|
||||
pwd.returnbehavior = PWR_WRAP; // Wrap back to first waypoint
|
||||
else if (line->flags & ML_EFFECT2)
|
||||
pwd.returnbehavior = PWR_COMEBACK; // Go through sequence in reverse
|
||||
else
|
||||
pwd.returnbehavior = PWR_STOP; // Stop
|
||||
|
||||
// Flags
|
||||
pwd.flags = 0;
|
||||
if (line->flags & ML_EFFECT1)
|
||||
pwd.flags |= PWF_REVERSE;
|
||||
if (line->flags & ML_EFFECT4)
|
||||
pwd.flags |= PWF_LOOP;
|
||||
pwd.polyObjNum = line->args[0];
|
||||
pwd.speed = line->args[1] << (FRACBITS - 3);
|
||||
pwd.sequence = line->args[2];
|
||||
pwd.returnbehavior = line->args[3];
|
||||
pwd.flags = line->args[4];
|
||||
|
||||
return EV_DoPolyObjWaypoint(&pwd);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue