made some changes to turn the CF_INTERPVIEW flag when changing angles into an op-in feature instead of making it automatic.

This commit is contained in:
Christoph Oelckers 2014-05-08 09:15:56 +02:00
parent 1f723c10ae
commit 67ebbe3ed4
5 changed files with 21 additions and 18 deletions

View file

@ -8251,7 +8251,7 @@ scriptwait:
{ {
if (activator != NULL) if (activator != NULL)
{ {
activator->SetAngle(STACK(1) << 16); activator->SetAngle(STACK(1) << 16, false);
} }
} }
else else
@ -8261,7 +8261,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;
@ -8272,7 +8272,7 @@ scriptwait:
{ {
if (activator != NULL) if (activator != NULL)
{ {
activator->SetPitch(STACK(1) << 16); activator->SetPitch(STACK(1) << 16, false);
} }
} }
else else
@ -8282,7 +8282,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

@ -2962,24 +2962,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

@ -3930,12 +3930,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));
} }
//=========================================================================== //===========================================================================
@ -3946,11 +3953,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);
@ -3973,7 +3975,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

@ -304,8 +304,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