| 289 | } |
| 290 | |
| 291 | void Tr2InteriorPlaceable::GetBatches( ITriRenderBatchAccumulator* batches, |
| 292 | TriBatchType batchType, |
| 293 | const Tr2PerObjectData* data, |
| 294 | Tr2RenderReason reason ) |
| 295 | { |
| 296 | if( !m_display ) |
| 297 | { |
| 298 | return; |
| 299 | } |
| 300 | |
| 301 | float maxDepth = Tr2Renderer::GetFrustumRadius(); |
| 302 | Matrix instanceToWorld = m_transform; |
| 303 | |
| 304 | if( m_placeableRes ) |
| 305 | { |
| 306 | // Get the model from the res |
| 307 | Tr2Model* model = m_placeableRes->GetVisualModel(); |
| 308 | if( model ) |
| 309 | { |
| 310 | unsigned int numMeshes = model->GetNumOfMeshes(); |
| 311 | |
| 312 | for( unsigned int i = 0; i < numMeshes; ++i ) |
| 313 | { |
| 314 | Tr2Mesh* mesh = model->GetMesh( i ); |
| 315 | |
| 316 | // Only gather transparent batches if the mesh isn't hidden |
| 317 | if( !mesh->GetDisplay() ) |
| 318 | { |
| 319 | continue; |
| 320 | } |
| 321 | auto geometry = mesh->GetGeometryResource(); |
| 322 | if( !geometry || !geometry->IsGood() ) |
| 323 | { |
| 324 | continue; |
| 325 | } |
| 326 | auto lod = geometry->GetMeshLod( mesh->GetMeshIndex(), 0 ); |
| 327 | if( !lod || !lod->m_allocationsValid ) |
| 328 | { |
| 329 | continue; |
| 330 | } |
| 331 | |
| 332 | // Get the transparent areas |
| 333 | Tr2MeshAreaVector* areas = mesh->GetAreas( batchType ); |
| 334 | |
| 335 | if( areas ) |
| 336 | { |
| 337 | // Loop over the transparent areas |
| 338 | for( auto& area : *areas ) |
| 339 | { |
| 340 | auto shader = area->GetMaterialInterface(); |
| 341 | |
| 342 | // If the area isn't hidden & has an effect |
| 343 | if( !area->GetDisplay() || !shader ) |
| 344 | { |
| 345 | continue; |
| 346 | } |
| 347 | |
| 348 | unsigned int depth = 0; |
nothing calls this directly
no test coverage detected