NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_awa.hpp
1#pragma once
2#include <game/bases/d_heap_allocator.hpp>
3#include <game/bases/d_actor.hpp>
4
5/**
6 * @brief An early version of the unused water bubble, without collision.
7 * @details The bubble moves in the specified direction with a fixed acceleration, and is deleted automatically after #LIFE_TIME frames.
8 * @paramtable
9 * @ingroup bases
10 * @unused
11 */
12class dAwa_c : public dActor_c {
13public:
14 typedef void (dAwa_c::*CalcSpeed)(); ///< The speed update function.
15
16 dAwa_c() : mCalcSpeedFn(), mLifeTimer(LIFE_TIME) {} ///< @copydoc dActor_c::dActor_c
17 virtual ~dAwa_c() {} ///< @copydoc dActor_c::~dActor_c
18
19 virtual int create();
20 virtual int doDelete();
21 virtual int execute();
22 virtual int draw();
23 virtual void deleteReady();
24
25 void createModel(); ///< Initializes the resources for the actor.
26 void setAnim(); ///< Initializes the model animation.
27 void calc(); ///< Updates the bubble's position and speed.
28
29 void calcSpeedUp(); ///< Updates the bubble's speed (upwards direction).
30 void calcSpeedDown(); ///< Updates the bubble's speed (downwards direction).
31 void calcSpeedLeft(); ///< Updates the bubble's speed (leftwards direction).
32 void calcSpeedRight(); ///< Updates the bubble's speed (rightwards direction).
33
34 dHeapAllocator_c mAllocator; ///< The allocator.
35 nw4r::g3d::ResFile mResFile; ///< The resource file.
36 m3d::mdl_c mBubbleModel; ///< The bubble model.
37 m3d::anmChr_c mBubbleAnim; ///< The bubble animation.
38 CalcSpeed mCalcSpeedFn; ///< The speed update function.
39 int mLifeTimer; ///< The amount of frames left before the bubble is deleted.
40
41 static const int LIFE_TIME = 60; ///< The life time of the bubble.
42 ACTOR_PARAM_CONFIG(Direction, 0, 2); ///< The direction the bubble moves in.
43};
dActor_c()
Constructs a new actor.
Definition d_actor.cpp:46
nw4r::g3d::ResFile mResFile
The resource file.
Definition d_awa.hpp:35
static const int LIFE_TIME
The life time of the bubble.
Definition d_awa.hpp:41
void createModel()
Initializes the resources for the actor.
Definition d_awa.cpp:29
void(dAwa_c::* CalcSpeed)()
The speed update function.
Definition d_awa.hpp:14
m3d::anmChr_c mBubbleAnim
The bubble animation.
Definition d_awa.hpp:37
virtual void deleteReady()
Informs the base that it's about to be deleted.
Definition d_awa.cpp:67
void setAnim()
Initializes the model animation.
Definition d_awa.cpp:78
dHeapAllocator_c mAllocator
The allocator.
Definition d_awa.hpp:34
int mLifeTimer
The amount of frames left before the bubble is deleted.
Definition d_awa.hpp:39
virtual int execute()
do method for the execute operation.
Definition d_awa.cpp:42
void calcSpeedDown()
Updates the bubble's speed (downwards direction).
Definition d_awa.cpp:98
virtual int draw()
do method for the draw operation.
Definition d_awa.cpp:54
void calcSpeedRight()
Updates the bubble's speed (rightwards direction).
Definition d_awa.cpp:105
void calc()
Updates the bubble's position and speed.
Definition d_awa.cpp:85
m3d::mdl_c mBubbleModel
The bubble model.
Definition d_awa.hpp:36
virtual ~dAwa_c()
Destroys the actor.
Definition d_awa.hpp:17
void calcSpeedUp()
Updates the bubble's speed (upwards direction).
Definition d_awa.cpp:91
void calcSpeedLeft()
Updates the bubble's speed (leftwards direction).
Definition d_awa.cpp:112
dAwa_c()
Constructs a new actor.
Definition d_awa.hpp:16
CalcSpeed mCalcSpeedFn
The speed update function.
Definition d_awa.hpp:38
virtual int doDelete()
do method for the delete operation.
Definition d_awa.cpp:69
virtual int create()
do method for the create operation.
Definition d_awa.cpp:8
ACTOR_PARAM_CONFIG(Direction, 0, 2)
The direction the bubble moves in.