Skip to content

Commit

Permalink
xrRender_R1: rename L_DB -> Lights
Browse files Browse the repository at this point in the history
Also changed the type from pointer to an object to be the same as in
other renderers
  • Loading branch information
Xottab-DUTY committed Oct 1, 2018
1 parent 822b350 commit 84e1800
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
7 changes: 2 additions & 5 deletions src/Layers/xrRender/LightTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,8 @@ void CROS_impl::update_smooth(IRenderable* O)

void CROS_impl::calc_sun_value(Fvector& position, IGameObject* _object)
{
#if RENDER == R_R1
light* sun = (light*)RImplementation.L_DB->sun._get();
#else
light* sun = (light*)RImplementation.Lights.sun._get();
#endif

if (MODE & IRender_ObjectSpecific::TRACE_SUN)
{
if (--result_sun < 0)
Expand Down Expand Up @@ -530,7 +527,7 @@ void CROS_impl::prepare_lights(Fvector& position, IRenderable* O)
}

#if RENDER == R_R1
light* sun = (light*)RImplementation.L_DB->sun._get();
light* sun = (light*)RImplementation.Lights.sun._get();

// Sun
float E = sun_smooth * sun->color.intensity();
Expand Down
9 changes: 4 additions & 5 deletions src/Layers/xrRenderPC_R1/FStaticRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ ShaderElement* CRender::rimp_select_sh_static(dxRender_Visual* pVisual, float cd
//////////////////////////////////////////////////////////////////////////
void CRender::create()
{
L_DB = nullptr;
L_Shadows = nullptr;
L_Projector = nullptr;

Expand Down Expand Up @@ -272,7 +271,7 @@ FSlideWindowItem* CRender::getSWI(int id)
return &SWIs[id];
}
IRender_Target* CRender::getTarget() { return Target; }
IRender_Light* CRender::light_create() { return L_DB->Create(); }
IRender_Light* CRender::light_create() { return Lights.Create(); }
IRender_Glow* CRender::glow_create() { return new CGlow(); }
void CRender::flush() { r_dsgraph_render_graph(0); }
BOOL CRender::occ_visible(vis_data& P) { return HOM.visible(P); }
Expand Down Expand Up @@ -476,9 +475,9 @@ void CRender::Calculate()
pPortal->bDualRender = TRUE;
}
}

//
if (L_DB)
L_DB->Update();
Lights.Update();

// Main process
marker++;
Expand Down Expand Up @@ -609,7 +608,7 @@ void CRender::Calculate()
{
vis_data& vis = L->get_homdata();
if (HOM.visible(vis))
L_DB->add_light(L);
Lights.add_light(L);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R1/FStaticRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CRender : public D3DXRenderBase
xr_vector<IDirect3DIndexBuffer9*> IB;
xr_vector<dxRender_Visual*> Visuals;
CPSLibrary PSLibrary;
CLight_DB* L_DB;
CLight_DB Lights;
CLightR_Manager* L_Dynamic;
CLightShadows* L_Shadows;
CLightProjector* L_Projector;
Expand Down
7 changes: 2 additions & 5 deletions src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ void CRender::level_Load(IReader* fs)
}

// Components

L_Shadows = new CLightShadows();
L_Projector = new CLightProjector();
L_DB = new CLight_DB();
L_Glows = new CGlowManager();
Wallmarks = new CWallmarksEngine();
Details = new CDetailManager();
Expand Down Expand Up @@ -133,7 +131,7 @@ void CRender::level_Unload()

//*** Lights
L_Glows->Unload();
L_DB->Unload();
Lights.Unload();

//*** Visuals
for (I = 0; I < Visuals.size(); I++)
Expand Down Expand Up @@ -161,7 +159,6 @@ void CRender::level_Unload()
xr_delete(Details);
xr_delete(Wallmarks);
xr_delete(L_Glows);
xr_delete(L_DB);
xr_delete(L_Projector);
xr_delete(L_Shadows);

Expand Down Expand Up @@ -278,7 +275,7 @@ void CRender::LoadVisuals(IReader* fs)
void CRender::LoadLights(IReader* fs)
{
// lights
L_DB->Load(fs);
Lights.Load(fs);

// glows
IReader* chunk = fs->open_chunk(fsL_GLOWS);
Expand Down

0 comments on commit 84e1800

Please sign in to comment.