diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/chunk-scenery.cpp | 16 | ||||
-rw-r--r-- | src/chunk-scenery.hpp | 4 | ||||
-rw-r--r-- | src/chunk.hpp | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp index 1bbb0da8..a4664b21 100644 --- a/src/chunk-scenery.cpp +++ b/src/chunk-scenery.cpp @@ -9,9 +9,9 @@ namespace floormat { -auto chunk::ensure_scenery_mesh(Array<draw_entity>&& array) noexcept -> scenery_mesh_tuple +auto chunk::ensure_scenery_mesh(Array<entity_draw_order>&& array) noexcept -> scenery_mesh_tuple { - return ensure_scenery_mesh(static_cast<Array<draw_entity>&>(array)); + return ensure_scenery_mesh(static_cast<Array<entity_draw_order>&>(array)); } bool chunk::topo_sort_data::intersects(const topo_sort_data& o) const @@ -20,7 +20,7 @@ bool chunk::topo_sort_data::intersects(const topo_sort_data& o) const min[1] <= o.max[1] && max[1] >= o.min[1]; } -static void topo_dfs(Array<chunk::draw_entity>& array, size_t& output, size_t i, size_t size) // NOLINT(misc-no-recursion) +static void topo_dfs(Array<chunk::entity_draw_order>& array, size_t& output, size_t i, size_t size) // NOLINT(misc-no-recursion) { using topo_sort_data = chunk::topo_sort_data; auto& data_i = array[i].data; @@ -62,7 +62,7 @@ static void topo_dfs(Array<chunk::draw_entity>& array, size_t& output, size_t i, //array[output++].e = } -static void topological_sort(Array<chunk::draw_entity>& array, size_t size) +static void topological_sort(Array<chunk::entity_draw_order>& array, size_t size) { size_t output = size-1; @@ -118,7 +118,7 @@ auto chunk::make_topo_sort_data(const entity& e) -> topo_sort_data return data; } -auto chunk::ensure_scenery_mesh(Array<draw_entity>& array) noexcept -> scenery_mesh_tuple +auto chunk::ensure_scenery_mesh(Array<entity_draw_order>& array) noexcept -> scenery_mesh_tuple { fm_assert(_entities_sorted); @@ -129,7 +129,7 @@ auto chunk::ensure_scenery_mesh(Array<draw_entity>& array) noexcept -> scenery_m array[i++] = { e.get(), e->ordinal(), make_topo_sort_data(*e) }; topological_sort(array, size); - const auto es = ArrayView<draw_entity>{array, size}; + const auto es = ArrayView<entity_draw_order>{array, size}; if (_scenery_modified) { @@ -181,7 +181,7 @@ auto chunk::ensure_scenery_mesh(Array<draw_entity>& array) noexcept -> scenery_m return { scenery_mesh, es, size }; } -void chunk::ensure_scenery_draw_array(Array<draw_entity>& array) +void chunk::ensure_scenery_draw_array(Array<entity_draw_order>& array) { const size_t len_ = _entities.size(); @@ -195,7 +195,7 @@ void chunk::ensure_scenery_draw_array(Array<draw_entity>& array) else len = std::bit_ceil(len_); - array = Array<draw_entity>{len}; + array = Array<entity_draw_order>{len}; } } // namespace floormat diff --git a/src/chunk-scenery.hpp b/src/chunk-scenery.hpp index 56efdfd7..fcb59c50 100644 --- a/src/chunk-scenery.hpp +++ b/src/chunk-scenery.hpp @@ -17,7 +17,7 @@ struct chunk::topo_sort_data bool intersects(const topo_sort_data& other) const; }; -struct chunk::draw_entity +struct chunk::entity_draw_order { const entity *e; float ord; @@ -25,7 +25,7 @@ struct chunk::draw_entity }; struct chunk::scenery_mesh_tuple { GL::Mesh& mesh; - ArrayView<draw_entity> array; + ArrayView<entity_draw_order> array; size_t size; }; diff --git a/src/chunk.hpp b/src/chunk.hpp index 4e2264f3..ddcf2c50 100644 --- a/src/chunk.hpp +++ b/src/chunk.hpp @@ -82,7 +82,7 @@ struct chunk final const size_t size; }; struct topo_sort_data; - struct draw_entity; + struct entity_draw_order; struct scenery_mesh_tuple; struct vertex { @@ -97,8 +97,8 @@ struct chunk final tile_atlas* ground_atlas_at(size_t i) const noexcept; wall_mesh_tuple ensure_wall_mesh() noexcept; tile_atlas* wall_atlas_at(size_t i) const noexcept; - scenery_mesh_tuple ensure_scenery_mesh(Array<draw_entity>&& array) noexcept; - scenery_mesh_tuple ensure_scenery_mesh(Array<draw_entity>& array) noexcept; + scenery_mesh_tuple ensure_scenery_mesh(Array<entity_draw_order>&& array) noexcept; + scenery_mesh_tuple ensure_scenery_mesh(Array<entity_draw_order>& array) noexcept; void ensure_passability() noexcept; RTree* rtree() noexcept; @@ -137,7 +137,7 @@ private: _teardown : 1 = false, _entities_sorted : 1 = true; - void ensure_scenery_draw_array(Array<draw_entity>& array); + void ensure_scenery_draw_array(Array<entity_draw_order>& array); static topo_sort_data make_topo_sort_data(const entity& e); struct bbox final // NOLINT(cppcoreguidelines-pro-type-member-init) |