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
22 ////////////////////
23 // Game Pause API //
24 ////////////////////
25
26 /// @brief The game stopping conditions.
28 GAME_STOP_PAUSE = BIT_FLAG(0), ///< The pause menu is open.
29 GAME_STOP_WARNING = BIT_FLAG(1), ///< An error occurred.
30 GAME_STOP_OTASUKE_PAUSE = BIT_FLAG(2), ///< The pause menu is open during super guide/hint movie playback.
31 GAME_STOP_HOME_MENU = BIT_FLAG(3), ///< The Home Menu is open.
32 GAME_STOP_ANY = -1, ///< The game is stopped for any unspecified reason.
33 };
34
35 /// @brief Determines if gameplay is currently stopped for the specified reason(s).
36 /// @param flag The pause reasons. Value is a GAME_STOP_e.
37 bool isGameStop(ulong flag);
38 void clearGameStop(); ///< Resets the game stop state.
39 void setGameStop();
40
41 //////////////////
42 // Language API //
43 //////////////////
44
45 u8 GetLanguageHBM();
46
47 ////////////////////////
48 // Model Lighting API //
49 ////////////////////////
50
51 void SetSoftLight_Player(m3d::bmdl_c&, int); ///< Sets the soft light effect for players.
52 void SetSoftLight_Map(m3d::bmdl_c&, int); ///< Sets the soft light effect for map actors.
53 void SetSoftLight_Boss(m3d::bmdl_c&, int); ///< Sets the soft light effect for bosses.
54 void SetSoftLight_Enemy(m3d::bmdl_c&, int); ///< Sets the soft light effect for enemies.
55 void SetSoftLight_MapObj(m3d::bmdl_c&, int); ///< Sets the soft light effect for map objects.
56 void SetSoftLight_Item(m3d::bmdl_c&, int); ///< Sets the soft light effect for items.
57
58 ////////////////////
59 // Fukidashi APIs //
60 ////////////////////
61
62 /// @brief Displays the given action prompt to the given player.
63 /// @unofficial
64 /// @param playerId The player to display the action prompt to.
65 /// @param fukidashiAction The action prompt to display.
66 void showFukidashi(int playerId, int fukidashiAction);
67
68 /// @brief Temporarily hides the given action prompt for the given player.
69 /// @unofficial
70 /// @param playerId The player to hide the action prompt for.
71 /// @param fukidashiAction The action prompt type to be hidden.
72 /// @param param3 Unknown.
73 void hideFukidashiTemporarily(int playerId, int fukidashiAction, int param3);
74
75 /// @brief Hides the given action prompt for the given player for the rest of the current level.
76 /// @unofficial
77 /// @param playerId The player to hide the action prompt for.
78 /// @param fukidashiAction The action prompt type to be hidden.
79 /// @param param3 Unknown.
80 void hideFukidashiForLevel(int playerId, int fukidashiAction, int param3);
81
82 /// @brief Hides the given action prompt for the given player for the rest of the current session.
83 /// @details The action prompt remains hidden until the player returns to the main menu.
84 /// @unofficial
85 /// @param playerId The player to hide the action prompt for.
86 /// @param fukidashiAction The action prompt type to be hidden.
87 void hideFukidashiForSession(int playerId, int fukidashiAction);
88
89 ////////////////
90 // Other APIs //
91 ////////////////
92
93 void CreateSmallScore(const mVec3_c &, int, int, bool);
94 u8 GetAspectRatio();
95 bool PlayerEnterCheck(int);
96 void Player1upColor(LytTextBox_c *, int);
97 void getGlbPosToLyt(mVec3_c &);
98 bool someCheck(mVec3_c *a, sRangeDataF *b); ///< @unofficial
99
100 bool checkRectangleOverlap(mVec3_c *, mVec3_c *, mVec3_c *, mVec3_c *, float); ///< @unofficial
101
102 void SelectCursorSetup();
103 void SelectCursorSetup(nw4r::lyt::Pane *pane, int index, bool useSpecialDraw);
104
105 void WindowPaneColorSet(nw4r::lyt::Window *, int);
106 float getDispCenterY();
107
108 void DispSizeScale(nw4r::math::VEC2 &scale);
109
110 void LayoutDispNumber(const int &value, const int &fillLeft, LytTextBox_c *textBox, bool fillWidth);
111
112 bool isNowCourseClear();
113
114 void initGame();
115 void AreaLanguageFolder(const char *, char *);
116}
A text box class with BMG message support.
A three-dimensional floating point vector.
Definition m_vec.hpp:112
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.
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.