#include <TIndexBlockResource_DX8.h>
|
static Toshi::TFreeList | ms_oFreeList = Toshi::TFreeList( sizeof( TIndexBlockResource ), 0, 8, "TIndexBlockResource" ) |
|
static constexpr size_t | MAXNAMELEN = 14 |
|
static constexpr Toshi::TClass * | PARENTCLASS = TNULL |
|
static constinit Toshi::TClass | ms_oClass = Toshi::TClass( "TObject", TObject::CreateTObject, TObject::CreateTObjectInPlace, TObject::InitialiseClass, TObject::DeinitialiseClass, 0, 2, sizeof( TObject ), alignof( TObject ) ) |
|
Definition at line 13 of file TIndexBlockResource_DX8.h.
◆ AttachPool()
Definition at line 37 of file TIndexBlockResource_DX8.cpp.
38{
40
43
45 {
47 }
48
50}
virtual void Invalidate() override
TUINT16 GetNumIndices() const
void SetParent(TResource *a_pParent)
◆ CanFit()
◆ ChildIndexUsedChanged()
void TIndexBlockResource::ChildIndexUsedChanged |
( |
TINT | a_iChange | ) |
|
◆ Create()
◆ CreateHAL()
TBOOL TIndexBlockResource::CreateHAL |
( |
| ) |
|
Definition at line 156 of file TIndexBlockResource_DX8.cpp.
157{
159
160 TMemory::HALMemInfo memInfoHAL;
162
164 DWORD usage = D3DUSAGE_WRITEONLY;
165
167 {
168 usage = D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY;
170 }
171
172 if ( !pRenderer->GetCurrentDevice()->SupportsHardwareTransfomations() )
173 {
174 usage |= D3DUSAGE_SOFTWAREPROCESSING;
175 }
176
177 HRESULT hRes = pRenderer->GetDirect3DDevice()->CreateIndexBuffer(
179 usage,
180 D3DFMT_INDEX16,
181 (
m_uiFlags & 1 ) ? D3DPOOL_MANAGED : D3DPOOL_DEFAULT,
183 );
184
185 if ( FAILED( hRes ) )
186 {
189 }
190
193
195}
static void GetHALMemInfo(HALMemInfo &a_rHALMemInfo)
TSIZE m_uiMemUsage
Total memory usage.
static void PrintError(TINT32 a_eError, const TCHAR *a_szInfo)
Prints error text caused by some directx call.
static TFORCEINLINE TRenderD3DInterface * Interface()
Gets the render interface singleton.
◆ CreateNew()
◆ DestroyHAL()
void TIndexBlockResource::DestroyHAL |
( |
| ) |
|
◆ DettachPool()
Definition at line 52 of file TIndexBlockResource_DX8.cpp.
53{
56
58
60 {
63 }
64
66}
void DestroyResource(TResource *resource)
TRenderInterface * GetRenderer() const
TNodeTree< T > * Tree() const
TBOOL IsExactly(TClass *a_pClass)
◆ GetHALBuffer()
TBOOL TIndexBlockResource::GetHALBuffer |
( |
HALBuffer * | a_pHALBuffer | ) |
const |
◆ Invalidate()
void TIndexBlockResource::Invalidate |
( |
| ) |
|
|
overridevirtual |
◆ Lock()
Definition at line 214 of file TIndexBlockResource_DX8.cpp.
215{
217
218 DWORD uiFlags;
219 TUINT uiNumIndices = 0;
221
222 if ( uiUnk1 == 1 )
223 {
224 uiFlags = D3DLOCK_NOSYSLOCK;
226 }
227 else
228 {
229 if ( uiUnk1 != 2 )
230 {
231 if ( uiUnk1 != 4 )
232 {
234 }
235
237 uiNumIndices = a_uiNumIndices;
238
240 {
241 uiFlags = D3DLOCK_DISCARD | D3DLOCK_NOSYSLOCK;
244 }
245 else
246 {
247 uiFlags = D3DLOCK_NOOVERWRITE | D3DLOCK_NOSYSLOCK;
250 }
251 }
252 else
253 {
255 uiFlags = D3DLOCK_DISCARD | D3DLOCK_NOSYSLOCK;
257 }
258 }
259
263 (BYTE**)&a_pLockBuffer->
pBuffer,
264 uiFlags
265 );
266
267 if ( FAILED( hRes ) )
268 {
270 }
271
274}
virtual TBOOL Validate() override
◆ operator delete() [1/2]
TFORCEINLINE void TIndexBlockResource::operator delete |
( |
void * | ptr | ) |
|
|
inline |
◆ operator delete() [2/2]
TFORCEINLINE void TIndexBlockResource::operator delete |
( |
void * | ptr, |
|
|
void * | where ) |
|
inline |
◆ operator new() [1/2]
TFORCEINLINE void * TIndexBlockResource::operator new |
( |
size_t | s | ) |
|
|
inline |
◆ operator new() [2/2]
TFORCEINLINE void * TIndexBlockResource::operator new |
( |
size_t | s, |
|
|
void * | where ) |
|
inline |
◆ SetupFreeList()
static void TIndexBlockResource::SetupFreeList |
( |
TINT | a_iCapacity, |
|
|
TINT | a_iGrowSize ) |
|
inlinestatic |
◆ TDECLARE_CLASS()
◆ TryInvalidate()
TBOOL TIndexBlockResource::TryInvalidate |
( |
| ) |
|
|
overridevirtual |
◆ TryValidate()
TBOOL TIndexBlockResource::TryValidate |
( |
| ) |
|
|
overridevirtual |
◆ Unlock()
void TIndexBlockResource::Unlock |
( |
| ) |
|
◆ Validate()
TBOOL TIndexBlockResource::Validate |
( |
| ) |
|
|
overridevirtual |
Reimplemented from TResource.
Definition at line 69 of file TIndexBlockResource_DX8.cpp.
70{
72 {
74 }
75
77 {
79 }
80
82 {
83 using Pair = T2Pair<TIndexBlockResource*, TIndexPoolResourceInterface::LockBuffer>;
84 Pair pair;
85
86 if (
Lock( &pair.second, 0 ) )
87 {
88 pair.first = this;
89
91 [](
TResource* a_pResource,
void* a_pUserData ) {
93 {
94 auto pPool =
TSTATICCAST( TIndexPoolResource, a_pResource );
96
97 if ( pPool->m_uiFlags & 1 )
98 {
99 pPool->m_uiIndexOffset = pPair->second.uiOffset;
100 pPair->second.uiOffset += pPool->GetNumIndices();
101
103 pPair->second.pBuffer + pPool->m_uiIndexOffset,
104 pPool->GetIndices(),
106 );
107 }
108 }
109
111 },
112 this,
113 &pair
114 );
115
117 }
118 }
119
121}
#define TSTATICCAST(POINTERTYPE, VALUE)
TBOOL Lock(TIndexPoolResourceInterface::LockBuffer *a_pLockBuffer, TUINT16 a_uiNumIndices)
TBOOL RecurseSimple(t_RecurseCb a_pCallback, TResource *a_pResource, void *a_pUserData)
static void * MemCopy(void *dst, const void *src, TSIZE size)
◆ m_HALBuffer
◆ m_pFactory
◆ m_uiFlags
TUINT TIndexBlockResource::m_uiFlags |
◆ m_uiIndicesUsed
TUINT TIndexBlockResource::m_uiIndicesUsed |
◆ m_uiLockCount
TUINT TIndexBlockResource::m_uiLockCount |
◆ m_uiMaxIndices
TUINT16 TIndexBlockResource::m_uiMaxIndices |
◆ m_uiOffset
TUINT TIndexBlockResource::m_uiOffset |
◆ m_Unk1
TUINT TIndexBlockResource::m_Unk1 |
◆ ms_oFreeList
Toshi::TFreeList TIndexBlockResource::ms_oFreeList = Toshi::TFreeList( sizeof( TIndexBlockResource ), 0, 8, "TIndexBlockResource" ) |
|
static |
The documentation for this class was generated from the following files: