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