MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetBatchWithEffect

Method GetBatchWithEffect

trinity/Eve/UI/EveSpherePin.cpp:359–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359void EveSpherePin::GetBatchWithEffect( ITriRenderBatchAccumulator* accumulator, const Tr2PerObjectData* perObjectData, Tr2Effect* effect )
360{
361 if( !m_geometryResource )
362 {
363 return;
364 }
365
366 if( !m_geometryResource->IsGood() )
367 {
368 return;
369 }
370
371 if( m_geometryResource->GetMeshCount() < 1 )
372 {
373 return;
374 }
375
376 const TriGeometryResLodData* lod = m_geometryResource->GetMeshLod( 0, 0 );
377 if( !lod || !lod->m_allocationsValid )
378 {
379 return;
380 }
381
382 if( !m_indexBuffer.IsValid() )
383 {
384 return;
385 }
386
387 Tr2RenderBatch batch;
388 batch.SetMaterial( effect );
389 batch.SetPerObjectData( perObjectData );
390 batch.SetGeometry( lod->m_mesh->m_vertexDeclarationHandle, lod->m_vertexAllocation.GetBuffer(), lod->m_vertexAllocation.GetStride(), m_indexBuffer, m_indexBuffer.GetDesc().stride );
391 batch.SetDrawIndexedInstanced( m_primitiveCount * 3, 1, 0, lod->m_vertexAllocation.GetOffset() / lod->m_vertexAllocation.GetStride(), 0 );
392 accumulator->Commit( batch );
393}
394
395void EveSpherePin::GetPickingBatches( ITriRenderBatchAccumulator* batches, Tr2PickTypes pickTypes, const Tr2PerObjectData* perObjectData )
396{

Callers

nothing calls this directly

Calls 12

SetGeometryMethod · 0.80
IsGoodMethod · 0.45
GetMeshCountMethod · 0.45
GetMeshLodMethod · 0.45
IsValidMethod · 0.45
SetMaterialMethod · 0.45
SetPerObjectDataMethod · 0.45
GetBufferMethod · 0.45
GetStrideMethod · 0.45
GetOffsetMethod · 0.45
CommitMethod · 0.45

Tested by

no test coverage detected