update imgui entt editor

This commit is contained in:
Green Sky 2020-12-05 15:44:33 +01:00
parent 7cf434d877
commit f62ed43209

View File

@ -4,6 +4,7 @@
#include <map>
#include <set>
#include <functional>
#include <string>
#include <entt/entt.hpp>
#include <imgui.h>
@ -69,7 +70,6 @@ template <class EntityType>
class EntityEditor {
public:
using Registry = entt::basic_registry<EntityType>;
//using ComponentTypeID = ENTT_ID_TYPE;
using ComponentTypeID = entt::id_type;
struct ComponentInfo {
@ -93,9 +93,8 @@ public:
template <class Component>
ComponentInfo& registerComponent(const ComponentInfo& component_info)
{
//auto index = entt::type_info<Component>::id();
auto index = entt::type_hash<Component>::value();
[[maybe_unused]] auto [it, insert_result] = component_infos.insert_or_assign(index, component_info);
auto [it, insert_result] = component_infos.insert_or_assign(index, component_info);
MM_IEEE_ASSERT(insert_result);
return std::get<ComponentInfo>(*it);
}