Skip to content

use ecsact C++ core api for tests #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ http_archive(

http_archive(
name = "ecsact_runtime",
sha256 = "", # https://github.com/ecsact-dev/ecsact_runtime/pull/139
strip_prefix = "ecsact_runtime-9d243cca4550fe3fa92aa3526466e7933d5d77ae",
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/9d243cca4550fe3fa92aa3526466e7933d5d77ae.zip",
sha256 = "", # https://github.com/ecsact-dev/ecsact_runtime/pull/140
strip_prefix = "ecsact_runtime-e9689a232254c56107ff022c546ee03f53e1f04a",
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/e9689a232254c56107ff022c546ee03f53e1f04a.zip",
)

load("@rules_ecsact//ecsact:repositories.bzl", "ecsact_register_toolchains", "rules_ecsact_dependencies")
Expand Down
14 changes: 13 additions & 1 deletion ecsact/entt/runtime.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,6 @@ private:
});
auto entt_id = info.get_entt_entity_id(entity);
info.registry.template emplace<destroyed_entity>(entt_id);
info.destroy_entity(entity);
}
}

Expand Down Expand Up @@ -1274,6 +1273,18 @@ private:
return result;
}

auto _destroy_entities(registry_info& info) {
using ecsact::entt::detail::destroyed_entity;

::entt::basic_view destroy_view{
info.registry.template storage<destroyed_entity>(),
};

for(entt_entity_type entity : destroy_view) {
info.destroy_entity(info.get_ecsact_entity_id(entity));
}
}

public:
#ifdef ECSACT_ENTT_RUNTIME_DYNAMIC_SYSTEM_IMPLS
bool set_system_execution_impl(
Expand Down Expand Up @@ -1335,6 +1346,7 @@ public:
_trigger_remove_component_events(info, *events_collector);
_trigger_destroy_entity_event(info, *events_collector);
}
_destroy_entities(info);
_clear_event_markers(info);

info.mutex = std::nullopt;
Expand Down
Loading