NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
multi.hpp
1#pragma once
2#include <types.h>
3#include <game/bases/d_2d/resource.hpp>
4#include <game/mLib/m_2d.hpp>
5#include <game/mLib/m_vec.hpp>
6
7namespace d2d {
8
9/// @brief Stores clipping settings for a layout.
10/// @unofficial
12 ScissorMask &operator=(const ScissorMask &other) {
13 mPos = other.mPos;
14 mSize = other.mSize;
15 mEnabled = other.mEnabled;
16 return *this;
17 }
18
20 nw4r::math::VEC2 mSize;
21 bool mEnabled;
22};
23
24/// @brief A base 2D layout class.
25class Multi_c : public m2d::Base_c {
26public:
27 Multi_c(); ///< Creates a layout.
28 virtual ~Multi_c(); ///< Destroys the layout.
29 virtual void draw(); ///< Draws the layout.
30 virtual void calc(); ///< Applies the view matrix.
31
32 /// @brief Builds the layout from a binary layout file.
33 /// @param name The name of the binary layout file.
34 /// @param resAcc The resource accessor to use. If nullptr, uses the internal accessor.
35 /// @return Whether the layout was built successfully.
36 virtual bool build(const char *name, ResAccMult_c *resAcc);
37
38 void entry(); ///< Registers the layout to be drawn.
39 void calcBefore(); ///< Calculates an animation step before the main calculation.
40 void calcAfter(); ///< Calculates the view rectangle and view matrix after the main calculation.
41 nw4r::lyt::Pane *getRootPane(); ///< Gets the root pane of the layout.
42 nw4r::lyt::Pane *findPaneByName(const char *name); ///< Finds a pane by name.
43 nw4r::lyt::TextBox *findTextBoxByName(const char *name); ///< Finds a text box pane by name.
44 nw4r::lyt::Picture *findPictureByName(const char *name); ///< Finds a picture pane by name.
45 nw4r::lyt::Window *findWindowByName(const char *name); ///< Finds a window pane by name.
46
47private:
48 m2d::Layout_c mLayout; ///< The layout instance.
49 nw4r::lyt::DrawInfo mDrawInfo; ///< The parameters for drawing the layout.
50
51public:
52 ResAccMult_c *mpResAccessor; ///< The resource accessor for the layout.
53 mVec2_c mPos; ///< The position of the layout.
54
55 ScissorMask mScissorMask; ///< The scissor mask for the layout.
56
57private:
58 u32 mFlags; ///< The flags for the layout.
59 u32 m_98; ///< @unused
60};
61
62} // namespace d2d
virtual ~Multi_c()
Destroys the layout.
Definition d_2d.cpp:119
void calcAfter()
Calculates the view rectangle and view matrix after the main calculation.
Definition d_2d.cpp:143
m2d::Layout_c mLayout
The layout instance.
Definition multi.hpp:48
ScissorMask mScissorMask
The scissor mask for the layout.
Definition multi.hpp:55
virtual void draw()
Draws the layout.
Definition d_2d.cpp:148
void entry()
Registers the layout to be drawn.
Definition d_2d.cpp:121
nw4r::lyt::Picture * findPictureByName(const char *name)
Finds a picture pane by name.
Definition d_2d.cpp:216
virtual void calc()
Applies the view matrix.
Definition d_2d.cpp:125
nw4r::lyt::DrawInfo mDrawInfo
The parameters for drawing the layout.
Definition multi.hpp:49
u32 mFlags
The flags for the layout.
Definition multi.hpp:58
nw4r::lyt::TextBox * findTextBoxByName(const char *name)
Finds a text box pane by name.
Definition d_2d.cpp:207
nw4r::lyt::Pane * getRootPane()
Gets the root pane of the layout.
Definition d_2d.cpp:178
ResAccMult_c * mpResAccessor
The resource accessor for the layout.
Definition multi.hpp:52
void calcBefore()
Calculates an animation step before the main calculation.
Definition d_2d.cpp:135
nw4r::lyt::Pane * findPaneByName(const char *name)
Finds a pane by name.
Definition d_2d.cpp:203
Multi_c()
Creates a layout.
Definition d_2d.cpp:107
virtual bool build(const char *name, ResAccMult_c *resAcc)
Builds the layout from a binary layout file.
Definition d_2d.cpp:182
mVec2_c mPos
The position of the layout.
Definition multi.hpp:53
nw4r::lyt::Window * findWindowByName(const char *name)
Finds a window pane by name.
Definition d_2d.cpp:225
A two-dimensional floating point vector.
Definition m_vec.hpp:9
2D engine namespace. Deals with drawing anything 2D, like the HUD and small scores.
Definition global.hpp:9
Stores clipping settings for a layout.
Definition multi.hpp:11