NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
fanm.hpp
1#pragma once
2#include <game/mLib/m_3d/banm.hpp>
3
4namespace m3d {
5
6 /// @brief Animation object.
7 class fanm_c : public banm_c {
8 public:
9 fanm_c(); ///< Constructs an animation object.
10 virtual ~fanm_c(); ///< Destroys the animation object.
11
12 /// @brief Updates the animation.
13 /// Call this function every frame to update the animation.
14 virtual void play();
15
16 /**
17 * @brief Starts the animation with the given parameters.
18 *
19 * @param duration The number of frames in the animation.
20 * @param playMode The play mode of the animation.
21 * @param updateRate The speed of the animation.
22 * @param startFrame The starting frame of the animation. Set to -1 to start from the beginning.
23 */
24 void set(float duration, m3d::playMode_e playMode, float updateRate, float startFrame);
25
26 /// @brief Jumps to the specified frame in the animation.
27 /// @param frame The frame to jump to.
28 void setFrame(float frame);
29
30 /// @brief Checks whether the animation is stopped.
31 bool isStop() const;
32
33 /// @brief Checks whether the animation has reached the specified frame.
34 /// @param frame The frame to check.
35 bool checkFrame(float frame) const;
36
37 float mFrameMax; ///< The last frame number of the animation.
38 float mFrameStart; ///< The first frame number of the animation.
39 float mCurrFrame; ///< The frame the animation is currently on.
40 u8 mPlayMode; ///< The play mode of the animation.
41 };
42}
virtual void play()
Updates the animation. Call this function every frame to update the animation.
Definition fanm.cpp:11
float mCurrFrame
The frame the animation is currently on.
Definition fanm.hpp:39
bool isStop() const
Checks whether the animation is stopped.
Definition fanm.cpp:76
void setFrame(float frame)
Jumps to the specified frame in the animation.
Definition fanm.cpp:71
virtual ~fanm_c()
Destroys the animation object.
Definition fanm.cpp:9
fanm_c()
Constructs an animation object.
Definition fanm.cpp:3
bool checkFrame(float frame) const
Checks whether the animation has reached the specified frame.
Definition fanm.cpp:90
float mFrameMax
The last frame number of the animation.
Definition fanm.hpp:37
u8 mPlayMode
The play mode of the animation.
Definition fanm.hpp:40
float mFrameStart
The first frame number of the animation.
Definition fanm.hpp:38
void set(float duration, m3d::playMode_e playMode, float updateRate, float startFrame)
Starts the animation with the given parameters.
Definition fanm.cpp:51
mLib 3D library
Definition anm_chr.hpp:5
playMode_e
Definition banm.hpp:7