summaryrefslogtreecommitdiffhomepage
path: root/src/chunk-scenery.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-05-10 14:11:02 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-05-11 00:33:47 +0200
commitf29ee994108bf443de4aeeabd7519f13ca4b7a4d (patch)
tree6f1ad0d719dcfcc5c5c199ce1d25c5531550835d /src/chunk-scenery.cpp
parentaad0d8fd8e2d3409db1b591c6dbc401e02eaeef3 (diff)
wip virtual entity stuff
Diffstat (limited to 'src/chunk-scenery.cpp')
-rw-r--r--src/chunk-scenery.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/chunk-scenery.cpp b/src/chunk-scenery.cpp
index 989670e4..edfbfeb1 100644
--- a/src/chunk-scenery.cpp
+++ b/src/chunk-scenery.cpp
@@ -139,7 +139,7 @@ auto chunk::ensure_scenery_mesh(scenery_scratch_buffers buffers) noexcept -> sce
const auto count = fm_begin(
size_t ret = 0;
for (const auto& e : _entities)
- ret += !e->is_dynamic();
+ ret += !e->is_dynamic() && !e->is_virtual();
return ret;
);
@@ -150,7 +150,8 @@ auto chunk::ensure_scenery_mesh(scenery_scratch_buffers buffers) noexcept -> sce
{
if (e->is_dynamic())
continue;
-
+ if (e->is_virtual())
+ continue;
const auto& atlas = e->atlas;
const auto& fr = *e;
const auto pos = e->coord.local();
@@ -178,13 +179,15 @@ auto chunk::ensure_scenery_mesh(scenery_scratch_buffers buffers) noexcept -> sce
const auto size = _entities.size();
auto& array = buffers.array;
- uint32_t j = 0;
- for (uint32_t i = 0; const auto& e : _entities)
+ uint32_t j = 0, i = 0;
+ for (const auto& e : _entities)
{
+ if (e->is_virtual())
+ continue;
auto index = e->is_dynamic() ? (uint32_t)-1 : j++;
array[i++] = { e.get(), (uint32_t)-1, e->ordinal(), make_topo_sort_data(*e, index) };
}
- topological_sort(array, size);
+ topological_sort(array, i);
return { scenery_mesh, ArrayView<entity_draw_order>{array, size}, j };
}