1#include <game/mLib/m_3d.hpp>
12 float frame = mpObj->GetFrame();
13 float updateRate = mpObj->GetUpdateRate();
15 bool updateRateNegative = updateRate < 0.0f;
16 if (updateRateNegative) {
24 if (frame >= updateRate) {
42 if (frame >= endFrame) {
48 mpObj->SetFrame(frame);
52 float frame = startFrame;
53 if (startFrame < 0.0f) {
57 frame = duration - 1.0f;
64 mpObj->SetFrame(frame);
65 mpObj->SetUpdateRate(updateRate);
72 banm_c::setFrameOnly(f);
77 float frame = mpObj->GetFrame();
78 float updateRate = mpObj->GetUpdateRate();
91 float objFrame = mpObj->GetFrame();
96 float updateRate = mpObj->GetUpdateRate();
106 if (f < mCurrFrame || f >= objFrame) {
113 if (mCurrFrame < f && objFrame >= f) {
virtual void play()
Updates the animation. Call this function every frame to update the animation.
float mCurrFrame
The frame the animation is currently on.
bool isStop() const
Checks whether the animation is stopped.
void setFrame(float frame)
Jumps to the specified frame in the animation.
virtual ~fanm_c()
Destroys the animation object.
fanm_c()
Constructs an animation object.
bool checkFrame(float frame) const
Checks whether the animation has reached the specified frame.
float mFrameMax
The last frame number of the animation.
u8 mPlayMode
The play mode of the animation.
float mFrameStart
The first frame number of the animation.
void set(float duration, m3d::playMode_e playMode, float updateRate, float startFrame)
Starts the animation with the given parameters.
@ MASK_FORWARD
Mask for forward play mode.
@ FORWARD_ONCE
Play the animation forward once.
@ FORWARD_LOOP
Play the animation forward in a loop.
@ REVERSE_ONCE
Play the animation in reverse once.
@ MASK_LOOP
Mask for loop play mode.