entt update to v3.11.1

This commit is contained in:
2022-11-11 16:22:58 +01:00
committed by Erik Scholz
parent 8036fdf2a9
commit 8d24976a13
14 changed files with 26 additions and 35 deletions

View File

@ -85,8 +85,8 @@ private:
bool entityHasComponent(Registry& registry, EntityType& entity, ComponentTypeID type_id)
{
const auto storage_it = registry.storage(type_id);
return storage_it != registry.storage().end() && storage_it->second.contains(entity);
const auto* storage_ptr = registry.storage(type_id);
return storage_ptr != nullptr && storage_ptr->contains(entity);
}
public:
@ -243,11 +243,11 @@ public:
}
});
} else {
entt::basic_runtime_view<entt::basic_sparse_set<EntityType>> view{};
entt::runtime_view 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);
auto* storage_ptr = registry.storage(type);
if (storage_ptr != nullptr) {
view.iterate(*storage_ptr);
}
}

View File

@ -20,7 +20,7 @@ void Camera3D(MM::Scene& scene) {
ImGui::TextUnformatted("NO CAMERA!");
return;
}
auto& camera = scene.ctx().at<MM::OpenGL::Camera3D>();
auto& camera = scene.ctx().get<MM::OpenGL::Camera3D>();
static bool follow_entity = false;
static MM::Entity tracking = entt::null;

View File

@ -157,7 +157,7 @@ namespace MM::Services {
if (_show_time_delta_ctx) {
if (ImGui::Begin("Scene TimeDelta Context", &_show_time_delta_ctx)) {
if (scene.ctx().contains<MM::Components::TimeDelta>()) {
auto& td = scene.ctx().at<MM::Components::TimeDelta>();
auto& td = scene.ctx().get<MM::Components::TimeDelta>();
ImGui::Value("tickDelta", td.tickDelta);
ImGui::SliderFloat("deltaFactor", &td.deltaFactor, 0.f, 10.f, "%.5f", ImGuiSliderFlags_Logarithmic);
} else {