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

#include <game/bases/d_wipe_circle.hpp>

Inheritance diagram for dWipeCircle_c:
[legend]

Description

A fader that animates a circle in/out.

Seen when entering a pipe, for example.

Definition at line 9 of file d_wipe_circle.hpp.

Public Types

enum  ACTION_e {
  OPEN_SETUP ,
  ANIME_END_CHECK ,
  CLOSE_SETUP ,
  IDLE ,
  ACTION_COUNT = IDLE
}
 The possible actions performed in calc. More...
 
enum  ANIM_e {
  IN ,
  OUT ,
  ANIM_COUNT
}
 The animations for this fader. More...
 
enum  ANIM_NAME_e {
  inWindow ,
  outWindow ,
  ANIM_NAME_COUNT
}
 The animation names used for the fader. More...
 
enum  W_PANE_e {
  W_circle_00 ,
  W_COUNT
}
 The window panes used for the 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 = BIT_FLAG(0) ,
  FADE_OUT_COMPLETE = BIT_FLAG(1)
}
 Some flags related to the fader. More...
 

Public Member Functions

 dWipeCircle_c (nw4r::ut::Color, mFaderBase_c::EStatus status)
 Constructs a new fader.
 
 ~dWipeCircle_c ()
 Destroys the fader.
 
bool createLayout ()
 Loads the resources and creates the layout for the fader.
 
void CenterPosSet ()
 Sets the circle's center position.
 
void OpenSetup ()
 Prepares the fade-out transition.
 
void AnimeEndCheck ()
 Checks if the fade animation has finished yet.
 
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 status)
 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 EStatus getStatus () const
 Gets the fader's status.
 
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 dWipeCircle_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::WindowmpWnd [W_COUNT]
 The window panes of the fader.
 
mVec2_c mCenterPos
 The screen position of the circle's center point.
 
ACTION_e mAction
 The action to be performed in calc.
 
bool mIsCreated
 Whether the layout for the fader has been created.
 
bool mHasTarget
 Whether the circle's center point needs to be targeted at a specific position.
 
bool mUseCenterPos
 Whether mCenterPos should be used as the circle's center point.
 

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 13 of file d_wipe_circle.hpp.

◆ ANIM_e

The animations for this fader.

Enumerator
IN 

Fade-in animation.

OUT 

Fade-out animation.

Definition at line 22 of file d_wipe_circle.hpp.

◆ ANIM_NAME_e

The animation names used for the fader.

Definition at line 29 of file d_wipe_circle.hpp.

◆ W_PANE_e

The window panes used for the fader.

Definition at line 36 of file d_wipe_circle.hpp.

Constructor & Destructor Documentation

◆ dWipeCircle_c()

dWipeCircle_c::dWipeCircle_c ( nw4r::ut::Color 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 10 of file d_wipe_circle.cpp.

◆ ~dWipeCircle_c()

dWipeCircle_c::~dWipeCircle_c ( )

Destroys the fader.

Definition at line 16 of file d_wipe_circle.cpp.

Member Function Documentation

◆ createLayout()

bool dWipeCircle_c::createLayout ( )

Loads the resources and creates the layout for the fader.

Returns
Whether the creation was successful.

Definition at line 20 of file d_wipe_circle.cpp.

◆ CenterPosSet()

void dWipeCircle_c::CenterPosSet ( )

Sets the circle's center position.

Definition at line 99 of file d_wipe_circle.cpp.

◆ OpenSetup()

void dWipeCircle_c::OpenSetup ( )

Prepares the fade-out transition.

Definition at line 181 of file d_wipe_circle.cpp.

◆ AnimeEndCheck()

void dWipeCircle_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 188 of file d_wipe_circle.cpp.

◆ CloseSetup()

void dWipeCircle_c::CloseSetup ( )

Prepares the fade-in transition.

Definition at line 204 of file d_wipe_circle.cpp.

◆ calc()

int dWipeCircle_c::calc ( )
virtual

Calculates the fader at the current frame.

Returns
If the operation was successful.

Reimplemented from mFaderBase_c.

Definition at line 70 of file d_wipe_circle.cpp.

◆ draw()

void dWipeCircle_c::draw ( )
virtual

Draws the fader.

Implements mFaderBase_c.

Definition at line 89 of file d_wipe_circle.cpp.

◆ setStatus()

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

Sets the fader's status.

Implements mFaderBase_c.

Definition at line 211 of file d_wipe_circle.cpp.

◆ fadeIn()

bool dWipeCircle_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 229 of file d_wipe_circle.cpp.

◆ fadeOut()

bool dWipeCircle_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 237 of file d_wipe_circle.cpp.

Member Data Documentation

◆ m_instance

dWipeCircle_c * dWipeCircle_c::m_instance
static

The instance of the fader.

Definition at line 68 of file d_wipe_circle.hpp.

◆ mLyt

LytBase_c dWipeCircle_c::mLyt
private

The layout for the fader.

Definition at line 71 of file d_wipe_circle.hpp.

◆ mpRootPane

nw4r::lyt::Pane* dWipeCircle_c::mpRootPane
private

The root pane of the fader layout.

Definition at line 72 of file d_wipe_circle.hpp.

◆ mpWnd

nw4r::lyt::Window* dWipeCircle_c::mpWnd[W_COUNT]
private

The window panes of the fader.

Definition at line 73 of file d_wipe_circle.hpp.

◆ mCenterPos

mVec2_c dWipeCircle_c::mCenterPos
private

The screen position of the circle's center point.

Definition at line 74 of file d_wipe_circle.hpp.

◆ mAction

ACTION_e dWipeCircle_c::mAction
private

The action to be performed in calc.

Definition at line 75 of file d_wipe_circle.hpp.

◆ mIsCreated

bool dWipeCircle_c::mIsCreated
private

Whether the layout for the fader has been created.

Definition at line 76 of file d_wipe_circle.hpp.

◆ mHasTarget

bool dWipeCircle_c::mHasTarget
private

Whether the circle's center point needs to be targeted at a specific position.

If set to false, the circle is centered on the screen automatically.

Definition at line 80 of file d_wipe_circle.hpp.

◆ mUseCenterPos

bool dWipeCircle_c::mUseCenterPos
private

Whether mCenterPos should be used as the circle's center point.

If set to false, the circle is centered on the current demo player.

Definition at line 84 of file d_wipe_circle.hpp.