OpenBarnyard
 
Loading...
Searching...
No Matches
TApplication.cpp
Go to the documentation of this file.
1#include "ToshiPCH.h"
2#include "TApplication.h"
3#include "Toshi/Typedefs.h"
4#include "Toshi/TString8.h"
5#include "Toshi/TSystem.h"
6#include "File/TFile.h"
7
8//-----------------------------------------------------------------------------
9// Enables memory debugging.
10// Note: Should be the last include!
11//-----------------------------------------------------------------------------
12#include "Core/TMemoryDebugOn.h"
13
15
16// $Barnyard: FUNCTION 006c16b0
18{
19 m_Flags = 0;
20}
21
22// $Barnyard: FUNCTION 006c17c0
23// $Barnyard: FUNCTION 006c16e0
28
29// $Barnyard: FUNCTION 006c17f0
30TBOOL TApplication::Create( const TCHAR* appName, TINT argc, TCHAR** argv )
31{
32 m_pDebugConsole = new TDebugConsole;
33
34 if ( IsConsoleEnabled() )
35 m_pDebugConsole->Show( TTRUE );
36
37 m_IsVerbose = TFALSE;
38 m_Name = appName;
39
40 return OnCreate( argc, argv );
41}
42
43// $Barnyard: FUNCTION 006c1760
48
49// $Barnyard: FUNCTION 006c16f0
51{
53
54 TBOOL bUpdateResult = TTRUE;
55 while ( bUpdateResult && !IsDestroyed() )
56 {
57 g_oSystemManager.Update();
58 bUpdateResult = OnUpdate( g_oSystemManager.GetTimer().GetDelta() );
59 }
60
61 return OnDestroy();
62}
63
64// $Barnyard: FUNCTION 006c1770
66{
67 m_Flags |= TApplicationFlag_Created;
68 return TTRUE;
69}
70
71// $Barnyard: FUNCTION 006c1780
73{
74 return ( m_Flags & TApplicationFlag_Destroyed ) == 0;
75}
76
77// $Barnyard: FUNCTION 006c1790
79{
80 m_Name = TString8();
81 return TTRUE;
82}
83
Core file system interface for the Toshi engine.
#define TASSERT(X,...)
Definition Defines.h:138
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
@ TApplicationFlag_Destroyed
@ TApplicationFlag_Created
Char string implementation for the Toshi engine.
TSystemManager g_oSystemManager
char TCHAR
Definition Typedefs.h:20
float TFLOAT
Definition Typedefs.h:4
int TINT
Definition Typedefs.h:7
#define TFALSE
Definition Typedefs.h:24
#define TTRUE
Definition Typedefs.h:25
bool TBOOL
Definition Typedefs.h:6
TBOOL Show(TBOOL state)
TBOOL IsCreated() const
virtual ~TApplication()
TBOOL Create(const TCHAR *appName, TINT argc, TCHAR **argv)
virtual TBOOL OnCreate(TINT argc, TCHAR **argv)
virtual TBOOL OnUpdate(float deltaTime)
TBOOL IsDestroyed() const
virtual TBOOL IsConsoleEnabled()
virtual TBOOL OnDestroy()