- fixed: Movement performed by actor movers was not interpolated because
it happened outside the moved actor's Tick function. This got particularly obvious with moving skybox viewpoints (See Daedalus's MAP21 intro for a good example.) SVN r2059 (trunk)
This commit is contained in:
parent
66c2e4b540
commit
26c33afafb
9 changed files with 62 additions and 27 deletions
|
|
@ -434,9 +434,10 @@ void AActor::Serialize (FArchive &arc)
|
|||
Speed = GetDefault()->Speed;
|
||||
}
|
||||
}
|
||||
PrevX = x;
|
||||
PrevY = y;
|
||||
PrevZ = z;
|
||||
LastX = PrevX = x;
|
||||
LastY = PrevY = y;
|
||||
LastZ = PrevZ = z;
|
||||
LastAngle = PrevAngle = angle;
|
||||
UpdateWaterLevel(z, false);
|
||||
}
|
||||
}
|
||||
|
|
@ -2805,7 +2806,7 @@ void AActor::SetShade (int r, int g, int b)
|
|||
//
|
||||
// P_MobjThinker
|
||||
//
|
||||
void AActor::Tick ()
|
||||
void AActor::DoTick ()
|
||||
{
|
||||
// [RH] Data for Heretic/Hexen scrolling sectors
|
||||
static const BYTE HexenScrollDirs[8] = { 64, 0, 192, 128, 96, 32, 224, 160 };
|
||||
|
|
@ -2835,10 +2836,6 @@ void AActor::Tick ()
|
|||
return;
|
||||
}
|
||||
|
||||
PrevX = x;
|
||||
PrevY = y;
|
||||
PrevZ = z;
|
||||
|
||||
if (flags5 & MF5_NOINTERACTION)
|
||||
{
|
||||
// only do the minimally necessary things here to save time:
|
||||
|
|
@ -3378,6 +3375,23 @@ void AActor::Tick ()
|
|||
}
|
||||
}
|
||||
|
||||
void AActor::Tick()
|
||||
{
|
||||
// This is necessary to properly interpolate movement outside this function
|
||||
// like from an ActorMover
|
||||
PrevX = LastX;
|
||||
PrevY = LastY;
|
||||
PrevZ = LastZ;
|
||||
PrevAngle = LastAngle;
|
||||
|
||||
DoTick();
|
||||
|
||||
LastX = x;
|
||||
LastY = y;
|
||||
LastZ = z;
|
||||
LastAngle = angle;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AActor::UpdateWaterLevel
|
||||
|
|
@ -3517,9 +3531,9 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
|
||||
actor = static_cast<AActor *>(const_cast<PClass *>(type)->CreateNew ());
|
||||
|
||||
actor->x = actor->PrevX = ix;
|
||||
actor->y = actor->PrevY = iy;
|
||||
actor->z = actor->PrevZ = iz;
|
||||
actor->x = actor->LastX = actor->PrevX = ix;
|
||||
actor->y = actor->LastY = actor->PrevY = iy;
|
||||
actor->z = actor->LastZ = actor->PrevZ = iz;
|
||||
actor->picnum.SetInvalid();
|
||||
actor->health = actor->SpawnHealth();
|
||||
|
||||
|
|
@ -3735,6 +3749,11 @@ void AActor::BeginPlay ()
|
|||
}
|
||||
}
|
||||
|
||||
void AActor::PostBeginPlay ()
|
||||
{
|
||||
PrevAngle = angle;
|
||||
}
|
||||
|
||||
bool AActor::isFast()
|
||||
{
|
||||
if (flags5&MF5_ALWAYSFAST) return true;
|
||||
|
|
@ -4399,7 +4418,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
mobj->tid = mthing->thingid;
|
||||
mobj->AddToHash ();
|
||||
|
||||
mobj->angle = (DWORD)((mthing->angle * UCONST64(0x100000000)) / 360);
|
||||
mobj->LastAngle = mobj->PrevAngle = mobj->angle = (DWORD)((mthing->angle * UCONST64(0x100000000)) / 360);
|
||||
mobj->BeginPlay ();
|
||||
if (!(mobj->ObjectFlags & OF_EuthanizeMe))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue