NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
m_fader.cpp
3#include <game/mLib/m_fader.hpp>
4#include <game/mLib/m_fader_base.hpp>
5
7
9 nw4r::g3d::G3DState::Invalidate(nw4r::g3d::G3DState::INVALIDATE_ALL);
10 m3d::resetMaterial();
11 mFader->draw();
12}
13
15
16 // Make sure no other fader is currently in the process of fading the screen
17 if (mFader != nullptr) {
19 if (cannotSet) {
20 return false;
21 }
22 }
23
24 // Get the fader's status
26 if (mFader != nullptr) {
27 status = mFader->getStatus();
28 } else {
29 status = fader->getStatus();
30 }
31
32 // Set the fader and its status
33 mFader = fader;
34 switch(status) {
37 }
38
39 return true;
40}
Base fader implementation.
virtual void draw()=0
Draws the fader.
virtual EStatus getStatus() const
Gets the fader's status.
virtual void setStatus(EStatus status)=0
Sets the fader's status.
EStatus
The fader's status.
@ FADE_IN
Transition from OPAQUE to HIDDEN.
@ FADE_OUT
Transition from HIDDEN to OPAQUE.
@ HIDDEN
The screen is completely unblocked.
@ OPAQUE
The screen is completely blacked out.
static mFaderBase_c * mFader
The fader currently in use.
Definition m_fader.hpp:18
static bool setFader(mFaderBase_c *fader)
Sets the fader to be used.
Definition m_fader.cpp:14
static bool isStatus(mFaderBase_c::EStatus status)
Checks if the current fader's status matches status .
Definition m_fader.hpp:12
static void draw()
Draws the current fader.
Definition m_fader.cpp:8