NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches

#include <game/bases/d_SmallScore.hpp>

Description

Displays a small popup score indicator.

The class handles the creation, animation, and rendering of a single small score popup, which appears when performing actions such as stomping enemies, collecting coins, or earning 1-UPs.

Definition at line 13 of file d_SmallScore.hpp.

Public Types

enum  STATE_e {
  STATE_MAKE_START ,
  STATE_UP_MOVE ,
  STATE_DISP_WAIT ,
  STATE_GOAL_DISP ,
  STATE_COUNT ,
  STATE_NONE = STATE_COUNT
}
 The possible states of the score popup. More...
enum  POPUP_TYPE_e {
  POPUP_TYPE_100 ,
  POPUP_TYPE_200 ,
  POPUP_TYPE_400 ,
  POPUP_TYPE_800 ,
  POPUP_TYPE_1000 ,
  POPUP_TYPE_2000 ,
  POPUP_TYPE_4000 ,
  POPUP_TYPE_8000 ,
  POPUP_TYPE_1 ,
  POPUP_TYPE_2 ,
  POPUP_TYPE_3 ,
  POPUP_TYPE_4 ,
  POPUP_TYPE_5 ,
  POPUP_TYPE_6 ,
  POPUP_TYPE_7 ,
  POPUP_TYPE_8 ,
  POPUP_TYPE_1UP ,
  POPUP_TYPE_2UP ,
  POPUP_TYPE_3UP ,
  POPUP_TYPE_4UP ,
  POPUP_TYPE_1UP_COLOR_CHANGE ,
  POPUP_TYPE_COIN_2 ,
  POPUP_TYPE_COIN_3 ,
  POPUP_TYPE_COIN_5 ,
  POPUP_TYPE_COIN_10 ,
  POPUP_TYPE_COIN_15 ,
  POPUP_TYPE_COIN_20 ,
  POPUP_TYPE_INVALID = -1
}
 The different types of the small score popups. More...
enum  T_PANE_e {
  T_100_00 ,
  T_1000_00 ,
  T_red2_00 ,
  T_1UP_00 ,
  T_coin_x_00 ,
  T_coinPoint_00 ,
  T_COUNT
}
 The text boxes used for the layout. More...
enum  N_PANE_e {
  N_coin_00 ,
  N_COUNT
}
 The null panes used for the layout. More...
typedef void(dSmallScore_c::* ProcFunc) ()

Public Member Functions

 dSmallScore_c ()
 Constructs a new score popup creator.
virtual ~dSmallScore_c ()
 Destroys the score popup creator.
bool createLayout (d2d::ResAccMultLoader_c *res)
void execute ()
void draw ()
bool doDelete ()
void setPlayer1upColor (int)
void setPlayer1000Color (int)
void setPlayer100Color (int)
void chgColor ()
void setNormalOrBlueColor ()
void ScissorMaskSet ()
void BigSmallAnime ()
void MakeStart ()
void UpMove ()
void DispWait ()
void GoalScoreDisp ()
void PositionSet ()
void CreateSmallScore (const mVec3_c &, int, int)
void PosSet (const mVec3_c &)
void setClipScale (mVec2_c v)

Public Attributes

LytBase_c mLayout
 The layout for the score popup.
mVec2_c mPos
mVec2_c mPosDelta
mVec2_c mPosDeceleration
mVec2_c mPosOffset
mVec2_c mScale
mVec2_c mClipScale
mVec2_c mAnimScale
nw4r::lyt::Pane * mpRootPane
 The root pane of the layout.
LytTextBox_cmpTextBoxes [T_COUNT]
 The text boxes used for the layout.
nw4r::lyt::Pane * mpNullPanes [N_COUNT]
 The null panes used for the layout.
float mMaxHeight
 The maximum height the score popup can be displayed at.
STATE_e mState
 The state the score popup is in.
int mPopupType
 The popup type. Value is a POPUP_TYPE_e.
int mDispWaitCounter
 The amount of frames the DispWait state has been active.
int mDispWaitTime
 The number of frames to wait in the DispWait state.
int mPlayerType
int mChgColorCounter
 Counter that is incremented every call to chgColor(), which ensures that the 1-UP color is only set once every 10 calls.
u32 mPlayerColor
int mAnimCounter
u32 mCurTextbox
 The textbox currently displayed. Value is a T_PANE_e.
bool mIsGoalScore
bool mInitialized
 Whether the layout has been initialized.
bool mEnableColorChange
bool mEnableBigSmallAnim
bool mAnimIsShrinking
bool mHasBlueColor
 Whether counter type score popups should be colored blue instead of red.

Static Public Attributes

static dSmallScore_cm_instance = nullptr
 The instance of the score popup creator.

Member Typedef Documentation

◆ ProcFunc

typedef void(dSmallScore_c::* dSmallScore_c::ProcFunc) ()

Definition at line 75 of file d_SmallScore.hpp.

Member Enumeration Documentation

◆ STATE_e

The possible states of the score popup.

Definition at line 17 of file d_SmallScore.hpp.

◆ POPUP_TYPE_e

The different types of the small score popups.

Enumerator
POPUP_TYPE_100 

The number 100.

POPUP_TYPE_200 

The number 200.

POPUP_TYPE_400 

The number 400.

POPUP_TYPE_800 

The number 800.

POPUP_TYPE_1000 

The number 1000.

POPUP_TYPE_2000 

The number 2000.

POPUP_TYPE_4000 

The number 4000.

POPUP_TYPE_8000 

The number 8000.

POPUP_TYPE_1 

The number 1, used for red coins and toad balloons.

POPUP_TYPE_2 

The number 2, used for red coins and toad balloons.

POPUP_TYPE_3 

The number 3, used for red coins and toad balloons.

POPUP_TYPE_4 

The number 4, used for red coins and toad balloons.

POPUP_TYPE_5 

The number 5, used for red coins and toad balloons.

POPUP_TYPE_6 

The number 6, used for red coins and toad balloons.

POPUP_TYPE_7 

The number 7, used for red coins and toad balloons.

POPUP_TYPE_8 

The number 8, used for red coins and toad balloons.

POPUP_TYPE_1UP 

The text "1-UP".

POPUP_TYPE_2UP 

The text "2-UP".

POPUP_TYPE_3UP 

The text "3-UP".

POPUP_TYPE_4UP 

The text "4-UP".

POPUP_TYPE_1UP_COLOR_CHANGE 

The text "1-UP", but changes color (see chgColor). Used when a 1-UP is awarded to multiple players.

POPUP_TYPE_COIN_2 

[Coin icon]x2. Used in Coin Battle.

POPUP_TYPE_COIN_3 

[Coin icon]x3. Used in Coin Battle.

POPUP_TYPE_COIN_5 

[Coin icon]x5. Used in Coin Battle.

POPUP_TYPE_COIN_10 

[Coin icon]x10. Used in Coin Battle.

POPUP_TYPE_COIN_15 

[Coin icon]x15. Used in Coin Battle.

POPUP_TYPE_COIN_20 

[Coin icon]x20. Used in Coin Battle.

POPUP_TYPE_INVALID 

Invalid popup type.

Definition at line 27 of file d_SmallScore.hpp.

◆ T_PANE_e

The text boxes used for the layout.

Definition at line 59 of file d_SmallScore.hpp.

◆ N_PANE_e

The null panes used for the layout.

Definition at line 70 of file d_SmallScore.hpp.

Constructor & Destructor Documentation

◆ dSmallScore_c()

dSmallScore_c::dSmallScore_c ( )

Constructs a new score popup creator.

Definition at line 13 of file d_SmallScore.cpp.

◆ ~dSmallScore_c()

dSmallScore_c::~dSmallScore_c ( )
virtual

Destroys the score popup creator.

Definition at line 17 of file d_SmallScore.cpp.

Member Function Documentation

◆ createLayout()

bool dSmallScore_c::createLayout ( d2d::ResAccMultLoader_c * res)

Definition at line 21 of file d_SmallScore.cpp.

◆ execute()

void dSmallScore_c::execute ( )

Definition at line 67 of file d_SmallScore.cpp.

◆ draw()

void dSmallScore_c::draw ( )

Definition at line 85 of file d_SmallScore.cpp.

◆ doDelete()

bool dSmallScore_c::doDelete ( )

Definition at line 97 of file d_SmallScore.cpp.

◆ setPlayer1upColor()

void dSmallScore_c::setPlayer1upColor ( int player_id)

Definition at line 101 of file d_SmallScore.cpp.

◆ setPlayer1000Color()

void dSmallScore_c::setPlayer1000Color ( int player_id)

Definition at line 105 of file d_SmallScore.cpp.

◆ setPlayer100Color()

void dSmallScore_c::setPlayer100Color ( int playerType)

Definition at line 126 of file d_SmallScore.cpp.

◆ chgColor()

void dSmallScore_c::chgColor ( )

Definition at line 140 of file d_SmallScore.cpp.

◆ setNormalOrBlueColor()

void dSmallScore_c::setNormalOrBlueColor ( )

Definition at line 166 of file d_SmallScore.cpp.

◆ ScissorMaskSet()

void dSmallScore_c::ScissorMaskSet ( )

Definition at line 186 of file d_SmallScore.cpp.

◆ BigSmallAnime()

void dSmallScore_c::BigSmallAnime ( )

Definition at line 203 of file d_SmallScore.cpp.

◆ MakeStart()

void dSmallScore_c::MakeStart ( )

Definition at line 226 of file d_SmallScore.cpp.

◆ UpMove()

void dSmallScore_c::UpMove ( )

Definition at line 293 of file d_SmallScore.cpp.

◆ DispWait()

void dSmallScore_c::DispWait ( )

Definition at line 309 of file d_SmallScore.cpp.

◆ GoalScoreDisp()

void dSmallScore_c::GoalScoreDisp ( )

Definition at line 339 of file d_SmallScore.cpp.

◆ PositionSet()

void dSmallScore_c::PositionSet ( )

Definition at line 341 of file d_SmallScore.cpp.

◆ CreateSmallScore()

void dSmallScore_c::CreateSmallScore ( const mVec3_c & pos,
int popupType,
int playerType )

Definition at line 369 of file d_SmallScore.cpp.

◆ PosSet()

void dSmallScore_c::PosSet ( const mVec3_c & pos)

Definition at line 387 of file d_SmallScore.cpp.

◆ setClipScale()

void dSmallScore_c::setClipScale ( mVec2_c v)
inline

Definition at line 104 of file d_SmallScore.hpp.

Member Data Documentation

◆ mLayout

LytBase_c dSmallScore_c::mLayout

The layout for the score popup.

Definition at line 106 of file d_SmallScore.hpp.

◆ mPos

mVec2_c dSmallScore_c::mPos

Definition at line 107 of file d_SmallScore.hpp.

◆ mPosDelta

mVec2_c dSmallScore_c::mPosDelta

Definition at line 108 of file d_SmallScore.hpp.

◆ mPosDeceleration

mVec2_c dSmallScore_c::mPosDeceleration

Definition at line 109 of file d_SmallScore.hpp.

◆ mPosOffset

mVec2_c dSmallScore_c::mPosOffset

Definition at line 110 of file d_SmallScore.hpp.

◆ mScale

mVec2_c dSmallScore_c::mScale

Definition at line 111 of file d_SmallScore.hpp.

◆ mClipScale

mVec2_c dSmallScore_c::mClipScale

Definition at line 112 of file d_SmallScore.hpp.

◆ mAnimScale

mVec2_c dSmallScore_c::mAnimScale

Definition at line 113 of file d_SmallScore.hpp.

◆ mpRootPane

nw4r::lyt::Pane* dSmallScore_c::mpRootPane

The root pane of the layout.

Definition at line 114 of file d_SmallScore.hpp.

◆ mpTextBoxes

LytTextBox_c* dSmallScore_c::mpTextBoxes[T_COUNT]

The text boxes used for the layout.

Definition at line 115 of file d_SmallScore.hpp.

◆ mpNullPanes

nw4r::lyt::Pane* dSmallScore_c::mpNullPanes[N_COUNT]

The null panes used for the layout.

Definition at line 116 of file d_SmallScore.hpp.

◆ mMaxHeight

float dSmallScore_c::mMaxHeight

The maximum height the score popup can be displayed at.

Definition at line 117 of file d_SmallScore.hpp.

◆ mState

STATE_e dSmallScore_c::mState

The state the score popup is in.

Definition at line 118 of file d_SmallScore.hpp.

◆ mPopupType

int dSmallScore_c::mPopupType

The popup type. Value is a POPUP_TYPE_e.

Definition at line 119 of file d_SmallScore.hpp.

◆ mDispWaitCounter

int dSmallScore_c::mDispWaitCounter

The amount of frames the DispWait state has been active.

Definition at line 120 of file d_SmallScore.hpp.

◆ mDispWaitTime

int dSmallScore_c::mDispWaitTime

The number of frames to wait in the DispWait state.

Definition at line 121 of file d_SmallScore.hpp.

◆ mPlayerType

int dSmallScore_c::mPlayerType

Definition at line 122 of file d_SmallScore.hpp.

◆ mChgColorCounter

int dSmallScore_c::mChgColorCounter

Counter that is incremented every call to chgColor(), which ensures that the 1-UP color is only set once every 10 calls.

Definition at line 123 of file d_SmallScore.hpp.

◆ mPlayerColor

u32 dSmallScore_c::mPlayerColor

Definition at line 124 of file d_SmallScore.hpp.

◆ mAnimCounter

int dSmallScore_c::mAnimCounter

Definition at line 125 of file d_SmallScore.hpp.

◆ mCurTextbox

u32 dSmallScore_c::mCurTextbox

The textbox currently displayed. Value is a T_PANE_e.

Definition at line 126 of file d_SmallScore.hpp.

◆ mIsGoalScore

bool dSmallScore_c::mIsGoalScore

Definition at line 127 of file d_SmallScore.hpp.

◆ mInitialized

bool dSmallScore_c::mInitialized

Whether the layout has been initialized.

Definition at line 128 of file d_SmallScore.hpp.

◆ mEnableColorChange

bool dSmallScore_c::mEnableColorChange

Definition at line 129 of file d_SmallScore.hpp.

◆ mEnableBigSmallAnim

bool dSmallScore_c::mEnableBigSmallAnim

Definition at line 130 of file d_SmallScore.hpp.

◆ mAnimIsShrinking

bool dSmallScore_c::mAnimIsShrinking

Definition at line 131 of file d_SmallScore.hpp.

◆ mHasBlueColor

bool dSmallScore_c::mHasBlueColor

Whether counter type score popups should be colored blue instead of red.

Definition at line 132 of file d_SmallScore.hpp.

◆ m_instance

dSmallScore_c * dSmallScore_c::m_instance = nullptr
static

The instance of the score popup creator.

Definition at line 134 of file d_SmallScore.hpp.