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

#include <dol/mLib/m_wipe_fader.hpp>

Inheritance diagram for mWipeFader_c:
[legend]

Description

A fader that wipes a texture in and out to/from the center of the screen.

Definition at line 6 of file m_wipe_fader.hpp.

Public Member Functions

 mWipeFader_c (mColor col, mFaderBase_c::EStatus status)
 
virtual void setStatus (EStatus status)
 Sets the fader's status.
 
virtual int calc ()
 Calculates the fader at the current frame.
 
virtual void draw ()
 Draws the fader.
 
virtual void setTexture (void *data, int width, int height)
 Sets the texture to use for the fader.
 
- 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.
 

Private Member Functions

virtual void calcMtx ()
 Calculates the texture matrix needed for drawing the texture to the screen.
 

Private Attributes

Mtx mTexMtx
 The texture matrix.
 
u8 mProgress
 A value from 0 to 255 that represents the current progress of the fader.
 
float mAspectRatioFactor
 How much to stretch the texture horizontally to compensate for the screen's aspect ratio.
 
void * mpTextureData
 The texture data.
 
int mTexWidth
 The width of the texture.
 
int mTexHeight
 The height of the texture.
 

Additional Inherited Members

- 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...
 
- 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.
 

Constructor & Destructor Documentation

◆ mWipeFader_c()

mWipeFader_c::mWipeFader_c ( mColor  col,
mFaderBase_c::EStatus  status 
)

Definition at line 5 of file m_wipe_fader.cpp.

◆ ~mWipeFader_c()

mWipeFader_c::~mWipeFader_c ( )
virtual

Definition at line 21 of file m_wipe_fader.cpp.

Member Function Documentation

◆ setStatus()

void mWipeFader_c::setStatus ( EStatus  status)
virtual

Sets the fader's status.

Implements mFaderBase_c.

Definition at line 30 of file m_wipe_fader.cpp.

◆ calc()

int mWipeFader_c::calc ( )
virtual

Calculates the fader at the current frame.

Returns
If the operation was successful.

Reimplemented from mFaderBase_c.

Definition at line 40 of file m_wipe_fader.cpp.

◆ draw()

void mWipeFader_c::draw ( )
virtual

Draws the fader.

Implements mFaderBase_c.

Definition at line 79 of file m_wipe_fader.cpp.

◆ setTexture()

void mWipeFader_c::setTexture ( void *  data,
int  width,
int  height 
)
virtual

Sets the texture to use for the fader.

Definition at line 24 of file m_wipe_fader.cpp.

◆ calcMtx()

void mWipeFader_c::calcMtx ( )
privatevirtual

Calculates the texture matrix needed for drawing the texture to the screen.

Automatically called by calc().

Definition at line 61 of file m_wipe_fader.cpp.

Member Data Documentation

◆ mTexMtx

Mtx mWipeFader_c::mTexMtx
private

The texture matrix.

Definition at line 22 of file m_wipe_fader.hpp.

◆ mProgress

u8 mWipeFader_c::mProgress
private

A value from 0 to 255 that represents the current progress of the fader.

Definition at line 23 of file m_wipe_fader.hpp.

◆ mAspectRatioFactor

float mWipeFader_c::mAspectRatioFactor
private

How much to stretch the texture horizontally to compensate for the screen's aspect ratio.

Definition at line 24 of file m_wipe_fader.hpp.

◆ mpTextureData

void* mWipeFader_c::mpTextureData
private

The texture data.

Definition at line 25 of file m_wipe_fader.hpp.

◆ mTexWidth

int mWipeFader_c::mTexWidth
private

The width of the texture.

Definition at line 26 of file m_wipe_fader.hpp.

◆ mTexHeight

int mWipeFader_c::mTexHeight
private

The height of the texture.

Definition at line 27 of file m_wipe_fader.hpp.