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 <lib/nw4r/ut/color.hpp>
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 };
25
26 dWipeKuppa_c(nw4r::ut::Color, mFaderBase_c::EStatus stat); ///< See mFaderBase_c::mFaderBase_c.
27 ~dWipeKuppa_c(); ///< Destroys the fader.
28
29 /// @brief Loads the resources and creates the layout for the fader.
30 /// @return Whether the creation was successful.
31 bool createLayout();
32
33 /// @brief Prepares the fade-out transition.
34 void OpenSetup();
35
36 /// @brief Checks if the fade animation has finished yet.
37 /// @details If the animation has finished, sets the status accordingly
38 /// and switches back to the ::IDLE action.
39 void AnimeEndCheck();
40
41 /// @brief Prepares the fade-in transition.
42 void CloseSetup();
43
44 virtual int calc();
45 virtual void draw();
46
47 /// @brief Sets the fader's status.
48 /// @details The only allowed values are ::OPAQUE and ::HIDDEN.
49 virtual void setStatus(mFaderBase_c::EStatus stat);
50
51 virtual bool fadeIn();
52 virtual bool fadeOut();
53
54 static dWipeKuppa_c *m_instance; ///< The instance of the fader.
55
56private:
57 LytBase_c mLyt; ///< The layout for the fader.
58 nw4r::lyt::Pane *mpRootPane; ///< The root pane of the fader layout.
59 nw4r::lyt::Window *mpWnd[1]; ///< The window pane containing the fader texture.
60 ACTION_e mAction; ///< The action to be performed in ::calc.
61 bool mIsCreated; ///< Whether the layout for the fader has been created.
62};
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.
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.
void OpenSetup()
Prepares the fade-out transition.
dWipeKuppa_c(nw4r::ut::Color, mFaderBase_c::EStatus stat)
See mFaderBase_c::mFaderBase_c.
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::Pane * mpRootPane
The root pane of the fader layout.
LytBase_c mLyt
The layout for the fader.
virtual void setStatus(mFaderBase_c::EStatus stat)
Sets the fader's status.
nw4r::lyt::Window * mpWnd[1]
The window pane containing the fader texture.
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.
A 32-bit RGBA color.
Definition color.hpp:8