|
NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/bases/d_util_frame_counter.hpp>
A bidirectional frame counter.
Definition at line 9 of file d_util_frame_counter.hpp.
Public Types | |
| enum | Type_e { TYPE_ONETIME , TYPE_LOOP , TYPE_OSCILLATING } |
| The possible behaviors after the frame counter is finished. More... | |
Public Member Functions | |
| FrameCounter_c () | |
| Constructs a new frame counter. | |
| ~FrameCounter_c () | |
| Destroys the frame counter. | |
| void | init (f32 startFrame, f32 endFrame) |
| Initializes the frame interval. | |
| void | play (f32 updateRate, Type_e type, f32 startFrame, f32 endFrame) |
| Fully initializes into a valid state. | |
| void | play (f32 updateRate, Type_e type) |
| Partially initializes into a valid state without initializing the frame interval. | |
| void | calc () |
| Updates the frame counter. | |
| f32 | getFrame () const |
| Gets the current frame. | |
| void | setFrame (f32 frame) |
| Sets the current frame. | |
| f32 | getUpdateRate () const |
| Gets the update rate. | |
| void | setUpdateRate (f32 updateRate) |
| Sets the update rate. | |
| bool | getFinished () const |
| Gets whether the counter is finished. | |
Private Attributes | |
| f32 | m_frame |
| The current frame in the interval [start, end]. | |
| f32 | m_startFrame |
| Lower bound of the frame interval. | |
| f32 | m_endFrame |
| Upper bound of the frame interval. | |
| f32 | m_updateRate |
| Controls the direction and rate at which the frame updates. | |
| bool | m_finished |
| Whether or not the counter is finished. | |
| Type_e | m_type |
| Controls what happens to the frame when it reaches the target frame. | |
The possible behaviors after the frame counter is finished.
| Enumerator | |
|---|---|
| TYPE_ONETIME | Locks the frame to the target frame. |
| TYPE_LOOP | Continues counting in the same direction. |
| TYPE_OSCILLATING | Continues counting in the opposite direction. |
Definition at line 12 of file d_util_frame_counter.hpp.
| Util::FrameCounter_c::FrameCounter_c | ( | ) |
Constructs a new frame counter.
Definition at line 5 of file d_util_frame_counter.cpp.
| Util::FrameCounter_c::~FrameCounter_c | ( | ) |
Destroys the frame counter.
Definition at line 14 of file d_util_frame_counter.cpp.
| void Util::FrameCounter_c::init | ( | f32 | startFrame, |
| f32 | endFrame ) |
Initializes the frame interval.
Sets the current frame to the start frame.
| startFrame | The start frame. |
| endFrame | The end frame. |
Definition at line 16 of file d_util_frame_counter.cpp.
| void Util::FrameCounter_c::play | ( | f32 | updateRate, |
| Type_e | type, | ||
| f32 | startFrame, | ||
| f32 | endFrame ) |
Fully initializes into a valid state.
Sets the current frame to the start frame.
| updateRate | The update rate. |
| type | The play type. |
| startFrame | The start frame. |
| endFrame | The end frame. |
Definition at line 23 of file d_util_frame_counter.cpp.
| void Util::FrameCounter_c::play | ( | f32 | updateRate, |
| Type_e | type ) |
Partially initializes into a valid state without initializing the frame interval.
Sets the current frame to the start frame.
| updateRate | The update rate. |
| type | The play type. |
Definition at line 30 of file d_util_frame_counter.cpp.
| void Util::FrameCounter_c::calc | ( | ) |
Updates the frame counter.
Sets finished to true if the counter finishes.
Definition at line 37 of file d_util_frame_counter.cpp.
|
inline |
Gets the current frame.
Definition at line 47 of file d_util_frame_counter.hpp.
|
inline |
Sets the current frame.
| frame | The new current frame. |
Definition at line 51 of file d_util_frame_counter.hpp.
|
inline |
Gets the update rate.
Definition at line 55 of file d_util_frame_counter.hpp.
|
inline |
Sets the update rate.
| updateRate | The new update rate. |
Definition at line 59 of file d_util_frame_counter.hpp.
|
inline |
Gets whether the counter is finished.
true the counter is finished, otherwise false. Definition at line 63 of file d_util_frame_counter.hpp.
|
private |
|
private |
Lower bound of the frame interval.
Initialized by init and/or play.
Definition at line 74 of file d_util_frame_counter.hpp.
|
private |
Upper bound of the frame interval.
Initialized by init and/or play.
Definition at line 78 of file d_util_frame_counter.hpp.
|
private |
Controls the direction and rate at which the frame updates.
If the update rate is positive, the target frame will be the end frame. If the update rate is negative, the target frame will be the start frame. Initialized by play. Can optionally be set manually with setUpdateRate.
Definition at line 84 of file d_util_frame_counter.hpp.
|
private |
Whether or not the counter is finished.
Behavior is contingent on m_type.
Definition at line 90 of file d_util_frame_counter.hpp.
|
private |
Controls what happens to the frame when it reaches the target frame.
Definition at line 93 of file d_util_frame_counter.hpp.