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

#include <dol/bases/d_wipe_dokan.hpp>

Inheritance diagram for dWipeDokan_c:
[legend]

Description

A fader that animates a wavy texture across the screen.

Seen when entering a cloud area, for example. [This transition was used for the pipe transition earlier in development, which is why this class is called "dWipeDokan_c" (Dokan means "pipe")].

Definition at line 11 of file d_wipe_dokan.hpp.

Public Types

enum  ACTION_e {
  OPEN_SETUP ,
  ANIME_END_CHECK ,
  CLOSE_SETUP ,
  IDLE
}
 The possible actions performed in calc. More...
 
enum  ANIM_e {
  IN_DOWN ,
  OUT_UP ,
  OUT_DOWN ,
  IN_UP
}
 The animations for this fader. More...
 
- Public Types inherited from mFaderBase_c
enum  EStatus {
  OPAQUE ,
  HIDDEN ,
  FADE_IN ,
  FADE_OUT
}
 The fader's status. More...
 
enum  FLAG_e {
  FADE_IN_COMPLETE = 1 ,
  FADE_OUT_COMPLETE = 2
}
 Some flags related to the fader. More...
 

Public Member Functions

 dWipeDokan_c (nw4r::ut::Color, mFaderBase_c::EStatus stat)
 See mFaderBase_c::mFaderBase_c.
 
 ~dWipeDokan_c ()
 Destroys the fader.
 
bool createLayout ()
 Loads the resources and creates the layout for the fader.
 
void OpenSetup ()
 Prepares the fade-out transition.
 
void AnimeEndCheck ()
 Checks if the fade animation has finished yet.
 
bool MuKiDecision ()
 Returns whether the wipe should go upwards or downwards.
 
void CloseSetup ()
 Prepares the fade-in transition.
 
virtual int calc ()
 Calculates the fader at the current frame.
 
virtual void draw ()
 Draws the fader.
 
virtual void setStatus (mFaderBase_c::EStatus stat)
 Sets 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.
 
- Public Member Functions inherited from mFaderBase_c
 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.
 

Static Public Attributes

static dWipeDokan_cm_instance
 The instance of the fader.
 

Private Attributes

LytBase_c mLyt
 The layout for the fader.
 
nw4r::lyt::PanempRootPane
 The root pane of the fader layout.
 
nw4r::lyt::PicturempPic [1]
 The picture pane containing the fader texture.
 
ACTION_e mAction
 The action to be performed in calc.
 
bool mIsCreated
 Whether the layout for the fader has been created.
 

Additional Inherited Members

- Protected Attributes inherited from mFaderBase_c
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

◆ ACTION_e

The possible actions performed in calc.

Enumerator
OPEN_SETUP 

Prepare the fade-out transition.

ANIME_END_CHECK 

Fade has begun, waiting for it to end.

CLOSE_SETUP 

Prepare the fade-in transition.

IDLE 

The fade has not been started.

Definition at line 15 of file d_wipe_dokan.hpp.

◆ ANIM_e

The animations for this fader.

Enumerator
IN_DOWN 

Downward fade-in.

OUT_UP 

Upward fade-out.

OUT_DOWN 

Downward fade-out.

IN_UP 

Upward fade-in.

Definition at line 23 of file d_wipe_dokan.hpp.

Constructor & Destructor Documentation

◆ dWipeDokan_c()

dWipeDokan_c::dWipeDokan_c ( nw4r::ut::Color  color,
mFaderBase_c::EStatus  stat 
)

See mFaderBase_c::mFaderBase_c.

Definition at line 9 of file d_wipe_dokan.cpp.

◆ ~dWipeDokan_c()

dWipeDokan_c::~dWipeDokan_c ( )

Destroys the fader.

Definition at line 15 of file d_wipe_dokan.cpp.

Member Function Documentation

◆ createLayout()

bool dWipeDokan_c::createLayout ( )

Loads the resources and creates the layout for the fader.

Returns
Whether the creation was successful.

Definition at line 19 of file d_wipe_dokan.cpp.

◆ OpenSetup()

void dWipeDokan_c::OpenSetup ( )

Prepares the fade-out transition.

Definition at line 90 of file d_wipe_dokan.cpp.

◆ AnimeEndCheck()

void dWipeDokan_c::AnimeEndCheck ( )

Checks if the fade animation has finished yet.

If the animation has finished, sets the status accordingly and switches back to the IDLE action.

Definition at line 100 of file d_wipe_dokan.cpp.

◆ MuKiDecision()

bool dWipeDokan_c::MuKiDecision ( )

Returns whether the wipe should go upwards or downwards.

Returns
True = fade-in upwards, fade-out downwards. False = fade-in downwards, fade-out upwards.

Definition at line 114 of file d_wipe_dokan.cpp.

◆ CloseSetup()

void dWipeDokan_c::CloseSetup ( )

Prepares the fade-in transition.

Definition at line 126 of file d_wipe_dokan.cpp.

◆ calc()

int dWipeDokan_c::calc ( )
virtual

Calculates the fader at the current frame.

Returns
If the operation was successful.

Reimplemented from mFaderBase_c.

Definition at line 72 of file d_wipe_dokan.cpp.

◆ draw()

void dWipeDokan_c::draw ( )
virtual

Draws the fader.

Implements mFaderBase_c.

Definition at line 84 of file d_wipe_dokan.cpp.

◆ setStatus()

void dWipeDokan_c::setStatus ( mFaderBase_c::EStatus  stat)
virtual

Sets the fader's status.

The only allowed values are OPAQUE and HIDDEN.

Implements mFaderBase_c.

Definition at line 136 of file d_wipe_dokan.cpp.

◆ fadeIn()

bool dWipeDokan_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 from mFaderBase_c.

Definition at line 158 of file d_wipe_dokan.cpp.

◆ fadeOut()

bool dWipeDokan_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 from mFaderBase_c.

Definition at line 166 of file d_wipe_dokan.cpp.

Member Data Documentation

◆ m_instance

dWipeDokan_c * dWipeDokan_c::m_instance
static

The instance of the fader.

Definition at line 63 of file d_wipe_dokan.hpp.

◆ mLyt

LytBase_c dWipeDokan_c::mLyt
private

The layout for the fader.

Definition at line 66 of file d_wipe_dokan.hpp.

◆ mpRootPane

nw4r::lyt::Pane* dWipeDokan_c::mpRootPane
private

The root pane of the fader layout.

Definition at line 67 of file d_wipe_dokan.hpp.

◆ mpPic

nw4r::lyt::Picture* dWipeDokan_c::mpPic[1]
private

The picture pane containing the fader texture.

Definition at line 68 of file d_wipe_dokan.hpp.

◆ mAction

ACTION_e dWipeDokan_c::mAction
private

The action to be performed in calc.

Definition at line 69 of file d_wipe_dokan.hpp.

◆ mIsCreated

bool dWipeDokan_c::mIsCreated
private

Whether the layout for the fader has been created.

Definition at line 70 of file d_wipe_dokan.hpp.