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