polywaypointdata_t: Turn reverse and continuous into flags
This commit is contained in:
parent
06dda9c69d
commit
536e355cdf
|
@ -2154,11 +2154,12 @@ boolean EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||||
// set fields
|
// set fields
|
||||||
th->polyObjNum = pwdata->polyObjNum;
|
th->polyObjNum = pwdata->polyObjNum;
|
||||||
th->speed = pwdata->speed;
|
th->speed = pwdata->speed;
|
||||||
th->sequence = pwdata->sequence; // Used to specify sequence #
|
th->sequence = pwdata->sequence;
|
||||||
th->direction = pwdata->reverse ? -1 : 1;
|
th->direction = (pwdata->flags & PWF_REVERSE) ? -1 : 1;
|
||||||
|
|
||||||
th->returnbehavior = pwdata->returnbehavior;
|
th->returnbehavior = pwdata->returnbehavior;
|
||||||
th->continuous = pwdata->continuous;
|
if (pwdata->flags & PWF_LOOP)
|
||||||
|
th->continuous = true;
|
||||||
th->stophere = false;
|
th->stophere = false;
|
||||||
|
|
||||||
// Find the first waypoint we need to use
|
// Find the first waypoint we need to use
|
||||||
|
@ -2172,11 +2173,8 @@ boolean EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set pointnum
|
|
||||||
th->pointnum = first->health;
|
th->pointnum = first->health;
|
||||||
|
|
||||||
// We don't deal with the mirror crap here, we'll
|
|
||||||
// handle that in the T_Thinker function.
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -254,14 +254,19 @@ typedef struct polymovedata_s
|
||||||
UINT8 overRide; // if true, will override any action on the object
|
UINT8 overRide; // if true, will override any action on the object
|
||||||
} polymovedata_t;
|
} polymovedata_t;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
PWF_REVERSE = 1, // Move through waypoints in reverse order
|
||||||
|
PWF_LOOP = 1<<1, // Loop movement (used with PWR_WRAP or PWR_COMEBACK)
|
||||||
|
} polywaypointflags_e;
|
||||||
|
|
||||||
typedef struct polywaypointdata_s
|
typedef struct polywaypointdata_s
|
||||||
{
|
{
|
||||||
INT32 polyObjNum; // numeric id of polyobject to affect
|
INT32 polyObjNum; // numeric id of polyobject to affect
|
||||||
INT32 sequence; // waypoint sequence #
|
INT32 sequence; // waypoint sequence #
|
||||||
fixed_t speed; // linear speed
|
fixed_t speed; // linear speed
|
||||||
UINT8 reverse; // if true, will go in reverse waypoint order
|
|
||||||
UINT8 returnbehavior; // behavior after reaching the last waypoint
|
UINT8 returnbehavior; // behavior after reaching the last waypoint
|
||||||
UINT8 continuous; // continuously move - used with PWR_WRAP or PWR_COMEBACK
|
UINT8 flags; // PWF_ flags
|
||||||
} polywaypointdata_t;
|
} polywaypointdata_t;
|
||||||
|
|
||||||
// polyobject door types
|
// polyobject door types
|
||||||
|
|
|
@ -1276,7 +1276,6 @@ static boolean PolyWaypoint(line_t *line)
|
||||||
pwd.polyObjNum = line->tag;
|
pwd.polyObjNum = line->tag;
|
||||||
pwd.speed = sides[line->sidenum[0]].textureoffset / 8;
|
pwd.speed = sides[line->sidenum[0]].textureoffset / 8;
|
||||||
pwd.sequence = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Sequence #
|
pwd.sequence = sides[line->sidenum[0]].rowoffset >> FRACBITS; // Sequence #
|
||||||
pwd.reverse = (line->flags & ML_EFFECT1) == ML_EFFECT1; // Reverse?
|
|
||||||
|
|
||||||
// Behavior after reaching the last waypoint?
|
// Behavior after reaching the last waypoint?
|
||||||
if (line->flags & ML_EFFECT3)
|
if (line->flags & ML_EFFECT3)
|
||||||
|
@ -1286,7 +1285,12 @@ static boolean PolyWaypoint(line_t *line)
|
||||||
else
|
else
|
||||||
pwd.returnbehavior = PWR_STOP; // Stop
|
pwd.returnbehavior = PWR_STOP; // Stop
|
||||||
|
|
||||||
pwd.continuous = (line->flags & ML_EFFECT4) == ML_EFFECT4; // Continuously move - used with PWR_WRAP or PWR_COMEBACK
|
// Flags
|
||||||
|
pwd.flags = 0;
|
||||||
|
if (line->flags & ML_EFFECT1)
|
||||||
|
pwd.flags |= PWF_REVERSE;
|
||||||
|
if (line->flags & ML_EFFECT4)
|
||||||
|
pwd.flags |= PWF_LOOP;
|
||||||
|
|
||||||
return EV_DoPolyObjWaypoint(&pwd);
|
return EV_DoPolyObjWaypoint(&pwd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue