20 m_pVertexPool =
TNULL;
30 if ( m_SomeString.Length() == 0 && ( !m_pVertexPool || !m_pIndexPool ) )
35 m_pVertexPool->Validate();
36 m_pIndexPool->Validate();
45 if ( m_pVertexPool && m_pIndexPool )
56void ASysMesh::DestroyResources()
63 m_pVertexPool =
TNULL;
79 m_SomeString = a_szSomeString;
85 m_uiFlags = a_uiResourcesFlags;
86 m_uiMaxVertices = a_uiMaxVertices;
87 m_uiMaxIndices = a_uiMaxIndices;
89 if ( !CreateResource() )
98TBOOL ASysMesh::CreateResource()
105 if ( ( m_uiFlags & 1 ) == 0 )
107 if ( ( m_uiFlags & 2 ) == 0 )
109 if ( ( m_uiFlags & 4 ) != 0 )
111 uiVertexPoolFlags = 4;
116 uiVertexPoolFlags = 2;
121 uiVertexPoolFlags = 1;
124 m_pVertexPool = pVertexFactory->CreatePoolResource( m_uiMaxVertices, uiVertexPoolFlags );
132 if ( ( m_uiFlags & 8 ) == 0 )
134 if ( ( m_uiFlags & 0x10 ) == 0 )
136 if ( ( m_uiFlags & 0x20 ) != 0 )
138 uiIndexPoolFlags = 4;
143 uiIndexPoolFlags = 2;
148 uiIndexPoolFlags = 1;
152 m_pIndexPool = pIndexFactory->CreatePoolResource( m_uiMaxVertices, ( -(
TUINT)( ( m_uiFlags & 0x40 ) != 0 ) & 0xfffffff8 ) + 16 | uiIndexPoolFlags );
160 TASSERT( 0 == ( m_uiFlags & FLAG_LOCKED ) );
162 if ( m_pVertexPool->Lock( &a_rLockBuffer.
VertexLock ) )
164 if ( m_pIndexPool->Lock( &a_rLockBuffer.
IndexLock ) )
166 m_uiFlags |= FLAG_LOCKED;
176 TASSERT( 0 != ( m_uiFlags & FLAG_LOCKED ) );
178 if (
TINT16( a_uiNumVertices ) == -1 )
180 a_uiNumVertices = m_pVertexPool->GetNumVertices();
183 if (
TINT16( a_uiNumIndices ) == -1 )
185 a_uiNumIndices = m_pIndexPool->GetNumIndices();
188 m_pVertexPool->Unlock( a_uiNumVertices );
189 m_pIndexPool->Unlock( a_uiNumIndices );
190 m_uiFlags &= FLAG_LOCKED;
195 return m_pVertexPool;
@ SYSRESOURCE_VFSYSVNDUV1
Rendering system interface for the Toshi engine.
#define TOSHI_NAMESPACE_USING
#define TDEFINE_CLASS_NORUNTIME(...)
virtual void Invalidate()
T * GetSystemResource(SYSRESOURCE systemResource)
void DestroyResource(TResource *resource)
static TFORCEINLINE TRenderInterface * GetSingleton()
virtual TBOOL CreatePools(TUINT32 a_uiFlags, TUINT16 a_uiMaxVertices, TUINT16 a_uiMaxIndices)
virtual void Invalidate() override
virtual void Unlock(TUINT32 a_uiNumVertices, TUINT32 a_uiNumIndices)
virtual Toshi::TIndexPoolResourceInterface * GetIndexPool()
virtual TBOOL Create(void *a_pUnk, const TCHAR *a_szSomeString)
virtual TBOOL Validate() override
virtual Toshi::TVertexPoolResourceInterface * GetVertexPool()
virtual TBOOL Lock(LockBuffer &a_rLockBuffer)
Toshi::TVertexPoolResourceInterface::LockBuffer VertexLock
Toshi::TIndexPoolResourceInterface::LockBuffer IndexLock