#include <TTextureFactory.h>
|
| TDECLARE_CLASS (TTextureFactory, TResource) |
|
| TTextureFactory ()=default |
|
| ~TTextureFactory () |
|
virtual void | Dump () const |
|
virtual TTexture * | CreateTextureFromFile (const TCHAR *a_szFilePath, TUINT32 a_eTextureFlags)=0 |
|
virtual TTexture * | CreateTextureFromMemory (void *a_pData, TUINT a_uiDataSize, TUINT a_eTextureFlags, TUINT a_uiWidth, TUINT a_uiHeight)=0 |
|
virtual TTexture * | CreateEx (void *a_pData, TUINT a_uiDataSize, TUINT a_uiWidth, TUINT a_uiHeight, TUINT a_uiMipLevels, TTEXTURERESOURCEFORMAT a_eFormat, TUINT a_uiMipMapFlags)=0 |
|
virtual TTexture * | CreateFromT2Texture (T2Texture *a_pTexture)=0 |
|
TNodeList< NameEntry > * | GetList (TUINT a_uiList) |
|
TTexture * | FindTexture (const TCHAR *a_szName) const |
|
NameEntry * | RegisterTexture (const TCHAR *a_szName, TTexture *a_pTexture) |
|
void | DeregisterTexture (TTexture *a_pTexture) |
|
| TDECLARE_CLASS (TResource, TObject) |
|
| TResource () |
|
| ~TResource () |
|
virtual TBOOL | Create () |
|
virtual TBOOL | Validate () |
|
virtual void | Invalidate () |
|
virtual void | DestroyResource () |
|
virtual TBOOL | TryInvalidate () |
|
virtual TBOOL | TryValidate () |
|
virtual void | OnDestroy () |
|
TBOOL | IsDead () const |
|
TBOOL | IsDying () const |
|
TBOOL | IsValid () const |
|
TBOOL | IsExternal () const |
|
TBOOL | IsCreated () const |
|
TBOOL | IsSceneObject () const |
|
TBOOL | IsInvalid () const |
|
void | SetState (TResourceState newState) |
|
void | AddState (TResourceState state) |
|
void | SetParent (TResource *a_pParent) |
|
const TCHAR * | GetName () const |
|
void | SetName (const TCHAR *name) |
|
TBOOL | RecurseSimple (t_RecurseCb a_pCallback, TResource *a_pResource, void *a_pUserData) |
|
TRenderInterface * | GetRenderer () const |
|
void | SetRenderer (TRenderInterface *pRenderer) |
|
TUINT32 | GetUId () const |
|
void | SetUId (TUINT32 uid) |
|
virtual Toshi::TClass * | GetClass () |
|
virtual void | Delete () |
|
virtual | ~TObject () |
|
TBOOL | IsExactly (TClass *a_pClass) |
|
TBOOL | IsA (TClass *a_pClass) |
|
TBOOL | IsChildOfDefaultRoot () const |
|
TBOOL | IsLinked () const |
|
T * | Parent () const |
|
T * | Next () const |
|
T * | Prev () const |
|
TNodeTree< T > * | Tree () const |
|
T * | Child () const |
|
Definition at line 12 of file TTextureFactory.h.
◆ TTextureFactory()
TTextureFactory::TTextureFactory |
( |
| ) |
|
|
default |
◆ ~TTextureFactory()
TTextureFactory::~TTextureFactory |
( |
| ) |
|
Definition at line 29 of file TTextureFactory.cpp.
30{
32 {
33 m_aLists[ i ].DeleteAll();
34 }
35}
static constexpr TUINT32 NUM_LISTS
◆ CreateEx()
virtual TTexture * TTextureFactory::CreateEx |
( |
void * | a_pData, |
|
|
TUINT | a_uiDataSize, |
|
|
TUINT | a_uiWidth, |
|
|
TUINT | a_uiHeight, |
|
|
TUINT | a_uiMipLevels, |
|
|
TTEXTURERESOURCEFORMAT | a_eFormat, |
|
|
TUINT | a_uiMipMapFlags ) |
|
pure virtual |
◆ CreateFromT2Texture()
◆ CreateTextureFromFile()
virtual TTexture * TTextureFactory::CreateTextureFromFile |
( |
const TCHAR * | a_szFilePath, |
|
|
TUINT32 | a_eTextureFlags ) |
|
pure virtual |
◆ CreateTextureFromMemory()
virtual TTexture * TTextureFactory::CreateTextureFromMemory |
( |
void * | a_pData, |
|
|
TUINT | a_uiDataSize, |
|
|
TUINT | a_eTextureFlags, |
|
|
TUINT | a_uiWidth, |
|
|
TUINT | a_uiHeight ) |
|
pure virtual |
◆ DeregisterTexture()
void TTextureFactory::DeregisterTexture |
( |
TTexture * | a_pTexture | ) |
|
Definition at line 82 of file TTextureFactory.cpp.
83{
85
87
88 if ( pNameEntry )
89 {
90 pNameEntry->Remove();
91 delete pNameEntry;
92 }
93}
TTextureFactory::NameEntry * m_pNameEntry
◆ Dump()
void TTextureFactory::Dump |
( |
| ) |
const |
|
virtual |
Definition at line 37 of file TTextureFactory.cpp.
38{
40
42 {
43 for ( auto it = m_aLists[ i ].Begin(); it != m_aLists[ i ].End(); it++ )
44 {
45 TTRACE(
"[%d] Texture [%s]: W=%d , H=%d\n", uiTexIndex++, it->GetName(), it->GetTexture()->GetWidth(), it->GetTexture()->GetHeight() );
46 }
47 }
48}
◆ FindTexture()
TTexture * TTextureFactory::FindTexture |
( |
const TCHAR * | a_szName | ) |
const |
Definition at line 56 of file TTextureFactory.cpp.
57{
58 auto pList = &m_aLists[
HashName( a_szName ) ];
59
60 for ( auto it = pList->Begin(); it != pList->End(); it++ )
61 {
63 {
64 return it->GetTexture();
65 }
66 }
67
69}
static TUINT32 HashName(const TCHAR *a_szName)
static TINT String8CompareNoCase(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)
◆ GetList()
◆ HashName()
Definition at line 95 of file TTextureFactory.cpp.
96{
98
100 {
101 iHash += a_szName[ i ];
102 }
103
105}
static TSIZE String8Length(const TCHAR *str)
◆ RegisterTexture()
Definition at line 71 of file TTextureFactory.cpp.
72{
73 auto pList = &m_aLists[
HashName( a_szName ) ];
74 auto pEntry = new TTextureFactory::NameEntry( a_szName, a_pTexture );
75
77 pList->InsertHead( pEntry );
78
80}
◆ TDECLARE_CLASS()
◆ NUM_LISTS
TUINT32 TTextureFactory::NUM_LISTS = 1024 |
|
staticconstexpr |
The documentation for this class was generated from the following files: