-------------------------------------------------------------------------------------- Description: Sets vertex layout for instance data. This invalidates all data. Arguments: layout - new vertex layout --------------------------------------------------------------------------------------
| 357 | // layout - new vertex layout |
| 358 | // -------------------------------------------------------------------------------------- |
| 359 | void Tr2RuntimeInstanceData::SetLayout( const Tr2VertexDefinition& layout ) |
| 360 | { |
| 361 | m_data.reset(); |
| 362 | g_sharedBuffer.Free( m_vb ); |
| 363 | m_stride = 0; |
| 364 | m_count = 0; |
| 365 | for( auto it = layout.m_items.begin(); it != layout.m_items.end(); ++it ) |
| 366 | { |
| 367 | if( it->m_stream != 0 ) |
| 368 | { |
| 369 | CCP_LOGERR( "Tr2PythonInstanceData: vertex layout needs to reference stream 0 only" ); |
| 370 | return; |
| 371 | } |
| 372 | m_stride = std::max( m_stride, it->m_offset + layout.GetDataTypeSizeInBytes( it->m_dataType ) ); |
| 373 | } |
| 374 | m_layout = layout; |
| 375 | m_vertexDeclaration = Tr2EffectStateManager::GetVertexDeclarationHandle( m_layout ); |
| 376 | } |
| 377 | |
| 378 | // -------------------------------------------------------------------------------------- |
| 379 | // Description: |
nothing calls this directly
no test coverage detected