NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_SmallScoreManager.hpp
1#pragma once
2#include <game/bases/d_base.hpp>
3#include <game/bases/d_resource.hpp>
4#include <game/bases/d_SmallScore.hpp>
5#include <game/sLib/s_GlobalData.hpp>
7
8/// @brief A manager for the small score popups.
9/// @details See also dSmallScore_c.
10/// @ingroup bases
12
13public:
14 dSmallScoreManager_c(); ///< @copydoc fBase_c::fBase_c
15 virtual ~dSmallScoreManager_c(); ///< @copydoc fBase_c::~fBase_c
16
17 virtual int create();
18 virtual int execute();
19 virtual int draw();
20 virtual int doDelete();
21
22 /// @brief Creates a blue small score popup.
23 /// @param pos The position of the popup.
24 /// @param popupType The type of popup to create. A value from dSmallScore_c::POPUP_TYPE_e.
25 /// @param playerType The player type. A value from PLAYER_CHARACTER_e.
26 void CreateBlueNumber(const mVec3_c &pos, int popupType, int playerType);
27
28 /// @brief Creates a red number popup.
29 /// @param pos The position of the popup.
30 /// @param playerType The player type. A value from PLAYER_CHARACTER_e.
31 void CreateRedNumber(const mVec3_c &pos, int playerType);
32
33 /// @brief Creates a small score popup.
34 /// @param pos The position of the popup.
35 /// @param popupType The type of popup to create. A value from dSmallScore_c::POPUP_TYPE_e.
36 /// @param playerType The player type. A value from PLAYER_CHARACTER_e.
37 void CreateSmallScore(const mVec3_c &pos, int popupType, int playerType);
38
39 /// @brief Creates a goal score popup.
40 /// @param pos The position of the popup.
41 /// @param popupType The type of popup to create. A value from dSmallScore_c::POPUP_TYPE_e.
42 /// @param playerType The player type. A value from PLAYER_CHARACTER_e.
43 void CreateGoalScore(const mVec3_c &pos, int popupType, int playerType);
44
45 /// @brief Updates the position of a goal score popup.
46 /// @param pos The new position.
47 /// @param playerType The player type. A value from PLAYER_CHARACTER_e.
48 void GoalScoreExecute(const mVec3_c &pos, int playerType);
49
50private:
51 u8 m_70[4]; ///< @unused
52 d2d::ResAccMultLoader_c mResLoader; ///< The resource loader for the layout.
53 dSmallScore_c mSmallScores[SMALL_SCORE_COUNT]; ///< The regular small score popups.
54 dSmallScore_c mGoalScores[PLAYER_COUNT]; ///< The goal score popups.
55 int mSmallScoresIdx; ///< The next free index in ::mSmallScores.
56 int mGoalScoresIdx; ///< The next free index in ::mGoalScores.
57
58public:
59 static dSmallScoreManager_c *m_instance; ///< The instance of the small score manager.
60
61 /// @unofficial
62 struct GlobalData_t {
63 u8 mUnk[12];
64 float mSmallScoreSize_4_3_X, mSmallScoreSize_4_3_Y;
65 float mSmallScoreSize_16_9_X, mSmallScoreSize_16_9_Y;
66 float mSmallGoalScoreSize_16_9_X, mSmallGoalScoreSize_16_9_Y;
67 float mSmallGoalScoreSize_4_3_X, mSmallGoalScoreSize_4_3_Y;
68 float mScissorSizeX, mScissorSizeY;
69 };
70
71 static const float c_SMALL_SCORE_SIZE_4_3_X, c_SMALL_SCORE_SIZE_4_3_Y;
72 static const float c_SMALL_SCORE_SIZE_16_9_X, c_SMALL_SCORE_SIZE_16_9_Y;
73 static const float c_SMALL_GOAL_SCORE_SIZE_4_3_X, c_SMALL_GOAL_SCORE_SIZE_4_3_Y;
74 static const float c_SMALL_GOAL_SCORE_SIZE_16_9_X, c_SMALL_GOAL_SCORE_SIZE_16_9_Y;
75 static const float c_SCISSOR_SIZE_X, c_SCISSOR_SIZE_Y;
76};
dBase_c()
Constructs a new base.
Definition d_base.cpp:13
virtual int execute()
do method for the execute operation.
int mSmallScoresIdx
The next free index in mSmallScores.
dSmallScore_c mGoalScores[PLAYER_COUNT]
The goal score popups.
int mGoalScoresIdx
The next free index in mGoalScores.
void GoalScoreExecute(const mVec3_c &pos, int playerType)
Updates the position of a goal score popup.
virtual int draw()
do method for the draw operation.
void CreateBlueNumber(const mVec3_c &pos, int popupType, int playerType)
Creates a blue small score popup.
dSmallScore_c mSmallScores[SMALL_SCORE_COUNT]
The regular small score popups.
static dSmallScoreManager_c * m_instance
The instance of the small score manager.
virtual int create()
do method for the create operation.
d2d::ResAccMultLoader_c mResLoader
The resource loader for the layout.
virtual int doDelete()
do method for the delete operation.
virtual ~dSmallScoreManager_c()
Destroys the base.
void CreateGoalScore(const mVec3_c &pos, int popupType, int playerType)
Creates a goal score popup.
dSmallScoreManager_c()
Constructs a new base.
void CreateSmallScore(const mVec3_c &pos, int popupType, int playerType)
Creates a small score popup.
void CreateRedNumber(const mVec3_c &pos, int playerType)
Creates a red number popup.
A three-dimensional floating point vector.
Definition m_vec.hpp:100
#define SMALL_SCORE_COUNT
The maximum number of small score popups visible simultaneously.