Skip to content

Commit

Permalink
update to entt v3.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Apr 15, 2022
1 parent 08955df commit 6e68375
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ editor.registerComponent<Velocity>("Velocity");
```
# Dependencies
The editor uses EnTTv3.9.0 and ImGui. (tested with ImGui 1.68, 1.72b, 1.75, 1.78, 1.82, 1.85)
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)
To use it with EnTTv3.0.0, use the dedicated branch.
For specific EnTT version check the tags, if a new EnTT version does not require a update, I won't make a new Release.
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.
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.
17 changes: 13 additions & 4 deletions imgui_entt_entity_editor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ class EntityEditor {

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

public:
Expand Down Expand Up @@ -243,7 +243,16 @@ class EntityEditor {
}
});
} else {
auto view = registry.runtime_view(comp_list.begin(), comp_list.end());
entt::basic_runtime_view<entt::basic_sparse_set<EntityType>> view{};
for (const auto type : comp_list) {
auto storage_it = registry.storage(type);
if (storage_it != registry.storage().end()) {
view.iterate(registry.storage(type)->second);
}
}

// TODO: add support for exclude

ImGui::Text("%lu Entities Matching:", view.size_hint());

if (ImGui::BeginChild("entity list")) {
Expand Down Expand Up @@ -297,7 +306,7 @@ class EntityEditor {

// MIT License

// Copyright (c) 2019-2021 Erik Scholz
// Copyright (c) 2019-2022 Erik Scholz
// Copyright (c) 2020 Gnik Droy

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

0 comments on commit 6e68375

Please sign in to comment.