Skip to content

Commit 84e1800

Browse files
committed
xrRender_R1: rename L_DB -> Lights
Also changed the type from pointer to an object to be the same as in other renderers
1 parent 822b350 commit 84e1800

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

src/Layers/xrRender/LightTrack.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,8 @@ void CROS_impl::update_smooth(IRenderable* O)
365365

366366
void CROS_impl::calc_sun_value(Fvector& position, IGameObject* _object)
367367
{
368-
#if RENDER == R_R1
369-
light* sun = (light*)RImplementation.L_DB->sun._get();
370-
#else
371368
light* sun = (light*)RImplementation.Lights.sun._get();
372-
#endif
369+
373370
if (MODE & IRender_ObjectSpecific::TRACE_SUN)
374371
{
375372
if (--result_sun < 0)
@@ -530,7 +527,7 @@ void CROS_impl::prepare_lights(Fvector& position, IRenderable* O)
530527
}
531528

532529
#if RENDER == R_R1
533-
light* sun = (light*)RImplementation.L_DB->sun._get();
530+
light* sun = (light*)RImplementation.Lights.sun._get();
534531

535532
// Sun
536533
float E = sun_smooth * sun->color.intensity();

src/Layers/xrRenderPC_R1/FStaticRender.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ ShaderElement* CRender::rimp_select_sh_static(dxRender_Visual* pVisual, float cd
5252
//////////////////////////////////////////////////////////////////////////
5353
void CRender::create()
5454
{
55-
L_DB = nullptr;
5655
L_Shadows = nullptr;
5756
L_Projector = nullptr;
5857

@@ -272,7 +271,7 @@ FSlideWindowItem* CRender::getSWI(int id)
272271
return &SWIs[id];
273272
}
274273
IRender_Target* CRender::getTarget() { return Target; }
275-
IRender_Light* CRender::light_create() { return L_DB->Create(); }
274+
IRender_Light* CRender::light_create() { return Lights.Create(); }
276275
IRender_Glow* CRender::glow_create() { return new CGlow(); }
277276
void CRender::flush() { r_dsgraph_render_graph(0); }
278277
BOOL CRender::occ_visible(vis_data& P) { return HOM.visible(P); }
@@ -476,9 +475,9 @@ void CRender::Calculate()
476475
pPortal->bDualRender = TRUE;
477476
}
478477
}
478+
479479
//
480-
if (L_DB)
481-
L_DB->Update();
480+
Lights.Update();
482481

483482
// Main process
484483
marker++;
@@ -609,7 +608,7 @@ void CRender::Calculate()
609608
{
610609
vis_data& vis = L->get_homdata();
611610
if (HOM.visible(vis))
612-
L_DB->add_light(L);
611+
Lights.add_light(L);
613612
}
614613
}
615614
}

src/Layers/xrRenderPC_R1/FStaticRender.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CRender : public D3DXRenderBase
5555
xr_vector<IDirect3DIndexBuffer9*> IB;
5656
xr_vector<dxRender_Visual*> Visuals;
5757
CPSLibrary PSLibrary;
58-
CLight_DB* L_DB;
58+
CLight_DB Lights;
5959
CLightR_Manager* L_Dynamic;
6060
CLightShadows* L_Shadows;
6161
CLightProjector* L_Projector;

src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ void CRender::level_Load(IReader* fs)
4646
}
4747

4848
// Components
49-
5049
L_Shadows = new CLightShadows();
5150
L_Projector = new CLightProjector();
52-
L_DB = new CLight_DB();
5351
L_Glows = new CGlowManager();
5452
Wallmarks = new CWallmarksEngine();
5553
Details = new CDetailManager();
@@ -133,7 +131,7 @@ void CRender::level_Unload()
133131

134132
//*** Lights
135133
L_Glows->Unload();
136-
L_DB->Unload();
134+
Lights.Unload();
137135

138136
//*** Visuals
139137
for (I = 0; I < Visuals.size(); I++)
@@ -161,7 +159,6 @@ void CRender::level_Unload()
161159
xr_delete(Details);
162160
xr_delete(Wallmarks);
163161
xr_delete(L_Glows);
164-
xr_delete(L_DB);
165162
xr_delete(L_Projector);
166163
xr_delete(L_Shadows);
167164

@@ -278,7 +275,7 @@ void CRender::LoadVisuals(IReader* fs)
278275
void CRender::LoadLights(IReader* fs)
279276
{
280277
// lights
281-
L_DB->Load(fs);
278+
Lights.Load(fs);
282279

283280
// glows
284281
IReader* chunk = fs->open_chunk(fsL_GLOWS);

0 commit comments

Comments
 (0)