OpenBarnyard
 
Loading...
Searching...
No Matches
Toshi Namespace Reference

Classes

class  T2NamedPipeServer
 
class  T2NamedPipeServerThread
 
class  TBitField
 
struct  VirtualButtonDefinition
 

Enumerations

enum class  TTEXTURERESOURCEFORMAT {
  Unknown = 0 , R8G8B8A8 , R8G8B8 , R5G5B5A1 ,
  DDS , R4G4B4A4
}
 

Functions

void ThreadSleep (TUINT dwMilliseconds)
 
void FixPathSlashes (TString8 &a_rPath)
 
void FixPathSlashesBack (TString8 &a_rPath)
 
TString8 Platform_UnicodeToUTF8 (const TWCHAR *a_wszUnicodeString)
 
TString16 Platform_UTF8ToUnicode (const TCHAR *a_pchUTF8String)
 
unsigned long __stdcall ThreadEntry (void *userParam)
 
TREGION TRegion_GetRegion ()
 
void TRegion_SetRegion (TREGION a_eRegion)
 
void TRegion_LockRegion ()
 
void TRegion_UnlockRegion ()
 

Variables

TMemoryg_pMemory = nullptr
 
GLuint g_uiBoundFBO = 0
 
TBOOL g_bCreated = false
 
T2GlobalAllocator ms_oGlobalAllocator
 
TSystemManager g_oSystemManager
 
T2TestingFrameworkg_pTestingFramework
 
T2TestingFramework::FailCallback_t g_fnFailCallback
 
T2TestingFramework::SuccessCallback_t g_fnSuccessCallback
 

Enumeration Type Documentation

◆ TTEXTURERESOURCEFORMAT

Function Documentation

◆ FixPathSlashes()

void Toshi::FixPathSlashes ( TString8 & a_rPath)

Definition at line 24 of file Platform_Win.cpp.

25{
26 for ( TINT i = 0; i < a_rPath.Length(); i++ )
27 {
28 if ( a_rPath[ i ] == '/' )
29 a_rPath[ i ] = '\\';
30 }
31}
int TINT
Definition Typedefs.h:7
TINT Length() const
Definition TString8.h:93

◆ FixPathSlashesBack()

void Toshi::FixPathSlashesBack ( TString8 & a_rPath)

Definition at line 33 of file Platform_Win.cpp.

34{
35 for ( TINT i = 0; i < a_rPath.Length(); i++ )
36 {
37 if ( a_rPath[ i ] == '\\' )
38 a_rPath[ i ] = '/';
39 }
40}

◆ Platform_UnicodeToUTF8()

TString8 Toshi::Platform_UnicodeToUTF8 ( const TWCHAR * a_wszUnicodeString)

Definition at line 42 of file Platform_Win.cpp.

43{
44 TINT iStrLen;
45 if ( a_wszUnicodeString && ( iStrLen = T2String16::Length( a_wszUnicodeString ) ) )
46 {
47 TINT sizeRequired = WideCharToMultiByte( CP_UTF8, 0, a_wszUnicodeString, -1, NULL, 0, NULL, NULL );
48
49 if ( sizeRequired > 0 )
50 {
51 T2DynamicVector<TCHAR> utf8String;
52 utf8String.SetSize( sizeRequired );
53
54 TINT bytesConverted = WideCharToMultiByte( CP_UTF8, 0, a_wszUnicodeString, -1, &utf8String[ 0 ], sizeRequired, NULL, NULL );
55
56 if ( bytesConverted != 0 )
57 return &utf8String[ 0 ];
58 }
59 }
60
61 return "";
62}
static TSIZE Length(const TWCHAR *str)
void SetSize(TINT a_iNewSize)

◆ Platform_UTF8ToUnicode()

TString16 Toshi::Platform_UTF8ToUnicode ( const TCHAR * a_pchUTF8String)

Definition at line 64 of file Platform_Win.cpp.

65{
66 if ( a_pchUTF8String && ( T2String8::Length( a_pchUTF8String ) ) )
67 {
68 TINT sizeRequired = MultiByteToWideChar( CP_UTF8, 0, a_pchUTF8String, -1, NULL, 0 );
69
70 if ( sizeRequired > 0 )
71 {
72 T2DynamicVector<TWCHAR> utf16String;
73 utf16String.SetSize( sizeRequired );
74
75 TINT bytesConverted = MultiByteToWideChar( CP_UTF8, 0, a_pchUTF8String, -1, &utf16String[ 0 ], sizeRequired );
76
77 if ( bytesConverted != 0 )
78 return &utf16String[ 0 ];
79 }
80 }
81
82 return L"";
83}
static TSIZE Length(const TCHAR *str)

◆ ThreadEntry()

unsigned long __stdcall Toshi::ThreadEntry ( void * userParam)

Definition at line 17 of file TThread_Win.cpp.

18{
19 TThread* pThread = static_cast<TThread*>( userParam );
20 pThread->Main();
21 TThread::Exit( pThread );
22 return 0;
23}
virtual void Main()=0
static void Exit(TThread *a_pThread)

◆ ThreadSleep()

void Toshi::ThreadSleep ( TUINT dwMilliseconds)

Definition at line 19 of file Platform_Win.cpp.

20{
21 Sleep( dwMilliseconds );
22}

◆ TRegion_GetRegion()

TREGION Toshi::TRegion_GetRegion ( )

Definition at line 9 of file TRegion.cpp.

10{
11 return s_ToshiRegion;
12}

◆ TRegion_LockRegion()

void Toshi::TRegion_LockRegion ( )

Definition at line 20 of file TRegion.cpp.

21{
22 s_bRegionLocked = TTRUE;
23}
#define TTRUE
Definition Typedefs.h:25

◆ TRegion_SetRegion()

void Toshi::TRegion_SetRegion ( TREGION a_eRegion)

Definition at line 14 of file TRegion.cpp.

15{
16 TASSERT( !s_bRegionLocked );
17 s_ToshiRegion = a_eRegion;
18}
#define TASSERT(X,...)
Definition Defines.h:138

◆ TRegion_UnlockRegion()

void Toshi::TRegion_UnlockRegion ( )

Definition at line 25 of file TRegion.cpp.

26{
27 s_bRegionLocked = TFALSE;
28}
#define TFALSE
Definition Typedefs.h:24

Variable Documentation

◆ g_bCreated

TBOOL Toshi::g_bCreated = false

Definition at line 22 of file T2Render_GL.cpp.

◆ g_fnFailCallback

T2TestingFramework::FailCallback_t Toshi::g_fnFailCallback

Definition at line 92 of file T2TestingFramework.cpp.

◆ g_fnSuccessCallback

T2TestingFramework::SuccessCallback_t Toshi::g_fnSuccessCallback

Definition at line 93 of file T2TestingFramework.cpp.

◆ g_oSystemManager

TSystemManager Toshi::g_oSystemManager

Definition at line 15 of file TSystem.cpp.

◆ g_pMemory

TMemory* Toshi::g_pMemory = nullptr

Definition at line 131 of file TMemory.cpp.

◆ g_pTestingFramework

T2TestingFramework* Toshi::g_pTestingFramework

Definition at line 31 of file T2TestingFramework.cpp.

◆ g_uiBoundFBO

GLuint Toshi::g_uiBoundFBO = 0

Definition at line 36 of file T2FrameBuffer_GL.cpp.

◆ ms_oGlobalAllocator

T2GlobalAllocator Toshi::ms_oGlobalAllocator

Definition at line 12 of file T2Allocator.cpp.