NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_wipe_kuppa.cpp
1#include <game/bases/d_wipe_kuppa.hpp>
2#include <game/bases/d_base_actor.hpp>
3#include <game/bases/d_game_com.hpp>
4#include <game/bases/d_a_player_manager.hpp>
5#include <game/bases/d_a_player_demo_manager.hpp>
6
8
10mFaderBase_c(mColor(color), status) {
11 m_instance = this;
12 mIsCreated = false;
13}
14
18
20 static const char *AnmNameTbl[ANIM_NAME_COUNT] = {
21 "wipeKuppa_05_inWindow.brlan",
22 "wipeKuppa_05_outWindow.brlan"
23 };
24
25 static const char *GROUP_NAME_DT[ANIM_COUNT] = {
26 "A00_inWindow",
27 "B00_outWindow"
28 };
29
30 static const int ANIME_INDEX_TBL[ANIM_COUNT] = {
31 inWindow,
32 outWindow
33 };
34
35 static const char *WPANE_NAME_DT[W_COUNT] = {
36 "W_kuppa_00"
37 };
38
39 if (mIsCreated) {
40 return true;
41 }
42
43 bool res = mLyt.ReadResource("wipeKuppa/wipeKuppa.arc", false);
44 if (!res) {
45 return false;
46 }
47
48 mLyt.build("wipeKuppa_05.brlyt", 0);
49 mLyt.AnimeResRegister(AnmNameTbl, ANIM_NAME_COUNT);
50 mLyt.GroupRegister(GROUP_NAME_DT, ANIME_INDEX_TBL, ANIM_COUNT);
51 mpRootPane = mLyt.getRootPane();
52 mLyt.WPaneRegister(WPANE_NAME_DT, mpWnd, W_COUNT);
53
54 mIsCreated = true;
55
56 mLyt.AllAnimeEndSetup();
57
58 mpRootPane->SetVisible(false);
59 mLyt.mDrawOrder = m2d::DRAW_ORDER_WIPE;
60 mAction = IDLE;
61
62 return true;
63}
64
65typedef void (dWipeKuppa_c::*Proc)();
66
68 static const Proc Proc_tbl[] = {
72 };
73
74 if (!mIsCreated) {
75 return 1;
76 }
77 if (mAction != IDLE) {
78 (this->*Proc_tbl[mAction])();
79 mLyt.AnimePlay();
80 mLyt.calc();
81 }
82 return 1;
83}
84
86 if (mIsCreated) {
87 mLyt.entry();
88 }
89}
90
92 mLyt.AllAnimeEndSetup();
93 mLyt.AnimeStartSetup(OUT, false);
95}
96
98 if (!mLyt.isAnime(-1)) {
99 if (getStatus() == FADE_IN) {
100 mStatus = HIDDEN;
101 mFlag |= FADE_IN_COMPLETE;
102 mpRootPane->SetVisible(false);
103 } else {
104 mStatus = OPAQUE;
105 mFlag |= FADE_OUT_COMPLETE;
106 }
107 mAction = IDLE;
108 }
109}
110
112 mLyt.AllAnimeEndSetup();
113 mLyt.AnimeStartSetup(IN, false);
115}
116
118 if (status == OPAQUE) {
119 mStatus = OPAQUE;
120
121 mpWnd[W_kuppa_00]->SetAlpha(255);
122 mLyt.ReverseAnimeStartSetup(OUT, false);
123
124 mpRootPane->SetVisible(true);
125 mLyt.AnimePlay();
126 mLyt.calc();
127 } else if (status == HIDDEN) {
128 mStatus = HIDDEN;
129
130 mpWnd[W_kuppa_00]->SetAlpha(0);
131 mLyt.ReverseAnimeStartSetup(IN, false);
132
133 mpRootPane->SetVisible(true);
134 mLyt.AnimePlay();
135 mLyt.calc();
136 }
137}
138
140 bool res = mFaderBase_c::fadeIn();
141 if (res) {
143 }
144 return res;
145}
146
148 bool res = mFaderBase_c::fadeOut();
149 if (res) {
151 }
152 return res;
153}
A fader that animates a Bowser texture in/out.
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().
@ 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.
virtual void setStatus(mFaderBase_c::EStatus status)
Sets the fader's status.
virtual int calc()
Calculates the fader at the current frame.
@ 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.
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.
EStatus mStatus
The fader's status.
virtual EStatus getStatus() const
Gets the fader's status.
u8 mFlag
The fader's flags.
virtual bool fadeIn()
Initiates a fade in from pure blacked-out.
mFaderBase_c(const mColor &color, EStatus status)
Constructs a new fader.
EStatus
The fader's status.
@ FADE_IN
Transition from OPAQUE to HIDDEN.
@ HIDDEN
The screen is completely unblocked.
@ OPAQUE
The screen is completely blacked out.
virtual bool fadeOut()
Initiates a fade out from no-obstruction.
A 32-bit RGBA color.
Definition m_color.hpp:6