NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
d_SmallScore.hpp
1#pragma once
2#include <game/bases/d_resource.hpp>
3#include <game/bases/d_lytbase.hpp>
4#include <game/mLib/m_vec.hpp>
5#include <lib/nw4r/lyt/lyt_pane.hpp>
6
7
8class dSmallScore_c {
9public:
10 enum STATE_e {
11 STATE_MAKE_START = 0,
12 STATE_UP_MOVE = 1,
13 STATE_DISP_WAIT = 2,
14 STATE_GOAL_DISP = 3,
15 STATE_NONE = 4
16 };
17
18 enum POPUP_TYPE_e {
19 POPUP_TYPE_100,
20 POPUP_TYPE_200,
21 POPUP_TYPE_400,
22 POPUP_TYPE_800,
23 POPUP_TYPE_1000,
24 POPUP_TYPE_2000,
25 POPUP_TYPE_4000,
26 POPUP_TYPE_8000,
27 POPUP_TYPE_ONE,
28 POPUP_TYPE_TWO,
29 POPUP_TYPE_THREE,
30 POPUP_TYPE_FOUR,
31 POPUP_TYPE_FIVE,
32 POPUP_TYPE_SIX,
33 POPUP_TYPE_SEVEN,
34 POPUP_TYPE_EIGHT,
35 POPUP_TYPE_1UP,
36 POPUP_TYPE_2UP,
37 POPUP_TYPE_3UP,
38 POPUP_TYPE_4UP,
39 POPUP_TYPE_1UP_DUPE,
40 POPUP_TYPE_COIN_2,
41 POPUP_TYPE_COIN_3,
42 POPUP_TYPE_COIN_5,
43 POPUP_TYPE_COIN_10,
44 POPUP_TYPE_COIN_15,
45 POPUP_TYPE_COIN_20
46 };
47
48 typedef void (dSmallScore_c::*ProcFunc)();
49
50 dSmallScore_c();
51 virtual ~dSmallScore_c();
52
53 bool createLayout(d2d::ResAccMultLoader_c *);
54 void execute();
55 void draw();
56 void doDelete();
57
58 void setPlayer1upColor(int);
59 void setPlayer1000Color(int);
60 void setPlayer100Color(int);
61 void chgColor();
62
63 void setNormalOrBlueColor();
64
65 void ScissorMaskSet();
66 void BigSmallAnime();
67
68 void MakeStart();
69 void UpMove();
70 void DispWait();
71 void GoalScoreDisp();
72
73 void PositionSet();
74 void CreateSmallScore(const mVec3_c &, int, int);
75 void PosSet(const mVec3_c &);
76
77 LytBase_c mLayout;
78 mVec2_c mPos;
79 mVec2_c mPosDelta;
80 mVec2_c mPosDeceleration;
81 mVec2_c mPosOffset;
82 mVec2_c mScale;
83 mVec2_c mClipScale;
84 mVec2_c mAnimScale;
85 nw4r::lyt::Pane *mpRootPane;
86 LytTextBox_c *T_100_00;
87 LytTextBox_c *T_1000_00;
88 LytTextBox_c *T_red2_00;
89 LytTextBox_c *T_1UP_00;
90 LytTextBox_c *T_coin_x_00;
91 LytTextBox_c *T_coinPoint_00;
92 nw4r::lyt::Pane *N_coin_00;
93 float mMaxHeight;
94 STATE_e mState; ///< Determines the state the score popup is in
95 int mPopupType;
96 int mDispWaitCounter; ///< Counter that is incremented every frame while in the 'DispWait' state
97 int mDispWaitTime; ///< Number of frames to wait in 'DispWait' (unless mPlayerType is 4, in which case the default value is 60)
98 int mPlayerType;
99 int mChgColorCounter; ///< Counter that is incremented every call to dSmallScore_c::chgColor(), which ensures that the 1-up color is only set once every 10 calls.
100 u32 mPlayerColor;
101 int mAnimCounter;
102 u32 mCurTextbox;
103 bool mIsGoalScore;
104 bool mInitialized;
105 bool mEnableColorChange;
106 bool mEnableBigSmallAnim;
107 bool mAnimIsShrinking;
108 bool mHasBlueColor;
109
110 /// @brief Gets the n-th text box.
111 LytTextBox_c *getTextBox(int n) { return (&T_100_00)[n]; }
112
113 static dSmallScore_c *m_instance;
114
115};
int mChgColorCounter
Counter that is incremented every call to dSmallScore_c::chgColor(), which ensures that the 1-up colo...
STATE_e mState
Determines the state the score popup is in.
int mDispWaitCounter
Counter that is incremented every frame while in the 'DispWait' state.
int mDispWaitTime
Number of frames to wait in 'DispWait' (unless mPlayerType is 4, in which case the default value is 6...
LytTextBox_c * getTextBox(int n)
Gets the n-th text box.
A two-dimensional floating point vector.
Definition m_vec.hpp:9
A three-dimensional floating point vector.
Definition m_vec.hpp:100