Skip to content

Commit baf96ec

Browse files
committed
fix codestyle issues #2
1 parent 39c3f31 commit baf96ec

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/Layers/xrRender_R2/r2_R_lights.cpp

+11-10
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ void CRender::render_lights(light_Package& LP)
4343
}
4444
}
4545

46+
// 2. refactor
4647
{
4748
xr_vector<light*>& source = LP.v_shadowed;
4849
xr_vector<light*> refactored;
@@ -129,14 +130,14 @@ void CRender::render_lights(light_Package& LP)
129130
}
130131
};
131132

132-
const auto& flush_lights = [] (CRender& render, xr_vector<task_data_t>& lights_queue)
133+
const auto& flush_lights = [] (xr_vector<task_data_t>& lights_queue)
133134
{
134135
for (const auto& [L, task, batch_id] : lights_queue)
135136
{
136137
VERIFY(task);
137138
TaskScheduler->Wait(*task);
138139

139-
auto& dsgraph = render.get_context(batch_id);
140+
auto& dsgraph = RImplementation.get_context(batch_id);
140141

141142
const bool bNormal = !dsgraph.mapNormalPasses[0][0].empty() || !dsgraph.mapMatrixPasses[0][0].empty();
142143
const bool bSpecial = !dsgraph.mapNormalPasses[1][0].empty() || !dsgraph.mapMatrixPasses[1][0].empty() ||
@@ -145,27 +146,27 @@ void CRender::render_lights(light_Package& LP)
145146
{
146147
PIX_EVENT_CTX(dsgraph.cmd_list, SHADOWED_LIGHT);
147148

148-
render.Stats.s_merged++;
149+
RImplementation.Stats.s_merged++;
149150
L_spot_s.push_back(L);
150-
render.Target->phase_smap_spot(dsgraph.cmd_list, L);
151+
RImplementation.Target->phase_smap_spot(dsgraph.cmd_list, L);
151152
dsgraph.cmd_list.set_xform_world(Fidentity);
152153
dsgraph.cmd_list.set_xform_view(L->X.S.view);
153154
dsgraph.cmd_list.set_xform_project(L->X.S.project);
154155
dsgraph.render_graph(0);
155156
if (ps_r2_ls_flags.test(R2FLAG_SUN_DETAILS))
156157
{
157-
if (check_grass_shadow(L, render.ViewBase))
158+
if (check_grass_shadow(L, RImplementation.ViewBase))
158159
{
159-
render.Details->fade_distance = -1; // Use light position to calc "fade"
160-
render.Details->light_position.set(L->position);
161-
render.Details->Render(dsgraph.cmd_list);
160+
RImplementation.Details->fade_distance = -1; // Use light position to calc "fade"
161+
RImplementation.Details->light_position.set(L->position);
162+
RImplementation.Details->Render(dsgraph.cmd_list);
162163
}
163164
}
164165
L->X.S.transluent = FALSE;
165166
if (bSpecial)
166167
{
167168
L->X.S.transluent = TRUE;
168-
render.Target->phase_smap_spot_tsh(dsgraph.cmd_list, L);
169+
RImplementation.Target->phase_smap_spot_tsh(dsgraph.cmd_list, L);
169170
PIX_EVENT_CTX(dsgraph.cmd_list, SHADOWED_LIGHTS_RENDER_GRAPH);
170171
dsgraph.render_graph(1); // normal level, secondary priority
171172
PIX_EVENT_CTX(dsgraph.cmd_list, SHADOWED_LIGHTS_RENDER_SORTED);
@@ -174,7 +175,7 @@ void CRender::render_lights(light_Package& LP)
174175
}
175176
else
176177
{
177-
render.Stats.s_finalclip++;
178+
RImplementation.Stats.s_finalclip++;
178179
}
179180

180181
L->svis[batch_id].end(); // NOTE(DX11): occqs are fetched here, this should be done on the imm context only

src/xrGame/space_restriction_shape.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ void CSpaceRestrictionShape::fill_shape(const CCF_Shape::shape_def& shape)
8686
std::mutex mergeMutex;
8787

8888
auto [begin, end] = graph.get_range(start, dest);
89-
xr_parallel_for(TaskRange(begin, end), [this, &mergeMutex, &graph] (const auto& range) {
89+
xr_parallel_for(TaskRange(begin, end), [this, &mergeMutex, &graph] (const auto& range)
90+
{
9091
xr_vector<u32> m_border_chunk;
9192
m_border_chunk.reserve(range.size());
92-
for (auto &vertex : range)
93+
for (const auto& vertex : range)
9394
{
9495
if (inside(graph.vertex_id(&vertex), true) &&
9596
!inside(graph.vertex_id(&vertex), false))
@@ -103,10 +104,11 @@ void CSpaceRestrictionShape::fill_shape(const CCF_Shape::shape_def& shape)
103104
});
104105

105106
#ifdef DEBUG
106-
xr_parallel_for(TaskRange(begin, end), [this, &mergeMutex, &graph] (const auto& range) {
107+
xr_parallel_for(TaskRange(begin, end), [this, &mergeMutex, &graph] (const auto& range)
108+
{
107109
xr_vector<u32> m_test_storage_chunk;
108110
m_test_storage_chunk.reserve(range.size());
109-
for (auto &vertex : range)
111+
for (const auto& vertex : range)
110112
{
111113
if (inside(graph.vertex_id(&vertex), false))
112114
m_test_storage_chunk.push_back(graph.vertex_id(&vertex));

0 commit comments

Comments
 (0)