Skip to content

Commit

Permalink
Move variables to smaller scope. Code simplification. And some more c…
Browse files Browse the repository at this point in the history
…ode refactoring.
  • Loading branch information
intorr committed Dec 10, 2017
1 parent e604c3a commit a09f2eb
Show file tree
Hide file tree
Showing 2 changed files with 177 additions and 390 deletions.
41 changes: 1 addition & 40 deletions src/Layers/xrRender/D3DXRenderBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,6 @@ class D3DXRenderBase : public IRender, public pureFrame
R_dsgraph::mapSorted_T mapHUDEmissive;
#endif

// Runtime structures
xr_vector<R_dsgraph::mapNormalVS::TNode*, render_alloc<R_dsgraph::mapNormalVS::TNode*>> nrmVS;
#if defined(USE_DX10) || defined(USE_DX11)
xr_vector<R_dsgraph::mapNormalGS::TNode*, render_alloc<R_dsgraph::mapNormalGS::TNode*>> nrmGS;
#endif // USE_DX10
xr_vector<R_dsgraph::mapNormalPS::TNode*, render_alloc<R_dsgraph::mapNormalPS::TNode*>> nrmPS;
xr_vector<R_dsgraph::mapNormalCS::TNode*, render_alloc<R_dsgraph::mapNormalCS::TNode*>> nrmCS;
xr_vector<R_dsgraph::mapNormalStates::TNode*, render_alloc<R_dsgraph::mapNormalStates::TNode*>> nrmStates;
xr_vector<R_dsgraph::mapNormalTextures::TNode*, render_alloc<R_dsgraph::mapNormalTextures::TNode*>> nrmTextures;
xr_vector<R_dsgraph::mapNormalTextures::TNode*, render_alloc<R_dsgraph::mapNormalTextures::TNode*>> nrmTexturesTemp;

xr_vector<R_dsgraph::mapMatrixVS::TNode*, render_alloc<R_dsgraph::mapMatrixVS::TNode*>> matVS;
#if defined(USE_DX10) || defined(USE_DX11)
xr_vector<R_dsgraph::mapMatrixGS::TNode*, render_alloc<R_dsgraph::mapMatrixGS::TNode*>> matGS;
#endif // USE_DX10
xr_vector<R_dsgraph::mapMatrixPS::TNode*, render_alloc<R_dsgraph::mapMatrixPS::TNode*>> matPS;
xr_vector<R_dsgraph::mapMatrixCS::TNode*, render_alloc<R_dsgraph::mapMatrixCS::TNode*>> matCS;
xr_vector<R_dsgraph::mapMatrixStates::TNode*, render_alloc<R_dsgraph::mapMatrixStates::TNode*>> matStates;
xr_vector<R_dsgraph::mapMatrixTextures::TNode*, render_alloc<R_dsgraph::mapMatrixTextures::TNode*>> matTextures;
xr_vector<R_dsgraph::mapMatrixTextures::TNode*, render_alloc<R_dsgraph::mapMatrixTextures::TNode*>> matTexturesTemp;

xr_vector<R_dsgraph::_LodItem, render_alloc<R_dsgraph::_LodItem>> lstLODs;
xr_vector<int, render_alloc<int>> lstLODgroups;
xr_vector<ISpatial*> lstRenderables;
Expand Down Expand Up @@ -115,20 +94,6 @@ class D3DXRenderBase : public IRender, public pureFrame

void r_dsgraph_destroy()
{
nrmVS.clear();
nrmPS.clear();
nrmCS.clear();
nrmStates.clear();
nrmTextures.clear();
nrmTexturesTemp.clear();

matVS.clear();
matPS.clear();
matCS.clear();
matStates.clear();
matTextures.clear();
matTexturesTemp.clear();

lstLODs.clear();
lstLODgroups.clear();
lstRenderables.clear();
Expand All @@ -137,10 +102,6 @@ class D3DXRenderBase : public IRender, public pureFrame

lstRecorded.clear();

// mapNormal[0].destroy ();
// mapNormal[1].destroy ();
// mapMatrix[0].destroy ();
// mapMatrix[1].destroy ();
for (int i = 0; i < SHADER_PASSES_MAX; ++i)
{
mapNormalPasses[0][i].destroy();
Expand Down Expand Up @@ -169,7 +130,7 @@ class D3DXRenderBase : public IRender, public pureFrame
void r_dsgraph_insert_dynamic(dxRender_Visual* pVisual, Fvector& Center);
void r_dsgraph_insert_static(dxRender_Visual* pVisual);
// render primitives
void r_dsgraph_render_graph(u32 _priority, bool _clear = true);
void r_dsgraph_render_graph(u32 _priority);
void r_dsgraph_render_hud();
void r_dsgraph_render_hud_ui();
void r_dsgraph_render_lods(bool _setup_zb, bool _clear);
Expand Down
Loading

0 comments on commit a09f2eb

Please sign in to comment.