NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
mFaderBase_c Class Referenceabstract

#include <game/mLib/m_fader_base.hpp>

Inheritance diagram for mFaderBase_c:
[legend]

Description

Base fader implementation.

Definition at line 6 of file m_fader_base.hpp.

Public Types

enum  EStatus {
  OPAQUE ,
  HIDDEN ,
  FADE_IN ,
  FADE_OUT
}
 The fader's status. More...
 
enum  FLAG_e {
  FADE_IN_COMPLETE = BIT_FLAG(0) ,
  FADE_OUT_COMPLETE = BIT_FLAG(1)
}
 Some flags related to the fader. More...
 

Public Member Functions

 mFaderBase_c (const mColor &color, EStatus status)
 Constructs a new fader.
 
virtual ~mFaderBase_c ()
 Destroys the fader.
 
virtual void setStatus (EStatus status)=0
 Sets the fader's status.
 
virtual EStatus getStatus () const
 Gets the fader's status.
 
virtual bool fadeIn ()
 Initiates a fade in from pure blacked-out.
 
virtual bool fadeOut ()
 Initiates a fade out from no-obstruction.
 
virtual int calc ()
 Calculates the fader at the current frame.
 
virtual void draw ()=0
 Draws the fader.
 
void setFrame (u16 duration)
 Sets the duration of the fade. Duration must not be zero.
 
void setColor (const mColor &color)
 Sets the fader's color. Alpha is not modified.
 

Protected Attributes

EStatus mStatus
 The fader's status.
 
u8 mFlag
 The fader's flags.
 
u16 mFrameCount
 The fader's duration.
 
u16 mCurrFrame
 The fader's current frame.
 
mColor mFaderColor
 The fader's color.
 

Member Enumeration Documentation

◆ EStatus

The fader's status.

Enumerator
OPAQUE 

The screen is completely blacked out.

HIDDEN 

The screen is completely unblocked.

FADE_IN 

Transition from OPAQUE to HIDDEN.

FADE_OUT 

Transition from HIDDEN to OPAQUE.

Definition at line 10 of file m_fader_base.hpp.

◆ FLAG_e

Some flags related to the fader.

Todo
Figure out what these do.
Unofficial name.

Definition at line 20 of file m_fader_base.hpp.

Constructor & Destructor Documentation

◆ mFaderBase_c()

mFaderBase_c::mFaderBase_c ( const mColor & color,
mFaderBase_c::EStatus status )

Constructs a new fader.

Parameters
colorThe fader's color.
statusThe fader's initial status (OPAQUE or HIDDEN).

Definition at line 4 of file m_fader_base.cpp.

◆ ~mFaderBase_c()

mFaderBase_c::~mFaderBase_c ( )
virtual

Destroys the fader.

Definition at line 18 of file m_fader_base.cpp.

Member Function Documentation

◆ setStatus()

virtual void mFaderBase_c::setStatus ( EStatus status)
pure virtual

Sets the fader's status.

Implemented in dWipeDokan_c, dWipeKuppa_c, dWipeMario_c, mColorFader_c, and mWipeFader_c.

◆ getStatus()

mFaderBase_c::EStatus mFaderBase_c::getStatus ( ) const
virtual

Gets the fader's status.

Definition at line 30 of file m_fader_base.cpp.

◆ fadeIn()

bool mFaderBase_c::fadeIn ( )
virtual

Initiates a fade in from pure blacked-out.

The screen must be OPAQUE for the operation to be executed.

Returns
If the action was carried out.

Reimplemented in dWipeDokan_c, dWipeKuppa_c, and dWipeMario_c.

Definition at line 34 of file m_fader_base.cpp.

◆ fadeOut()

bool mFaderBase_c::fadeOut ( )
virtual

Initiates a fade out from no-obstruction.

The screen must be HIDDEN for the operation to be executed.

Returns
If the action was carried out.

Reimplemented in dWipeDokan_c, dWipeKuppa_c, and dWipeMario_c.

Definition at line 44 of file m_fader_base.cpp.

◆ calc()

int mFaderBase_c::calc ( )
virtual

Calculates the fader at the current frame.

Returns
If the operation was successful.

Reimplemented in dWipeDokan_c, dWipeKuppa_c, dWipeMario_c, mColorFader_c, and mWipeFader_c.

Definition at line 54 of file m_fader_base.cpp.

◆ draw()

virtual void mFaderBase_c::draw ( )
pure virtual

Draws the fader.

Implemented in dWipeDokan_c, dWipeKuppa_c, dWipeMario_c, mColorFader_c, and mWipeFader_c.

◆ setFrame()

void mFaderBase_c::setFrame ( u16 duration)

Sets the duration of the fade. Duration must not be zero.

Definition at line 20 of file m_fader_base.cpp.

◆ setColor()

void mFaderBase_c::setColor ( const mColor & color)

Sets the fader's color. Alpha is not modified.

Definition at line 24 of file m_fader_base.cpp.

Member Data Documentation

◆ mStatus

EStatus mFaderBase_c::mStatus
protected

The fader's status.

Definition at line 55 of file m_fader_base.hpp.

◆ mFlag

u8 mFaderBase_c::mFlag
protected

The fader's flags.

Definition at line 56 of file m_fader_base.hpp.

◆ mFrameCount

u16 mFaderBase_c::mFrameCount
protected

The fader's duration.

Definition at line 57 of file m_fader_base.hpp.

◆ mCurrFrame

u16 mFaderBase_c::mCurrFrame
protected

The fader's current frame.

Definition at line 58 of file m_fader_base.hpp.

◆ mFaderColor

mColor mFaderBase_c::mFaderColor
protected

The fader's color.

Definition at line 59 of file m_fader_base.hpp.