@@ -506,19 +506,19 @@ void CVRadDispMgr::MakePatches( void )
506
506
float flTotalArea = 0 .0f ;
507
507
508
508
// Create patches for all of the displacements.
509
- int nTreeCount = m_DispTrees.Count ();
510
- for ( int iTree = 0 ; iTree < nTreeCount; ++iTree )
509
+ const intp nTreeCount = m_DispTrees.Count ();
510
+ for ( auto &tree : m_DispTrees )
511
511
{
512
512
// Get the current displacement collision tree.
513
- CVRADDispColl *pDispTree = m_DispTrees[iTree] .m_pDispTree ;
513
+ CVRADDispColl *pDispTree = tree .m_pDispTree ;
514
514
if ( !pDispTree )
515
515
continue ;
516
516
517
517
flTotalArea += pDispTree->CreateParentPatches ();
518
518
}
519
519
520
520
// Print stats.
521
- qprintf ( " %i Displacements\n " , nTreeCount );
521
+ qprintf ( " %zd Displacements\n " , nTreeCount );
522
522
qprintf ( " %i Square Feet [%.2f Square Inches]\n " , ( int )( flTotalArea / 144 .0f ), flTotalArea );
523
523
}
524
524
// -----------------------------------------------------------------------------
@@ -619,11 +619,10 @@ void CVRadDispMgr::ClipRayToDispInLeaf( DispTested_t &dispTested, Ray_t const &r
619
619
620
620
void CVRadDispMgr::AddPolysForRayTrace ( void )
621
621
{
622
- int nTreeCount = m_DispTrees.Count ();
623
- for ( int iTree = 0 ; iTree < nTreeCount; ++iTree )
622
+ for ( auto &tree : m_DispTrees )
624
623
{
625
624
// Get the current displacement collision tree.
626
- CVRADDispColl *pDispTree = m_DispTrees[iTree] .m_pDispTree ;
625
+ CVRADDispColl *pDispTree = tree .m_pDispTree ;
627
626
628
627
// Add the triangles of the tree to the RT environment
629
628
pDispTree->AddPolysForRayTrace ();
0 commit comments