Merge branch 'interpview_optin'

This commit is contained in:
Christoph Oelckers 2014-05-08 09:17:00 +02:00
commit 63a0e01c6a
5 changed files with 21 additions and 18 deletions

View file

@ -8327,7 +8327,7 @@ scriptwait:
{ {
if (activator != NULL) if (activator != NULL)
{ {
activator->SetAngle(STACK(1) << 16); activator->SetAngle(STACK(1) << 16, false);
} }
} }
else else
@ -8337,7 +8337,7 @@ scriptwait:
while ( (actor = iterator.Next ()) ) while ( (actor = iterator.Next ()) )
{ {
actor->SetAngle(STACK(1) << 16); actor->SetAngle(STACK(1) << 16, false);
} }
} }
sp -= 2; sp -= 2;
@ -8348,7 +8348,7 @@ scriptwait:
{ {
if (activator != NULL) if (activator != NULL)
{ {
activator->SetPitch(STACK(1) << 16); activator->SetPitch(STACK(1) << 16, false);
} }
} }
else else
@ -8358,7 +8358,7 @@ scriptwait:
while ( (actor = iterator.Next ()) ) while ( (actor = iterator.Next ()) )
{ {
actor->SetPitch(STACK(1) << 16); actor->SetPitch(STACK(1) << 16, false);
} }
} }
sp -= 2; sp -= 2;

View file

@ -2974,24 +2974,24 @@ void AActor::SetShade (int r, int g, int b)
fillcolor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b); fillcolor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);
} }
void AActor::SetPitch(int p) void AActor::SetPitch(int p, bool interpolate)
{ {
if (p != pitch) if (p != pitch)
{ {
pitch = p; pitch = p;
if (player != NULL) if (player != NULL && interpolate)
{ {
player->cheats |= CF_INTERPVIEW; player->cheats |= CF_INTERPVIEW;
} }
} }
} }
void AActor::SetAngle(angle_t ang) void AActor::SetAngle(angle_t ang, bool interpolate)
{ {
if (ang != angle) if (ang != angle)
{ {
angle = ang; angle = ang;
if (player != NULL) if (player != NULL && interpolate)
{ {
player->cheats |= CF_INTERPVIEW; player->cheats |= CF_INTERPVIEW;
} }

View file

@ -3931,12 +3931,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MonsterRefire)
// Set actor's angle (in degrees). // Set actor's angle (in degrees).
// //
//=========================================================================== //===========================================================================
enum
{
SPF_FORCECLAMP = 1, // players always clamp
SPF_INTERPOLATE = 2,
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle)
{ {
ACTION_PARAM_START(1); ACTION_PARAM_START(2);
ACTION_PARAM_ANGLE(angle, 0); ACTION_PARAM_ANGLE(angle, 0);
self->SetAngle(angle); ACTION_PARAM_INT(flags, 1)
self->SetAngle(angle, !!(flags & SPF_INTERPOLATE));
} }
//=========================================================================== //===========================================================================
@ -3947,11 +3954,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetAngle)
// //
//=========================================================================== //===========================================================================
enum
{
SPF_FORCECLAMP = 1, // players always clamp
};
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch) DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
{ {
ACTION_PARAM_START(2); ACTION_PARAM_START(2);
@ -3974,7 +3976,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetPitch)
} }
pitch = clamp<int>(pitch, min, max); pitch = clamp<int>(pitch, min, max);
} }
self->SetPitch(pitch); self->SetPitch(pitch, !!(flags & SPF_INTERPOLATE));
} }
//=========================================================================== //===========================================================================

View file

@ -289,7 +289,7 @@ ACTOR Actor native //: Thinker
action native A_DropWeaponPieces(class<Actor> p1, class<Actor> p2, class<Actor> p3); action native A_DropWeaponPieces(class<Actor> p1, class<Actor> p2, class<Actor> p3);
action native A_PigPain (); action native A_PigPain ();
action native A_MonsterRefire(int chance, state label); action native A_MonsterRefire(int chance, state label);
action native A_SetAngle(float angle = 0); action native A_SetAngle(float angle = 0, int flags = 0);
action native A_SetPitch(float pitch, int flags = 0); action native A_SetPitch(float pitch, int flags = 0);
action native A_ScaleVelocity(float scale); action native A_ScaleVelocity(float scale);
action native A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0); action native A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0);

View file

@ -307,8 +307,9 @@ Const Int WARPF_STOP = 0x80;
Const Int WARPF_TOFLOOR = 0x100; Const Int WARPF_TOFLOOR = 0x100;
Const Int WARPF_TESTONLY = 0x200; Const Int WARPF_TESTONLY = 0x200;
// flags for A_SetPitch // flags for A_SetPitch/SetAngle
const int SPF_FORCECLAMP = 1; const int SPF_FORCECLAMP = 1;
const int SPF_INTERPOLATE = 2;
// flags for A_CheckLOF // flags for A_CheckLOF