mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-04-21 02:12:59 +02:00
update imgui entt editor
This commit is contained in:
parent
7cf434d877
commit
f62ed43209
@ -4,6 +4,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include <entt/entt.hpp>
|
#include <entt/entt.hpp>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
@ -69,7 +70,6 @@ template <class EntityType>
|
|||||||
class EntityEditor {
|
class EntityEditor {
|
||||||
public:
|
public:
|
||||||
using Registry = entt::basic_registry<EntityType>;
|
using Registry = entt::basic_registry<EntityType>;
|
||||||
//using ComponentTypeID = ENTT_ID_TYPE;
|
|
||||||
using ComponentTypeID = entt::id_type;
|
using ComponentTypeID = entt::id_type;
|
||||||
|
|
||||||
struct ComponentInfo {
|
struct ComponentInfo {
|
||||||
@ -93,9 +93,8 @@ public:
|
|||||||
template <class Component>
|
template <class Component>
|
||||||
ComponentInfo& registerComponent(const ComponentInfo& component_info)
|
ComponentInfo& registerComponent(const ComponentInfo& component_info)
|
||||||
{
|
{
|
||||||
//auto index = entt::type_info<Component>::id();
|
|
||||||
auto index = entt::type_hash<Component>::value();
|
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);
|
MM_IEEE_ASSERT(insert_result);
|
||||||
return std::get<ComponentInfo>(*it);
|
return std::get<ComponentInfo>(*it);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user