#include <TVertexPoolResource_DX8.h>
|
using | t_RecurseCb = TBOOL ( * )( TResource* a_pResource, void* a_pUserData ) |
|
enum | { IsTObject = TTRUE
} |
|
static TBOOL | Recurse (t_RecurseCb a_pCallback, TResource *a_pResource, TBOOL a_bFlag, void *a_pUserData) |
|
static Toshi::TObject * | CreateTObject () |
|
static Toshi::TObject * | CreateTObjectInPlace (void *a_pPtr) |
|
static void | InitialiseClass () |
|
static void | DeinitialiseClass () |
|
static TFORCEINLINE TClass * | GetClassStatic () |
|
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 ) ) |
|
| TNode () |
|
TVertexFactoryResourceInterface * | m_pFactory |
|
TUINT16 | m_uiFlags |
|
TUINT16 | m_uiMaxVertices |
|
TUINT16 | m_uiNumVertices |
|
TUINT16 | m_uiLockCount |
|
TNodeTree< T > * | m_Tree |
|
T * | m_Next |
|
T * | m_Prev |
|
T * | m_Parent |
|
T * | m_Child |
|
Definition at line 10 of file TVertexPoolResource_DX8.h.
◆ TVertexPoolResource()
TVertexPoolResource::TVertexPoolResource |
( |
| ) |
|
Definition at line 17 of file TVertexPoolResource_DX8.cpp.
18{
19 m_uiVertexOffset = 0;
20 m_uiNumLocksAllTime = 0;
21 m_apManagedStreams[ 0 ] =
TNULL;
22 m_apManagedStreams[ 1 ] =
TNULL;
23 m_apManagedStreams[ 2 ] =
TNULL;
24 m_apManagedStreams[ 3 ] =
TNULL;
25 m_apManagedStreams[ 4 ] =
TNULL;
26 m_apManagedStreams[ 5 ] =
TNULL;
27 m_apManagedStreams[ 6 ] =
TNULL;
28 m_apManagedStreams[ 7 ] =
TNULL;
29}
◆ Create()
Reimplemented from TVertexPoolResourceInterface.
Definition at line 201 of file TVertexPoolResource_DX8.cpp.
202{
203 if ( a_uiFlags & 4 )
204 {
205 a_uiFlags = a_uiFlags & 0xfffb | 2;
206 }
207
209 {
211 {
212 auto& vertexFormat =
m_pFactory->GetVertexFormat();
213
214 for (
TUINT i = 0; i < vertexFormat.m_uiNumStreams; i++ )
215 {
216 m_apManagedStreams[ i ] =
new TBYTE[ a_uiMaxVertices * vertexFormat.m_aStreamFormats[ i ].m_uiVertexSize ];
218 }
219 }
220
222 }
223
225}
TVertexFactoryResourceInterface * m_pFactory
◆ GetHALBuffer()
Definition at line 263 of file TVertexPoolResource_DX8.cpp.
264{
266
268 {
271
272 if ( pVertexBlock->Validate() && pVertexBlock->GetHALBuffer( a_pHALBuffer ) )
273 {
276 }
277 }
278
280}
TVertexBlockResource * GetVertexBlock()
virtual TBOOL Validate() override
◆ GetManagedStream()
TBYTE * TVertexPoolResource::GetManagedStream |
( |
TUINT | a_uiStream | ) |
|
Definition at line 228 of file TVertexPoolResource_DX8.cpp.
229{
230 TASSERT( a_uiStream < m_pFactory->GetVertexFormat().GetNumStreams() );
231
232 if ( !
IsLocked() && a_uiStream < m_pFactory->GetVertexFormat().GetNumStreams() )
233 {
234 return m_apManagedStreams[ a_uiStream ];
235 }
236
238}
◆ GetParent()
TResource * TVertexPoolResource::GetParent |
( |
| ) |
|
◆ GetVertexBlock()
Definition at line 241 of file TVertexPoolResource_DX8.cpp.
242{
244 {
246 }
247
249}
#define TSTATICCAST(POINTERTYPE, VALUE)
friend TVertexBlockResource
TBOOL IsExactly(TClass *a_pClass)
◆ Invalidate()
void TVertexPoolResource::Invalidate |
( |
| ) |
|
|
overridevirtual |
◆ Lock()
Implements TVertexPoolResourceInterface.
Definition at line 118 of file TVertexPoolResource_DX8.cpp.
119{
121
123 m_uiNumLocksAllTime += 1;
125
126 if ( uiOldLockCount == 0 )
127 {
129
130 if ( uiUnk1 == 1 )
131 {
133
134 for (
TUINT i = 0; i < a_pLockBuffer->uiNumStreams; i++ )
135 {
136 a_pLockBuffer->apStreams[ i ] = m_apManagedStreams[ i ];
137 }
138
140 }
141 else if ( uiUnk1 == 2 )
142 {
144
146 {
147 m_uiVertexOffset = a_pLockBuffer->uiOffset;
149 }
150 }
151 else if ( uiUnk1 == 4 )
152 {
154
156 {
157 m_uiVertexOffset = a_pLockBuffer->uiOffset;
159 }
160 }
161 }
162
164}
virtual TBOOL Lock(LockBuffer *a_pLockBuffer) override
TUINT GetNumStreams() const
const TVertexFactoryFormat & GetVertexFormat() const
TUINT16 GetMaxVertices() const
TVertexFactoryResourceInterface * GetFactory() const
◆ OnDestroy()
void TVertexPoolResource::OnDestroy |
( |
| ) |
|
|
overridevirtual |
Reimplemented from TVertexPoolResourceInterface.
Definition at line 98 of file TVertexPoolResource_DX8.cpp.
99{
101 {
102 auto& vertexFormat =
m_pFactory->GetVertexFormat();
103
104 for (
TUINT i = 0; i < vertexFormat.m_uiNumStreams; i++ )
105 {
106 if ( m_apManagedStreams[ i ] )
107 {
108 delete[] m_apManagedStreams[ i ];
109 m_apManagedStreams[ i ] =
TNULL;
110 }
111 }
112 }
113
115}
virtual void OnDestroy() override
◆ TDECLARE_CLASS()
◆ Unlock()
void TVertexPoolResource::Unlock |
( |
TUINT16 | a_uiNewNumVertices | ) |
|
|
overridevirtual |
Implements TVertexPoolResourceInterface.
Definition at line 167 of file TVertexPoolResource_DX8.cpp.
168{
170
172 {
174
175 if ( iChange != 0 )
176 {
178 {
180 {
182 pVertexBlock->ChildVertexUsedChanged( iChange );
183 }
184 }
185 }
186
188
190 {
192 }
194 {
196 }
197 }
198}
TUINT16 GetNumVertices() const
virtual Toshi::TClass * GetClass()
TBOOL IsA(TClass *a_pClass)
◆ Validate()
TBOOL TVertexPoolResource::Validate |
( |
| ) |
|
|
overridevirtual |
Reimplemented from TResource.
Definition at line 32 of file TVertexPoolResource_DX8.cpp.
33{
35 {
37 }
38
40 auto pBlock = pFactory->FindBlockResource( this );
41
42 if ( !pBlock )
43 {
46
48
49 if ( uiUnk1 == 1 )
50 {
51 uiMaxVertices = pFactory->GetMaxStaticVertices();
52 uiFlags = 1;
53 }
54 else if ( uiUnk1 == 2 )
55 {
57 uiFlags = 2;
58 }
59 else
60 {
61 if ( uiUnk1 != 4 )
62 {
64 }
65
67 uiFlags = 4;
68 }
69
70 pBlock = pFactory->CreateBlockResource( uiMaxVertices, uiFlags );
71
72 if ( !pBlock )
73 {
75 }
76 }
77
78 pBlock->AttachPool( this );
80}
◆ TVertexBlockResource
friend TVertexPoolResource::TVertexBlockResource |
The documentation for this class was generated from the following files: