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

#include <AGUISystem.h>

Inheritance diagram for AGUISystem:

Public Types

using ThisClass = AGUISystem
 
using BaseClass = Toshi::TTask
 

Public Member Functions

virtual Toshi::TClass * GetClass () override
 
 AGUISystem ()
 
virtual TBOOL OnCreate () override
 
virtual void OnDestroy () override
 
void SetPicture (const Toshi::TPString8 &a_rName)
 
void ResetPicture ()
 
PGUITRRenderObjectGetRenderObject (TUINT a_uiIndex)
 
AGUIMatlibPictureGetMatlibPicture ()
 

Static Public Member Functions

static Toshi::TObject * CreateTObject ()
 
static Toshi::TObject * CreateTObjectInPlace (void *a_pPtr)
 
static void InitialiseClass ()
 
static void DeinitialiseClass ()
 
static TFORCEINLINE Toshi::TClass * GetClassStatic ()
 
static void AllowBackgroundClear (TBOOL a_bAllow)
 

Static Public Attributes

static constexpr Toshi::TClass * PARENTCLASS = & Toshi::TTask::ms_oClass
 
static Toshi::TClass ms_oClass = Toshi::TClass( "AGUISystem", AGUISystem::PARENTCLASS, AGUISystem::CreateTObject, AGUISystem::CreateTObjectInPlace, AGUISystem::InitialiseClass, AGUISystem::DeinitialiseClass, 0, 1, sizeof( AGUISystem ), alignof( AGUISystem ) )
 
static constexpr TUINT NUM_RENDER_OBJECTS = 2
 

Detailed Description

Definition at line 8 of file AGUISystem.h.

Member Typedef Documentation

◆ BaseClass

using AGUISystem::BaseClass = Toshi::TTask

Definition at line 12 of file AGUISystem.h.

◆ ThisClass

Definition at line 12 of file AGUISystem.h.

Constructor & Destructor Documentation

◆ AGUISystem()

AGUISystem::AGUISystem ( )

Definition at line 21 of file AGUISystem.cpp.

22{
23 m_Unk1 = 0;
24 m_Unk2 = 0;
25 m_Unk3 = 0;
26 m_pStrings = new Toshi::TPString8[ 2 ];
27 m_pStrings[ 0 ] = TPS8( ParkManager );
28 m_pStrings[ 1 ] = TPS8( Start );
29}
#define TPS8(STR)
Definition TPString8.h:16

Member Function Documentation

◆ AllowBackgroundClear()

void AGUISystem::AllowBackgroundClear ( TBOOL a_bAllow)
static

Definition at line 83 of file AGUISystem.cpp.

84{
85 if ( ms_pSingleton->m_pRenderObjects[ 0 ] != TNULL )
86 {
87 auto pViewport = ms_pSingleton->m_pRenderObjects[ 0 ]->GetViewport();
88
89 if ( pViewport )
90 {
91 pViewport->AllowBackgroundClear( a_bAllow );
92 }
93 }
94}
T * TSingleton< T >::ms_pSingleton
Definition TSingleton.h:75
#define TNULL
Definition Typedefs.h:23

◆ CreateTObject()

Toshi::TObject * AGUISystem::CreateTObject ( )
static

Definition at line 16 of file AGUISystem.cpp.

◆ CreateTObjectInPlace()

Toshi::TObject * AGUISystem::CreateTObjectInPlace ( void * a_pPtr)
static

Definition at line 16 of file AGUISystem.cpp.

◆ DeinitialiseClass()

void AGUISystem::DeinitialiseClass ( )
static

Definition at line 16 of file AGUISystem.cpp.

◆ GetClass()

Toshi::TClass * AGUISystem::GetClass ( )
overridevirtual

Definition at line 16 of file AGUISystem.cpp.

◆ GetClassStatic()

static TFORCEINLINE Toshi::TClass * AGUISystem::GetClassStatic ( )
inlinestatic

Definition at line 12 of file AGUISystem.h.

◆ GetMatlibPicture()

AGUIMatlibPicture & AGUISystem::GetMatlibPicture ( )
inline

Definition at line 30 of file AGUISystem.h.

31 {
32 return m_MatLibPicture;
33 }

◆ GetRenderObject()

PGUITRRenderObject * AGUISystem::GetRenderObject ( TUINT a_uiIndex)
inline

Definition at line 24 of file AGUISystem.h.

25 {
26 TASSERT( a_uiIndex < NUM_RENDER_OBJECTS );
27 return m_pRenderObjects[ a_uiIndex ];
28 }
#define TASSERT(X,...)
Definition Defines.h:138
static constexpr TUINT NUM_RENDER_OBJECTS
Definition AGUISystem.h:13

◆ InitialiseClass()

void AGUISystem::InitialiseClass ( )
static

Definition at line 16 of file AGUISystem.cpp.

◆ OnCreate()

TBOOL AGUISystem::OnCreate ( )
overridevirtual

Definition at line 31 of file AGUISystem.cpp.

32{
33 m_RenderGUIListener.Connect(
34 ARenderer::GetSingleton()->GetRenderGUIEmitter(),
35 this,
36 OnGUIRender,
37 0xffff8000
38 );
39
40 auto pDisplayParams = Toshi::TRenderInterface::GetSingleton()->GetCurrentDisplayParams();
41
42 for ( TUINT i = 0; i < NUM_RENDER_OBJECTS; i++ )
43 {
44 auto pViewport = new Toshi::TViewport( TTRUE );
45 pViewport->SetX( 0.0f );
46 pViewport->SetY( 0.0f );
47 pViewport->SetWidth( TFLOAT( pDisplayParams->uiWidth ) );
48 pViewport->SetHeight( TFLOAT( pDisplayParams->uiHeight ) );
49 pViewport->SetMinZ( 0.0f );
50 pViewport->SetMaxZ( 1.0f );
51 pViewport->SetBackgroundColor( 0, 0, 0, 0 );
52 pViewport->AllowBackgroundClear( TFALSE );
53 pViewport->AllowDepthClear( TTRUE );
54 pViewport->SetMemoryAllocatorBlock( AMemory::GetMemBlock( AMemory::POOL_Viewport ) );
55
56 m_pRenderObjects[ i ] = new PGUITRRenderObject( i );
57 m_pRenderObjects[ i ]->SetViewport( pViewport );
58 }
59
60 return TTRUE;
61}
unsigned int TUINT
Definition Typedefs.h:8
float TFLOAT
Definition Typedefs.h:4
#define TFALSE
Definition Typedefs.h:24
#define TTRUE
Definition Typedefs.h:25
@ POOL_Viewport
Definition AMemory.h:40
static Toshi::TMemory::MemBlock * GetMemBlock(POOL a_ePool)
Definition AMemory.cpp:38

◆ OnDestroy()

void AGUISystem::OnDestroy ( )
overridevirtual

Definition at line 63 of file AGUISystem.cpp.

64{
65 for ( TUINT i = 0; i < NUM_RENDER_OBJECTS; i++ )
66 {
67 delete m_pRenderObjects[ i ];
68 }
69
70 m_SomeListener.Disconnect();
71}

◆ ResetPicture()

void AGUISystem::ResetPicture ( )

Definition at line 125 of file AGUISystem.cpp.

126{
127 m_MatLibPicture.Flush();
128 m_MatLibPicture.Create( TPString8() );
129}

◆ SetPicture()

void AGUISystem::SetPicture ( const Toshi::TPString8 & a_rName)

Definition at line 96 of file AGUISystem.cpp.

97{
98 TBOOL bShowPicture = TFALSE;
99
100 if ( !a_rName.IsEmpty() && a_rName.GetString8().Length() != 0 )
101 {
102 bShowPicture = ( a_rName != m_MatLibPicture.GetName() );
103 }
104
105 if ( bShowPicture )
106 {
107 if ( ATerrainInterface::IsSingletonCreated() )
108 {
109 ATerrainInterface::GetSingleton()->WaitUntilLoaded();
110 }
111
112 m_MatLibPicture.Create( a_rName );
113 m_MatLibPicture.Flush();
114 m_MatLibPicture.Cache();
115 m_MatLibPicture.SetVisible();
116 }
117 else if ( a_rName.IsEmpty() || a_rName.GetString8().Length() == 0 )
118 {
119 m_MatLibPicture.Flush();
120 m_MatLibPicture.Create( a_rName );
121 m_MatLibPicture.SetHidden();
122 }
123}
bool TBOOL
Definition Typedefs.h:6

Member Data Documentation

◆ ms_oClass

Toshi::TClass AGUISystem::ms_oClass = Toshi::TClass( "AGUISystem", AGUISystem::PARENTCLASS, AGUISystem::CreateTObject, AGUISystem::CreateTObjectInPlace, AGUISystem::InitialiseClass, AGUISystem::DeinitialiseClass, 0, 1, sizeof( AGUISystem ), alignof( AGUISystem ) )
static

Definition at line 12 of file AGUISystem.h.

◆ NUM_RENDER_OBJECTS

TUINT AGUISystem::NUM_RENDER_OBJECTS = 2
staticconstexpr

Definition at line 13 of file AGUISystem.h.

◆ PARENTCLASS

Toshi::TClass* AGUISystem::PARENTCLASS = & Toshi::TTask::ms_oClass
staticconstexpr

Definition at line 12 of file AGUISystem.h.


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