Skip to content

Commit 6e68375

Browse files
committed
update to entt v3.10.0
1 parent 08955df commit 6e68375

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ editor.registerComponent<Velocity>("Velocity");
5151
```
5252
5353
# Dependencies
54-
The editor uses EnTTv3.9.0 and ImGui. (tested with ImGui 1.68, 1.72b, 1.75, 1.78, 1.82, 1.85)
54+
The editor uses EnTTv3.10.0 and ImGui. (tested with ImGui 1.68, 1.72b, 1.75, 1.78, 1.82, 1.85, 1.87)
5555
To use it with EnTTv3.0.0, use the dedicated branch.
5656
For specific EnTT version check the tags, if a new EnTT version does not require a update, I won't make a new Release.
57-
Releases available for EnTT 3.1.0, 3.1.1, 3.2.0, 3.2.1, 3.2.2, 3.3.x, 3.4.0, 3.6.0-3.8.1, 3.9.0.
57+
Releases available for EnTT 3.1.0, 3.1.1, 3.2.0, 3.2.1, 3.2.2, 3.3.x, 3.4.0, 3.6.0-3.8.1, 3.9.0, 3.10.0.
5858

imgui_entt_entity_editor.hpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ class EntityEditor {
8585

8686
bool entityHasComponent(Registry& registry, EntityType& entity, ComponentTypeID type_id)
8787
{
88-
ComponentTypeID type[] = { type_id };
89-
return registry.runtime_view(std::cbegin(type), std::cend(type)).contains(entity);
88+
const auto storage_it = registry.storage(type_id);
89+
return storage_it != registry.storage().end() && storage_it->second.contains(entity);
9090
}
9191

9292
public:
@@ -243,7 +243,16 @@ class EntityEditor {
243243
}
244244
});
245245
} else {
246-
auto view = registry.runtime_view(comp_list.begin(), comp_list.end());
246+
entt::basic_runtime_view<entt::basic_sparse_set<EntityType>> view{};
247+
for (const auto type : comp_list) {
248+
auto storage_it = registry.storage(type);
249+
if (storage_it != registry.storage().end()) {
250+
view.iterate(registry.storage(type)->second);
251+
}
252+
}
253+
254+
// TODO: add support for exclude
255+
247256
ImGui::Text("%lu Entities Matching:", view.size_hint());
248257

249258
if (ImGui::BeginChild("entity list")) {
@@ -297,7 +306,7 @@ class EntityEditor {
297306

298307
// MIT License
299308

300-
// Copyright (c) 2019-2021 Erik Scholz
309+
// Copyright (c) 2019-2022 Erik Scholz
301310
// Copyright (c) 2020 Gnik Droy
302311

303312
// Permission is hereby granted, free of charge, to any person obtaining a copy

0 commit comments

Comments
 (0)