NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_wipe_kuppa.hpp
1#pragma once
2#include <game/mLib/m_fader_base.hpp>
3#include <game/bases/d_lytbase.hpp>
4#include <nw4r/ut.h>
5
6/// @brief A fader that animates a Bowser texture in/out.
7/// @details Seen when entering a tower or castle stage, for example.
8/// @ingroup bases
9class dWipeKuppa_c : public mFaderBase_c {
10public:
11
12 /// @brief The possible actions performed in calc().
13 enum ACTION_e {
14 OPEN_SETUP, ///< Prepare the fade-out transition.
15 ANIME_END_CHECK, ///< Fade has begun, waiting for it to end.
16 CLOSE_SETUP, ///< Prepare the fade-in transition.
17 IDLE ///< The fade has not been started.
18 };
19
20 /// @brief The animations for this fader.
21 enum ANIM_e {
22 IN, ///< Fade-in animation.
23 OUT, ///< Fade-out animation.
24 ANIM_COUNT
25 };
26
27 /// @brief The animation names used for the fader.
29 inWindow,
30 outWindow,
31 ANIM_NAME_COUNT
32 };
33
34 /// @brief The window panes used for the fader.
35 enum W_PANE_e {
36 W_kuppa_00,
37 W_COUNT
38 };
39
40 dWipeKuppa_c(nw4r::ut::Color, mFaderBase_c::EStatus status); ///< @copydoc mFaderBase_c::mFaderBase_c
41 ~dWipeKuppa_c(); ///< @copydoc mFaderBase_c::~mFaderBase_c
42
43 /// @brief Loads the resources and creates the layout for the fader.
44 /// @return Whether the creation was successful.
45 bool createLayout();
46
47 /// @brief Prepares the fade-out transition.
48 void OpenSetup();
49
50 /// @brief Checks if the fade animation has finished yet.
51 /// @details If the animation has finished, sets the status accordingly
52 /// and switches back to the #IDLE action.
53 void AnimeEndCheck();
54
55 /// @brief Prepares the fade-in transition.
56 void CloseSetup();
57
58 virtual int calc();
59 virtual void draw();
60
61 /// @brief Sets the fader's status.
62 /// @details The only allowed values are #OPAQUE and #HIDDEN.
63 virtual void setStatus(mFaderBase_c::EStatus status);
64
65 virtual bool fadeIn();
66 virtual bool fadeOut();
67
68 static dWipeKuppa_c *m_instance; ///< The instance of the fader.
69
70private:
71 LytBase_c mLyt; ///< The layout for the fader.
72 nw4r::lyt::Pane *mpRootPane; ///< The root pane of the fader layout.
73 nw4r::lyt::Window *mpWnd[W_COUNT]; ///< The window panes used for the fader.
74 ACTION_e mAction; ///< The action to be performed in calc().
75 bool mIsCreated; ///< Whether the layout for the fader has been created.
76};
virtual void draw()
Draws the fader.
void AnimeEndCheck()
Checks if the fade animation has finished yet.
static dWipeKuppa_c * m_instance
The instance of the fader.
dWipeKuppa_c(nw4r::ut::Color, mFaderBase_c::EStatus status)
Constructs a new fader.
bool mIsCreated
Whether the layout for the fader has been created.
ACTION_e mAction
The action to be performed in calc().
ACTION_e
The possible actions performed in calc().
@ ANIME_END_CHECK
Fade has begun, waiting for it to end.
@ IDLE
The fade has not been started.
@ OPEN_SETUP
Prepare the fade-out transition.
@ CLOSE_SETUP
Prepare the fade-in transition.
W_PANE_e
The window panes used for the fader.
void OpenSetup()
Prepares the fade-out transition.
virtual void setStatus(mFaderBase_c::EStatus status)
Sets the fader's status.
virtual int calc()
Calculates the fader at the current frame.
ANIM_e
The animations for this fader.
@ OUT
Fade-out animation.
@ IN
Fade-in animation.
virtual bool fadeOut()
Initiates a fade out from no-obstruction.
bool createLayout()
Loads the resources and creates the layout for the fader.
nw4r::lyt::Window * mpWnd[W_COUNT]
The window panes used for the fader.
nw4r::lyt::Pane * mpRootPane
The root pane of the fader layout.
ANIM_NAME_e
The animation names used for the fader.
LytBase_c mLyt
The layout for the fader.
void CloseSetup()
Prepares the fade-in transition.
virtual bool fadeIn()
Initiates a fade in from pure blacked-out.
~dWipeKuppa_c()
Destroys the fader.
mFaderBase_c(const mColor &color, EStatus status)
Constructs a new fader.
EStatus
The fader's status.