- disable weapon interpolation for offset changes.

This has been causing far too many problems so now it will only be done if a A_Weaponoffset is either used with WOF_ADD or WOF_INTERPOLATE.
This commit is contained in:
Christoph Oelckers 2016-12-08 17:51:13 +01:00
parent fb4e34d178
commit a4d2468d34
2 changed files with 7 additions and 2 deletions

View file

@ -390,13 +390,14 @@ void DPSprite::SetState(FState *newstate, bool pending)
if (ID != PSP_FLASH) if (ID != PSP_FLASH)
{ // It's still possible to set the flash layer's offsets with the action function. { // It's still possible to set the flash layer's offsets with the action function.
// Anything going through here cannot be reliably interpolated so this has to reset the interpolation coordinates if it changes the values.
if (newstate->GetMisc1()) if (newstate->GetMisc1())
{ // Set coordinates. { // Set coordinates.
x = newstate->GetMisc1(); oldx = x = newstate->GetMisc1();
} }
if (newstate->GetMisc2()) if (newstate->GetMisc2())
{ {
y = newstate->GetMisc2(); oldy = y = newstate->GetMisc2();
} }
} }
@ -1041,6 +1042,7 @@ enum WOFFlags
WOF_KEEPX = 1, WOF_KEEPX = 1,
WOF_KEEPY = 1 << 1, WOF_KEEPY = 1 << 1,
WOF_ADD = 1 << 2, WOF_ADD = 1 << 2,
WOF_INTERPOLATE = 1 << 3,
}; };
void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags) void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
@ -1069,6 +1071,7 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
else else
{ {
psp->x = wx; psp->x = wx;
if (!(flags & WOF_INTERPOLATE)) psp->oldx = psp->x;
} }
} }
if (!(flags & WOF_KEEPY)) if (!(flags & WOF_KEEPY))
@ -1080,6 +1083,7 @@ void A_OverlayOffset(AActor *self, int layer, double wx, double wy, int flags)
else else
{ {
psp->y = wy; psp->y = wy;
if (!(flags & WOF_INTERPOLATE)) psp->oldy = psp->y;
} }
} }
} }

View file

@ -703,6 +703,7 @@ enum EWeaponOffsetFlags
WOF_KEEPX = 1, WOF_KEEPX = 1,
WOF_KEEPY = 1 << 1, WOF_KEEPY = 1 << 1,
WOF_ADD = 1 << 2, WOF_ADD = 1 << 2,
WOF_INTERPOLATE = 1 << 3,
}; };
// Flags for psprite layers // Flags for psprite layers