Skip to content

Commit cb4bb93

Browse files
authored
use ecsact C++ core api for tests (#39)
1 parent 6fecd48 commit cb4bb93

File tree

3 files changed

+93
-167
lines changed

3 files changed

+93
-167
lines changed

WORKSPACE.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ http_archive(
2525

2626
http_archive(
2727
name = "ecsact_runtime",
28-
sha256 = "", # https://github.com/ecsact-dev/ecsact_runtime/pull/139
29-
strip_prefix = "ecsact_runtime-9d243cca4550fe3fa92aa3526466e7933d5d77ae",
30-
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/9d243cca4550fe3fa92aa3526466e7933d5d77ae.zip",
28+
sha256 = "", # https://github.com/ecsact-dev/ecsact_runtime/pull/140
29+
strip_prefix = "ecsact_runtime-e9689a232254c56107ff022c546ee03f53e1f04a",
30+
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/e9689a232254c56107ff022c546ee03f53e1f04a.zip",
3131
)
3232

3333
load("@rules_ecsact//ecsact:repositories.bzl", "ecsact_register_toolchains", "rules_ecsact_dependencies")

ecsact/entt/runtime.hh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,6 @@ private:
12111211
});
12121212
auto entt_id = info.get_entt_entity_id(entity);
12131213
info.registry.template emplace<destroyed_entity>(entt_id);
1214-
info.destroy_entity(entity);
12151214
}
12161215
}
12171216

@@ -1274,6 +1273,18 @@ private:
12741273
return result;
12751274
}
12761275

1276+
auto _destroy_entities(registry_info& info) {
1277+
using ecsact::entt::detail::destroyed_entity;
1278+
1279+
::entt::basic_view destroy_view{
1280+
info.registry.template storage<destroyed_entity>(),
1281+
};
1282+
1283+
for(entt_entity_type entity : destroy_view) {
1284+
info.destroy_entity(info.get_ecsact_entity_id(entity));
1285+
}
1286+
}
1287+
12771288
public:
12781289
#ifdef ECSACT_ENTT_RUNTIME_DYNAMIC_SYSTEM_IMPLS
12791290
bool set_system_execution_impl(
@@ -1335,6 +1346,7 @@ public:
13351346
_trigger_remove_component_events(info, *events_collector);
13361347
_trigger_destroy_entity_event(info, *events_collector);
13371348
}
1349+
_destroy_entities(info);
13381350
_clear_event_markers(info);
13391351

13401352
info.mutex = std::nullopt;

0 commit comments

Comments
 (0)