From 482d7631f4c61d653240a4c8380a86705c7b2fc8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Aug 2010 19:06:33 +0000 Subject: [PATCH] - sorted zspecials.acs properly so one can find all the specials. - added Polyobj_MoveToSpot action specials. They are functionally identical to Polyobj_MoveTo but get the target coordinate from a map spot instead. SVN r2503 (trunk) --- src/actionspecials.h | 6 ++++-- src/p_lnspec.cpp | 28 +++++++++++++++++++++++----- src/p_local.h | 2 +- src/po_man.cpp | 6 ++---- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/actionspecials.h b/src/actionspecials.h index 392efecb47..7f855147ef 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -57,7 +57,7 @@ DEFINE_SPECIAL(Line_SetBlocking, 55, 3, 3, 3) DEFINE_SPECIAL(Line_SetTextureScale, 56, 5, 5, 5) DEFINE_SPECIAL(Sector_SetPortal, 57, -1, -1, 5) DEFINE_SPECIAL(Sector_CopyScroller, 58, -1, -1, 2) - +DEFINE_SPECIAL(Polyobj_OR_MoveToSpot, 59, 3, 3, 3) DEFINE_SPECIAL(Plat_PerpetualRaise, 60, 3, 3, 3) DEFINE_SPECIAL(Plat_Stop, 61, 1, 1, 1) DEFINE_SPECIAL(Plat_DownWaitUpStay, 62, 3, 3, 3) @@ -84,7 +84,7 @@ DEFINE_SPECIAL(ACS_Terminate, 82, 2, 2, 2) DEFINE_SPECIAL(ACS_LockedExecute, 83, 5, 5, 5) DEFINE_SPECIAL(ACS_ExecuteWithResult, 84, 1, 4, 4) DEFINE_SPECIAL(ACS_LockedExecuteDoor, 85, 5, 5, 5) - +DEFINE_SPECIAL(Polyobj_MoveToSpot, 86, 3, 3, 3) DEFINE_SPECIAL(Polyobj_Stop, 87, 1, 1, 1) DEFINE_SPECIAL(Polyobj_MoveTo, 88, 4, 4, 4) DEFINE_SPECIAL(Polyobj_OR_MoveTo, 89, 4, 4, 4) @@ -114,7 +114,9 @@ DEFINE_SPECIAL(Plane_Copy, 118, -1, -1, 5) DEFINE_SPECIAL(Thing_Damage, 119, 2, 3, 3) DEFINE_SPECIAL(Radius_Quake, 120, 5, 5, 5) // Earthquake DEFINE_SPECIAL(Line_SetIdentification, 121, -1, -1, 5) + DEFINE_SPECIAL(Thing_Move, 125, 2, 3, 3) + DEFINE_SPECIAL(Thing_SetSpecial, 127, 5, 5, 5) DEFINE_SPECIAL(ThrustThingZ, 128, 4, 4, 4) DEFINE_SPECIAL(UsePuzzleItem, 129, 2, 5, 5) diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 61df5806d1..72bea5c499 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -124,7 +124,16 @@ FUNC(LS_Polyobj_MoveTimes8) FUNC(LS_Polyobj_MoveTo) // Polyobj_MoveTo (po, speed, x, y) { - return EV_MovePolyTo (ln, arg0, SPEED(arg1), arg2, arg3, false); + return EV_MovePolyTo (ln, arg0, SPEED(arg1), arg2 << FRACBITS, arg3 << FRACBITS, false); +} + +FUNC(LS_Polyobj_MoveToSpot) +// Polyobj_MoveToSpot (po, speed, tid) +{ + FActorIterator iterator (arg2); + AActor *spot = iterator.Next(); + if (spot == NULL) return false; + return EV_MovePolyTo (ln, arg0, SPEED(arg1), spot->x, spot->y, false); } FUNC(LS_Polyobj_DoorSwing) @@ -166,7 +175,16 @@ FUNC(LS_Polyobj_OR_MoveTimes8) FUNC(LS_Polyobj_OR_MoveTo) // Polyobj_OR_MoveTo (po, speed, x, y) { - return EV_MovePolyTo (ln, arg0, SPEED(arg1), arg2, arg3, true); + return EV_MovePolyTo (ln, arg0, SPEED(arg1), arg2 << FRACBITS, arg3 << FRACBITS, true); +} + +FUNC(LS_Polyobj_OR_MoveToSpot) +// Polyobj_OR_MoveToSpot (po, speed, tid) +{ + FActorIterator iterator (arg2); + AActor *spot = iterator.Next(); + if (spot == NULL) return false; + return EV_MovePolyTo (ln, arg0, SPEED(arg1), spot->x, spot->y, true); } FUNC(LS_Polyobj_Stop) @@ -3049,8 +3067,8 @@ lnSpecFunc LineSpecials[256] = /* 55 */ LS_Line_SetBlocking, /* 56 */ LS_Line_SetTextureScale, /* 57 */ LS_NOP, // Sector_SetPortal - /* 58 */ LS_NOP, - /* 59 */ LS_NOP, + /* 58 */ LS_NOP, // Sector_CopyScroller + /* 59 */ LS_Polyobj_OR_MoveToSpot, /* 60 */ LS_Plat_PerpetualRaise, /* 61 */ LS_Plat_Stop, /* 62 */ LS_Plat_DownWaitUpStay, @@ -3077,7 +3095,7 @@ lnSpecFunc LineSpecials[256] = /* 83 */ LS_ACS_LockedExecute, /* 84 */ LS_ACS_ExecuteWithResult, /* 85 */ LS_ACS_LockedExecuteDoor, - /* 86 */ LS_NOP, + /* 86 */ LS_Polyobj_MoveToSpot, /* 87 */ LS_Polyobj_Stop, /* 88 */ LS_Polyobj_MoveTo, /* 89 */ LS_Polyobj_OR_MoveTo, diff --git a/src/p_local.h b/src/p_local.h index 6978be19d4..91b134605a 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -506,7 +506,7 @@ typedef enum bool EV_RotatePoly (line_t *line, int polyNum, int speed, int byteAngle, int direction, bool overRide); bool EV_MovePoly (line_t *line, int polyNum, int speed, angle_t angle, fixed_t dist, bool overRide); -bool EV_MovePolyTo (line_t *line, int polyNum, int speed, int x, int y, bool overRide); +bool EV_MovePolyTo (line_t *line, int polyNum, int speed, fixed_t x, fixed_t y, bool overRide); bool EV_OpenPolyDoor (line_t *line, int polyNum, int speed, angle_t angle, int delay, int distance, podoortype_t type); bool EV_StopPoly (int polyNum); diff --git a/src/po_man.cpp b/src/po_man.cpp index e0597190cb..1ca8d9a3aa 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -120,7 +120,7 @@ protected: fixed_t m_xTarget; fixed_t m_yTarget; - friend bool EV_MovePolyTo(line_t *line, int polyNum, int speed, int x, int y, bool overRide); + friend bool EV_MovePolyTo(line_t *line, int polyNum, int speed, fixed_t x, fixed_t y, bool overRide); }; @@ -605,10 +605,8 @@ void DMovePolyTo::Tick () // //========================================================================== -bool EV_MovePolyTo(line_t *line, int polyNum, int speed, int ix, int iy, bool overRide) +bool EV_MovePolyTo(line_t *line, int polyNum, int speed, fixed_t targx, fixed_t targy, bool overRide) { - fixed_t targx = ix << FRACBITS; - fixed_t targy = iy << FRACBITS; int mirror; DMovePolyTo *pe; FPolyObj *poly;