Skip to content

Commit

Permalink
fix codestyle issues
Browse files Browse the repository at this point in the history
  • Loading branch information
olefirenque committed Feb 1, 2024
1 parent b846569 commit 39c3f31
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender_R2/r2_R_lights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void CRender::render_lights(light_Package& LP)
for (u16 smap_ID = 0; refactored.size() != total; ++smap_ID)
{
LP_smap_pool.initialize(RImplementation.o.smapsize);
for (auto &L : source)
for (auto& L : source)
{
if (!L)
continue;
Expand Down
30 changes: 15 additions & 15 deletions src/xrAICore/Navigation/level_graph_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,34 +572,34 @@ template <typename P>
IC void CLevelGraph::iterate_vertices(
const Fvector& min_position, const Fvector& max_position, const P& predicate) const
{
auto [I, E] = get_range(min_position, max_position);
auto [begin, end] = get_range(min_position, max_position);

for (; I != E; ++I)
predicate(*I);
for (; begin != end; ++begin)
predicate(*begin);
}

IC std::pair<CLevelGraph::CLevelVertex *, CLevelGraph::CLevelVertex *> CLevelGraph::get_range(const Fvector& min_position, const Fvector& max_position) const
IC std::pair<CLevelGraph::CLevelVertex*, CLevelGraph::CLevelVertex*> CLevelGraph::get_range(const Fvector& min_position, const Fvector& max_position) const
{
const auto begin = m_nodes->begin(), end = m_nodes->end();
const auto _begin = m_nodes->begin(), _end = m_nodes->end();

CLevelVertex *I, *E;
CLevelVertex *begin, *end;
if (valid_vertex_position(min_position))
I = std::lower_bound(
begin, end, vertex_position(min_position).xz(), &vertex::predicate2);
begin = std::lower_bound(
_begin, _end, vertex_position(min_position).xz(), &vertex::predicate2);
else
I = begin;
begin = _begin;

if (valid_vertex_position(max_position))
{
E = std::upper_bound(
begin, end, vertex_position(max_position).xz(), &vertex::predicate);
if (E != (end))
++E;
end = std::upper_bound(
_begin, _end, vertex_position(max_position).xz(), &vertex::predicate);
if (end != (_end))
++end;
}
else
E = end;
end = _end;

return {I, E};
return { begin, end };
}

IC u32 CLevelGraph::max_x() const { return (m_max_x); }
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/cover_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void CCoverManager::compute_static_cover()
xr_delete(m_covers);

const CLevelGraph& graph = ai().level_graph();
const LevelGraph::CHeader &levelGraphHeader = graph.header();
const LevelGraph::CHeader& levelGraphHeader = graph.header();
const u32 levelVertexCount = levelGraphHeader.vertex_count();

m_covers = xr_new<CPointQuadTree>(levelGraphHeader.box(), levelGraphHeader.cell_size() * .5f, 8 * 65536, 4 * 65536);
Expand Down Expand Up @@ -107,7 +107,7 @@ void CCoverManager::compute_static_cover()
}
}
});
for (auto &p : quadTreeStaticStorage)
for (auto& p : quadTreeStaticStorage)
if (p.has_value())
m_covers->insert(&p.value());

Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/space_restriction_shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void CSpaceRestrictionShape::fill_shape(const CCF_Shape::shape_def& shape)
std::mutex mergeMutex;

auto [begin, end] = graph.get_range(start, dest);
xr_parallel_for(TaskRange{begin, end}, [this, &mergeMutex, &graph] (auto &range) {
xr_parallel_for(TaskRange(begin, end), [this, &mergeMutex, &graph] (const auto& range) {
xr_vector<u32> m_border_chunk;
m_border_chunk.reserve(range.size());
for (auto &vertex : range)
Expand All @@ -103,7 +103,7 @@ void CSpaceRestrictionShape::fill_shape(const CCF_Shape::shape_def& shape)
});

#ifdef DEBUG
xr_parallel_for(TaskRange{begin, end}, [this, &mergeMutex, &graph] (const auto &range) {
xr_parallel_for(TaskRange(begin, end), [this, &mergeMutex, &graph] (const auto& range) {
xr_vector<u32> m_test_storage_chunk;
m_test_storage_chunk.reserve(range.size());
for (auto &vertex : range)
Expand Down

0 comments on commit 39c3f31

Please sign in to comment.