NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_wipe_dokan.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 wavy texture across the screen.
7/// @details Seen when entering a cloud area, for example.
8/// [This transition was used for the pipe transition earlier in development,
9/// which is why this class is called "dWipeDokan_c" (Dokan means "pipe")].
10/// @ingroup bases
11class dWipeDokan_c : public mFaderBase_c {
12public:
13
14 /// @brief The possible actions performed in calc().
15 enum ACTION_e {
16 OPEN_SETUP, ///< Prepare the fade-out transition.
17 ANIME_END_CHECK, ///< Fade has begun, waiting for it to end.
18 CLOSE_SETUP, ///< Prepare the fade-in transition.
19 IDLE ///< The fade has not been started.
20 };
21
22 /// @brief The animation names used for the fader.
24 inBlackDown,
25 outBlackUp,
26 outBlackDown,
27 inBlackUp,
28 ANIM_NAME_COUNT
29 };
30
31 /// @brief The animations for this fader.
32 enum ANIM_e {
33 IN_DOWN, ///< Downward fade-in.
34 OUT_UP, ///< Upward fade-out.
35 OUT_DOWN, ///< Downward fade-out.
36 IN_UP, ///< Upward fade-in.
37 ANIM_COUNT
38 };
39
40 /// @brief The picture panes used for the fader.
41 enum P_PANE_e {
42 P_baseBlack_00,
43 P_COUNT
44 };
45
46 dWipeDokan_c(nw4r::ut::Color, mFaderBase_c::EStatus status); ///< @copydoc mFaderBase_c::mFaderBase_c
47 ~dWipeDokan_c(); ///< @copydoc mFaderBase_c::~mFaderBase_c
48
49 /// @brief Loads the resources and creates the layout for the fader.
50 /// @return Whether the creation was successful.
51 bool createLayout();
52
53 /// @brief Prepares the fade-out transition.
54 void OpenSetup();
55
56 /// @brief Checks if the fade animation has finished yet.
57 /// @details If the animation has finished, sets the status accordingly
58 /// and switches back to the #IDLE action.
59 void AnimeEndCheck();
60
61 /// @brief Returns whether the wipe should go upwards or downwards.
62 /// @return True = fade-in upwards, fade-out downwards.
63 /// False = fade-in downwards, fade-out upwards.
64 bool MuKiDecision();
65
66 /// @brief Prepares the fade-in transition.
67 void CloseSetup();
68
69 virtual int calc();
70 virtual void draw();
71
72 /// @brief Sets the fader's status.
73 /// @details The only allowed values are #OPAQUE and #HIDDEN.
74 virtual void setStatus(mFaderBase_c::EStatus status);
75
76 virtual bool fadeIn();
77 virtual bool fadeOut();
78
79 static dWipeDokan_c *m_instance; ///< The instance of the fader.
80
81private:
82 LytBase_c mLyt; ///< The layout for the fader.
83 nw4r::lyt::Pane *mpRootPane; ///< The root pane of the fader layout.
84 nw4r::lyt::Picture *mpPic[P_COUNT]; ///< The picture panes.
85 ACTION_e mAction; ///< The action to be performed in calc().
86 bool mIsCreated; ///< Whether the layout for the fader has been created.
87};
void OpenSetup()
Prepares the fade-out transition.
void CloseSetup()
Prepares the fade-in transition.
virtual bool fadeIn()
Initiates a fade in from pure blacked-out.
ANIM_e
The animations for this fader.
@ IN_DOWN
Downward fade-in.
@ IN_UP
Upward fade-in.
@ OUT_DOWN
Downward fade-out.
@ OUT_UP
Upward fade-out.
ACTION_e mAction
The action to be performed in calc().
LytBase_c mLyt
The layout for the fader.
bool mIsCreated
Whether the layout for the fader has been created.
virtual bool fadeOut()
Initiates a fade out from no-obstruction.
P_PANE_e
The picture panes used for the fader.
~dWipeDokan_c()
Destroys the fader.
void AnimeEndCheck()
Checks if the fade animation has finished yet.
virtual void setStatus(mFaderBase_c::EStatus status)
Sets the fader's status.
ANIM_NAME_e
The animation names used for the fader.
ACTION_e
The possible actions performed in calc().
@ OPEN_SETUP
Prepare the fade-out transition.
@ CLOSE_SETUP
Prepare the fade-in transition.
@ ANIME_END_CHECK
Fade has begun, waiting for it to end.
@ IDLE
The fade has not been started.
bool MuKiDecision()
Returns whether the wipe should go upwards or downwards.
virtual int calc()
Calculates the fader at the current frame.
static dWipeDokan_c * m_instance
The instance of the fader.
nw4r::lyt::Picture * mpPic[P_COUNT]
The picture panes.
nw4r::lyt::Pane * mpRootPane
The root pane of the fader layout.
virtual void draw()
Draws the fader.
bool createLayout()
Loads the resources and creates the layout for the fader.
dWipeDokan_c(nw4r::ut::Color, mFaderBase_c::EStatus status)
Constructs a new fader.
mFaderBase_c(const mColor &color, EStatus status)
Constructs a new fader.
EStatus
The fader's status.