NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_game_com.hpp
1#pragma once
2#include <types.h>
3#include <nw4r/lyt.h>
4#include <game/mLib/m_3d.hpp>
5#include <game/mLib/m_vec.hpp>
6#include <game/sLib/s_RangeData.hpp>
7#include <game/bases/d_lyttextBox.hpp>
8
9/// @brief A collection of various functions used throughout the game.
10/// @details Name stands for Game Common.
11/// @ingroup bases
12namespace dGameCom {
13
14 //////////////////////////////////
15 // Random Number Generation API //
16 //////////////////////////////////
17
18 void initRandomSeed(); ///< Initializes the random seed used for randomness.
19 u32 getRandomSeed(); ///< Gets a seed used for randomness.
20 int rndInt(size_t max);
21 float rnd();
22
23 ////////////////////
24 // Game Pause API //
25 ////////////////////
26
27 /// @brief The game stopping conditions.
29 GAME_STOP_PAUSE = BIT_FLAG(0), ///< The pause menu is open.
30 GAME_STOP_WARNING = BIT_FLAG(1), ///< An error occurred.
31 GAME_STOP_OTASUKE_PAUSE = BIT_FLAG(2), ///< The pause menu is open during super guide/hint movie playback.
32 GAME_STOP_HOME_MENU = BIT_FLAG(3), ///< The Home Menu is open.
33 GAME_STOP_ANY = -1, ///< The game is stopped for any unspecified reason.
34 };
35
36 /// @brief Determines if gameplay is currently stopped for the specified reason(s).
37 /// @param flag The pause reasons. Value is a GAME_STOP_e.
38 bool isGameStop(ulong flag);
39 void clearGameStop(); ///< Resets the game stop state.
40 void setGameStop();
41
42 //////////////////
43 // Language API //
44 //////////////////
45
46 u8 GetLanguageHBM();
47
48 ////////////////////////
49 // Model Lighting API //
50 ////////////////////////
51
52 void SetSoftLight_Player(m3d::bmdl_c&, int); ///< Sets the soft light effect for players.
53 void SetSoftLight_Map(m3d::bmdl_c&, int); ///< Sets the soft light effect for map actors.
54 void SetSoftLight_Boss(m3d::bmdl_c&, int); ///< Sets the soft light effect for bosses.
55 void SetSoftLight_Enemy(m3d::bmdl_c&, int); ///< Sets the soft light effect for enemies.
56 void SetSoftLight_MapObj(m3d::bmdl_c&, int); ///< Sets the soft light effect for map objects.
57 void SetSoftLight_Item(m3d::bmdl_c&, int); ///< Sets the soft light effect for items.
58
59 ////////////////////
60 // Fukidashi APIs //
61 ////////////////////
62
63 /// @brief Displays the given action prompt to the given player.
64 /// @unofficial
65 /// @param playerId The player to display the action prompt to.
66 /// @param fukidashiAction The action prompt to display.
67 void showFukidashi(int playerId, int fukidashiAction);
68
69 /// @brief Temporarily hides the given action prompt for the given player.
70 /// @unofficial
71 /// @param playerId The player to hide the action prompt for.
72 /// @param fukidashiAction The action prompt type to be hidden.
73 /// @param param3 Unknown.
74 void hideFukidashiTemporarily(int playerId, int fukidashiAction, int param3);
75
76 /// @brief Hides the given action prompt for the given player for the rest of the current level.
77 /// @unofficial
78 /// @param playerId The player to hide the action prompt for.
79 /// @param fukidashiAction The action prompt type to be hidden.
80 /// @param param3 Unknown.
81 void hideFukidashiForLevel(int playerId, int fukidashiAction, int param3);
82
83 /// @brief Hides the given action prompt for the given player for the rest of the current session.
84 /// @details The action prompt remains hidden until the player returns to the main menu.
85 /// @unofficial
86 /// @param playerId The player to hide the action prompt for.
87 /// @param fukidashiAction The action prompt type to be hidden.
88 void hideFukidashiForSession(int playerId, int fukidashiAction);
89
90 void FUN_800b37b0(int playerId, int fukidashiAction); ///< @unofficial
91
92 ////////////////
93 // Other APIs //
94 ////////////////
95
96 void CreateSmallScore(const mVec3_c &, int, int, bool);
97 u8 GetAspectRatio();
98 bool PlayerEnterCheck(int);
99 void Player1upColor(LytTextBox_c *, int);
100 void getGlbPosToLyt(mVec3_c &);
101 bool someCheck(mVec3_c *a, sRangeDataF *b); ///< @unofficial
102
103 bool checkRectangleOverlap(mVec3_c *, mVec3_c *, mVec3_c *, mVec3_c *, float); ///< @unofficial
104
105 void SelectCursorSetup();
106 void SelectCursorSetup(nw4r::lyt::Pane *pane, int index, bool useSpecialDraw);
107
108 void WindowPaneColorSet(nw4r::lyt::Window *, int);
109 float getDispCenterY();
110
111 void DispSizeScale(nw4r::math::VEC2 &scale);
112
113 void LayoutDispNumber(const int &value, const int &fillLeft, LytTextBox_c *textBox, bool fillWidth);
114
115 bool isNowCourseClear();
116
117 void initGame();
118 void AreaLanguageFolder(const char *, char *);
119}
A text box class with BMG message support.
A three-dimensional floating point vector.
Definition m_vec.hpp:122
A collection of various functions used throughout the game.
void SetSoftLight_Player(m3d::bmdl_c &, int)
Sets the soft light effect for players.
void SetSoftLight_Enemy(m3d::bmdl_c &, int)
Sets the soft light effect for enemies.
bool someCheck(mVec3_c *a, sRangeDataF *b)
void SetSoftLight_MapObj(m3d::bmdl_c &, int)
Sets the soft light effect for map objects.
void SetSoftLight_Item(m3d::bmdl_c &, int)
Sets the soft light effect for items.
void SetSoftLight_Map(m3d::bmdl_c &, int)
Sets the soft light effect for map actors.
u32 getRandomSeed()
Gets a seed used for randomness.
void hideFukidashiForLevel(int playerId, int fukidashiAction, int param3)
Hides the given action prompt for the given player for the rest of the current level.
void showFukidashi(int playerId, int fukidashiAction)
Displays the given action prompt to the given player.
bool isGameStop(ulong flag)
Determines if gameplay is currently stopped for the specified reason(s).
void initRandomSeed()
Initializes the random seed used for randomness.
bool checkRectangleOverlap(mVec3_c *, mVec3_c *, mVec3_c *, mVec3_c *, float)
void clearGameStop()
Resets the game stop state.
void SetSoftLight_Boss(m3d::bmdl_c &, int)
Sets the soft light effect for bosses.
void hideFukidashiTemporarily(int playerId, int fukidashiAction, int param3)
Temporarily hides the given action prompt for the given player.
void hideFukidashiForSession(int playerId, int fukidashiAction)
Hides the given action prompt for the given player for the rest of the current session.
void FUN_800b37b0(int playerId, int fukidashiAction)
GAME_STOP_e
The game stopping conditions.
@ GAME_STOP_OTASUKE_PAUSE
The pause menu is open during super guide/hint movie playback.
@ GAME_STOP_PAUSE
The pause menu is open.
@ GAME_STOP_WARNING
An error occurred.
@ GAME_STOP_HOME_MENU
The Home Menu is open.
@ GAME_STOP_ANY
The game is stopped for any unspecified reason.