Support for StartAnimation,WarpToFinal,BlendToFinal

This commit is contained in:
2023-09-15 15:44:01 -04:00
parent cd3c82f2c4
commit fb65d23230
5 changed files with 124 additions and 78 deletions

View File

@@ -10,12 +10,37 @@
//
////////////////////////////////////////////////
enum ElxAnimValueType {
T_STRING,
T_NUMBER,
T_BOOLEAN,
T_XYZ,
T_UNINITIALIZED
enum class ElxAnimValueType {
STRING,
NUMBER,
BOOLEAN,
XYZ,
INVALID
};
////////////////////////////////////////////////
//
// Playback Modes
//
// There are three different ways to play an animation:
//
// 1. Start Animation. This is the normal way to play an animation.
//
// 2. Warp to Final. Skip the actual animation, and jump
// instantaneously to the final state of the animation.
//
// 3. Blend to Final. Skip the actual animation, and blend
// smoothly to the final state of the animation. If the current
// state is very far from the final state, then maybe jump instantaneously
// instead.
//
////////////////////////////////////////////////
enum class ElxAnimPlaybackMode {
START_ANIMATION,
WARP_TO_FINAL,
BLEND_TO_FINAL,
INVALID,
};
////////////////////////////////////////////////
@@ -167,7 +192,12 @@ public:
//
int32 UnstartedSeqno;
// Indicates whether the unstarted animation should be played or otherwise.
//
ElxAnimPlaybackMode PlaybackMode;
// Array of recently-aborted hash values.
//
TArray<uint64> AbortedHashes;
public:
@@ -191,19 +221,17 @@ public:
//
TArray<uint64> GetAborted();
// Return true if there are any unstarted animation steps.
//
bool AnyUnstarted();
// Get the next unstarted animation step.
//
// You may only call this if AnyUnstarted returns true.
// Get the next animation step. Returns the next step and the
// playback mode. If the playback mode is INVALID then there is
// no next step to play
//
FlxAnimStoredStep GetUnstarted();
ElxAnimPlaybackMode GetNextStep(FlxAnimStoredStep& step);
// Declare that an animation has been started.
//
// After starting an animation, you should call this.
//
void Started(uint64 Hash);
void StartedStep(uint64 Hash);
};