OpenBarnyard
 
Loading...
Searching...
No Matches
AFade Class Reference

#include <AFade.h>

Inheritance diagram for AFade:

Classes

struct  Color
 

Public Member Functions

 AFade ()
 
virtual ~AFade ()=default
 
void Update (TFLOAT a_fDeltaTime)
 
void SetFadeTime (TFLOAT a_fFadeTime)
 
void SetFadeFromColor (const Color &a_rFadeFromColor)
 
void SetFadeToColor (const Color &a_rFadeToColor)
 
ColorGetCurrentColor (Color &a_rColor)
 
TBOOL IsStillFading (TBOOL a_bThrowFadeOver)
 
AGUI2RectangleGetRectangleElement ()
 
Toshi::TEmitter< AFade, TBOOL > & GetFadeOverEmitter ()
 

Friends

class AFadeManager
 

Detailed Description

Definition at line 8 of file AFade.h.

Constructor & Destructor Documentation

◆ AFade()

AFade::AFade ( )

Definition at line 10 of file AFade.cpp.

11 : m_FadeFromColor( 255, 255, 255, 255 ), m_FadeToColor( 255, 255, 255, 255 ), m_fCurrentTime( 0.0f ), m_FadeOverEmitter( this )
12{
13}

◆ ~AFade()

virtual AFade::~AFade ( )
virtualdefault

Member Function Documentation

◆ GetCurrentColor()

AFade::Color * AFade::GetCurrentColor ( Color & a_rColor)

Definition at line 30 of file AFade.cpp.

31{
32 TFLOAT fProgress = m_fCurrentTime / m_fFadeTime;
33 a_rColor.A = TUINT8( Toshi::TMath::LERP( m_FadeFromColor.A / 255.0f, m_FadeToColor.A / 255.0f, fProgress ) * 255.0f );
34 a_rColor.R = TUINT8( Toshi::TMath::LERP( m_FadeFromColor.R / 255.0f, m_FadeToColor.R / 255.0f, fProgress ) * 255.0f );
35 a_rColor.G = TUINT8( Toshi::TMath::LERP( m_FadeFromColor.G / 255.0f, m_FadeToColor.G / 255.0f, fProgress ) * 255.0f );
36 a_rColor.B = TUINT8( Toshi::TMath::LERP( m_FadeFromColor.B / 255.0f, m_FadeToColor.B / 255.0f, fProgress ) * 255.0f );
37
38 return &a_rColor;
39}
uint8_t TUINT8
Definition Typedefs.h:17
float TFLOAT
Definition Typedefs.h:4

◆ GetFadeOverEmitter()

Toshi::TEmitter< AFade, TBOOL > & AFade::GetFadeOverEmitter ( )
inline

Definition at line 59 of file AFade.h.

60 {
61 return m_FadeOverEmitter;
62 }

◆ GetRectangleElement()

AGUI2Rectangle & AFade::GetRectangleElement ( )
inline

Definition at line 54 of file AFade.h.

55 {
56 return m_Overlay;
57 }

◆ IsStillFading()

TBOOL AFade::IsStillFading ( TBOOL a_bThrowFadeOver)

Definition at line 41 of file AFade.cpp.

42{
43 if ( m_fFadeTime <= m_fCurrentTime )
44 {
45 if ( a_bThrowFadeOver )
46 {
47 m_FadeOverEmitter.Throw( TFALSE );
48 }
49
50 return TFALSE;
51 }
52
53 return TTRUE;
54}
#define TFALSE
Definition Typedefs.h:24
#define TTRUE
Definition Typedefs.h:25

◆ SetFadeFromColor()

void AFade::SetFadeFromColor ( const Color & a_rFadeFromColor)

Definition at line 20 of file AFade.cpp.

21{
22 m_FadeFromColor = a_rFadeFromColor;
23}

◆ SetFadeTime()

void AFade::SetFadeTime ( TFLOAT a_fFadeTime)

Definition at line 15 of file AFade.cpp.

16{
17 m_fFadeTime = a_fFadeTime;
18}

◆ SetFadeToColor()

void AFade::SetFadeToColor ( const Color & a_rFadeToColor)

Definition at line 25 of file AFade.cpp.

26{
27 m_FadeToColor = a_rFadeToColor;
28}

◆ Update()

void AFade::Update ( TFLOAT a_fDeltaTime)
inline

Definition at line 42 of file AFade.h.

43 {
44 m_fCurrentTime += a_fDeltaTime;
45 }

Friends And Related Symbol Documentation

◆ AFadeManager

friend class AFadeManager
friend

Definition at line 11 of file AFade.h.


The documentation for this class was generated from the following files: