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;
40 auto pBlock = pFactory->FindBlockResource(
this );
51 uiMaxVertices = pFactory->GetMaxStaticVertices();
54 else if ( uiUnk1 == 2 )
70 pBlock = pFactory->CreateBlockResource( uiMaxVertices, uiFlags );
78 pBlock->AttachPool(
this );
92 pVertexBlock->DettachPool(
this );
102 auto& vertexFormat =
m_pFactory->GetVertexFormat();
104 for (
TUINT i = 0; i < vertexFormat.m_uiNumStreams; i++ )
106 if ( m_apManagedStreams[ i ] )
108 delete[] m_apManagedStreams[ i ];
109 m_apManagedStreams[ i ] =
TNULL;
123 m_uiNumLocksAllTime += 1;
126 if ( uiOldLockCount == 0 )
136 a_pLockBuffer->
apStreams[ i ] = m_apManagedStreams[ i ];
141 else if ( uiUnk1 == 2 )
147 m_uiVertexOffset = a_pLockBuffer->
uiOffset;
151 else if ( uiUnk1 == 4 )
157 m_uiVertexOffset = a_pLockBuffer->
uiOffset;
182 pVertexBlock->ChildVertexUsedChanged( iChange );
205 a_uiFlags = a_uiFlags & 0xfffb | 2;
212 auto& vertexFormat =
m_pFactory->GetVertexFormat();
214 for (
TUINT i = 0; i < vertexFormat.m_uiNumStreams; i++ )
216 m_apManagedStreams[ i ] =
new TBYTE[ a_uiMaxVertices * vertexFormat.m_aStreamFormats[ i ].m_uiVertexSize ];
230 TASSERT( a_uiStream < m_pFactory->GetVertexFormat().GetNumStreams() );
232 if ( !
IsLocked() && a_uiStream < m_pFactory->GetVertexFormat().GetNumStreams() )
234 return m_apManagedStreams[ a_uiStream ];
272 if ( pVertexBlock->Validate() && pVertexBlock->GetHALBuffer( a_pHALBuffer ) )
#define TSTATICCAST(POINTERTYPE, VALUE)
#define TOSHI_NAMESPACE_START
#define TOSHI_NAMESPACE_END
#define TDEFINE_CLASS(...)
virtual void Invalidate() override
virtual TBOOL Lock(LockBuffer *a_pLockBuffer) override
virtual void Unlock(TUINT16 a_uiNewNumVertices) override
TVertexBlockResource * GetVertexBlock()
virtual TBOOL Validate() override
friend TVertexBlockResource
TBYTE * GetManagedStream(TUINT a_uiStream)
TBOOL GetHALBuffer(TVertexBlockResource::HALBuffer *a_pHALBuffer)
virtual void OnDestroy() override
virtual void Invalidate()
TUINT GetNumStreams() const
const TVertexFactoryFormat & GetVertexFormat() const
TUINT16 GetNumVertices() const
virtual void OnDestroy() override
TVertexFactoryResourceInterface * m_pFactory
TUINT16 GetMaxVertices() const
virtual TBOOL Create(TVertexFactoryResourceInterface *a_pFactory, TUINT16 a_uiMaxVertices, TUINT16 a_uiFlags)
TVertexFactoryResourceInterface * GetFactory() const
TBYTE * apStreams[TVertexFactoryFormat::MAX_NUM_STREAMS]
TNodeTree< T > * Tree() const
virtual Toshi::TClass * GetClass()
TBOOL IsA(TClass *a_pClass)
TBOOL IsExactly(TClass *a_pClass)