@@ -601,30 +601,23 @@ void D3DXRenderBase::r_dsgraph_render_subspace(IRender_Sector* _sector, CFrustum
601601#include " SkeletonCustom.h"
602602#include " FLOD.h"
603603
604- void D3DXRenderBase::r_dsgraph_render_R1_box (IRender_Sector* _S , Fbox& BB, int sh)
604+ void D3DXRenderBase::r_dsgraph_render_R1_box (IRender_Sector* S , Fbox& BB, int sh)
605605{
606- CSector* S = (CSector*)_S;
607- lstVisuals.clear ();
608- lstVisuals.push_back (S->root ());
606+ xr_vector<dxRender_Visual*, render_alloc<dxRender_Visual*>> lstVisuals;
607+ lstVisuals.push_back (((CSector*)S)->root ());
609608
610- for (u32 test = 0 ; test < lstVisuals. size (); test++ )
609+ for (auto &it : lstVisuals)
611610 {
612- dxRender_Visual* V = lstVisuals[test];
613-
614611 // Visual is 100% visible - simply add it
615- xr_vector<dxRender_Visual *>::iterator I, E; // it may be usefull for 'hierrarhy' visuals
616-
617- switch (V->Type )
612+ switch (it->Type )
618613 {
619614 case MT_HIERRARHY:
620615 {
621616 // Add all children
622- FHierrarhyVisual* pV = (FHierrarhyVisual*)V;
623- I = pV->children .begin ();
624- E = pV->children .end ();
625- for (; I != E; I++)
617+ FHierrarhyVisual* pV = (FHierrarhyVisual*)it;
618+ for (auto &i : pV->children )
626619 {
627- dxRender_Visual* T = *I ;
620+ dxRender_Visual* T = i ;
628621 if (BB.intersect (T->vis .box ))
629622 lstVisuals.push_back (T);
630623 }
@@ -634,26 +627,22 @@ void D3DXRenderBase::r_dsgraph_render_R1_box(IRender_Sector* _S, Fbox& BB, int s
634627 case MT_SKELETON_RIGID:
635628 {
636629 // Add all children (s)
637- CKinematics* pV = (CKinematics*)V ;
630+ CKinematics* pV = (CKinematics*)it ;
638631 pV->CalculateBones (TRUE );
639- I = pV->children .begin ();
640- E = pV->children .end ();
641- for (; I != E; I++)
632+ for (auto &i : pV->children )
642633 {
643- dxRender_Visual* T = *I ;
634+ dxRender_Visual* T = i ;
644635 if (BB.intersect (T->vis .box ))
645636 lstVisuals.push_back (T);
646637 }
647638 }
648639 break ;
649640 case MT_LOD:
650641 {
651- FLOD* pV = (FLOD*)V;
652- I = pV->children .begin ();
653- E = pV->children .end ();
654- for (; I != E; I++)
642+ FLOD* pV = (FLOD*)it;
643+ for (auto &i : pV->children )
655644 {
656- dxRender_Visual* T = *I ;
645+ dxRender_Visual* T = i ;
657646 if (BB.intersect (T->vis .box ))
658647 lstVisuals.push_back (T);
659648 }
@@ -662,13 +651,13 @@ void D3DXRenderBase::r_dsgraph_render_R1_box(IRender_Sector* _S, Fbox& BB, int s
662651 default :
663652 {
664653 // Renderable visual
665- ShaderElement* E2 = V ->shader ->E [sh]._get ();
654+ ShaderElement* E2 = it ->shader ->E [sh]._get ();
666655 if (E2 && !(E2 ->flags .bDistort ))
667656 {
668657 for (u32 pass = 0 ; pass < E2 ->passes .size (); pass++)
669658 {
670659 RCache.set_Element (E2 , pass);
671- V ->Render (-1 .f );
660+ it ->Render (-1 .f );
672661 }
673662 }
674663 }
0 commit comments