mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-12 07:14:03 +00:00
misc decoupled animation fixes
This commit is contained in:
parent
a88516bbd2
commit
0087616511
1 changed files with 44 additions and 40 deletions
|
@ -5130,6 +5130,7 @@ enum ESetAnimationFlags
|
|||
|
||||
void SetAnimationInternal(AActor * self, FName animName, double framerate, int startFrame, int loopFrame, int endFrame, int interpolateTics, int flags, double ticFrac)
|
||||
{
|
||||
|
||||
if(!self) ThrowAbortException(X_READ_NIL, "In function parameter self");
|
||||
|
||||
if(!(self->flags9 & MF9_DECOUPLEDANIMATIONS))
|
||||
|
@ -5176,6 +5177,8 @@ void SetAnimationInternal(AActor * self, FName animName, double framerate, int s
|
|||
|
||||
if(!(flags & SAF_INSTANT))
|
||||
{
|
||||
if((self->modelData->curAnim.startTic - self->modelData->curAnim.switchOffset) != int(floor(tic)))
|
||||
{ // don't change interpolation data if animation switch happened in the same tic
|
||||
if(self->modelData->curAnim.startTic > tic)
|
||||
{
|
||||
ModelAnimFrameInterp to;
|
||||
|
@ -5215,6 +5218,7 @@ void SetAnimationInternal(AActor * self, FName animName, double framerate, int s
|
|||
calcFrame(self->modelData->curAnim, tic, std::get<ModelAnimFrameInterp>(self->modelData->prevAnim));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self->modelData->prevAnim = nullptr;
|
||||
|
@ -5524,7 +5528,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_ChangeModel, ChangeModelNative)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimation, SetAnimationNative)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_NAME(animName);
|
||||
PARAM_FLOAT(framerate);
|
||||
PARAM_INT(startFrame);
|
||||
|
@ -5540,7 +5544,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimation, SetAnimationNative)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimationUI, SetAnimationUINative)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_NAME(animName);
|
||||
PARAM_FLOAT(framerate);
|
||||
PARAM_INT(startFrame);
|
||||
|
@ -5556,7 +5560,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimationUI, SetAnimationUINative)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimationFrameRate, SetAnimationFrameRateNative)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_FLOAT(framerate);
|
||||
|
||||
SetAnimationFrameRateInternal(self, framerate, 1);
|
||||
|
@ -5566,7 +5570,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimationFrameRate, SetAnimationFrameRa
|
|||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimationFrameRateUI, SetAnimationFrameRateUINative)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_FLOAT(framerate);
|
||||
|
||||
SetAnimationFrameRateInternal(self, framerate, I_GetTimeFrac());
|
||||
|
@ -5576,7 +5580,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetAnimationFrameRateUI, SetAnimationFrame
|
|||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetModelFlag, SetModelFlag)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_INT(flag);
|
||||
|
||||
SetModelFlag(self, flag);
|
||||
|
@ -5586,7 +5590,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, SetModelFlag, SetModelFlag)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, ClearModelFlag, ClearModelFlag)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
PARAM_INT(flag);
|
||||
|
||||
ClearModelFlag(self, flag);
|
||||
|
@ -5596,7 +5600,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, ClearModelFlag, ClearModelFlag)
|
|||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, ResetModelFlags, ResetModelFlags)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE(AActor);
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
|
||||
ResetModelFlags(self);
|
||||
|
||||
|
|
Loading…
Reference in a new issue