mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-06-19 19:26:36 +02:00
update to entt master (v3.6.0-pre)
This commit is contained in:
@ -4,7 +4,6 @@
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
#include <entt/entt.hpp>
|
||||
#include <imgui.h>
|
||||
@ -70,7 +69,8 @@ template <class EntityType>
|
||||
class EntityEditor {
|
||||
public:
|
||||
using Registry = entt::basic_registry<EntityType>;
|
||||
using ComponentTypeID = ENTT_ID_TYPE;
|
||||
//using ComponentTypeID = ENTT_ID_TYPE;
|
||||
using ComponentTypeID = entt::id_type;
|
||||
|
||||
struct ComponentInfo {
|
||||
using Callback = std::function<void(Registry&, EntityType)>;
|
||||
@ -93,7 +93,8 @@ public:
|
||||
template <class Component>
|
||||
ComponentInfo& registerComponent(const ComponentInfo& component_info)
|
||||
{
|
||||
auto index = entt::type_info<Component>::id();
|
||||
//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);
|
||||
MM_IEEE_ASSERT(insert_result);
|
||||
return std::get<ComponentInfo>(*it);
|
||||
@ -234,7 +235,7 @@ public:
|
||||
});
|
||||
} else {
|
||||
auto view = registry.runtime_view(comp_list.begin(), comp_list.end());
|
||||
ImGui::Text("%lu Entities Matching:", view.size());
|
||||
ImGui::Text("%lu Entities Matching:", view.size_hint());
|
||||
|
||||
if (ImGui::BeginChild("entity list")) {
|
||||
for (auto e : view) {
|
||||
|
@ -30,6 +30,7 @@ void TextureResourceManagerList(void) {
|
||||
}
|
||||
|
||||
void TextureResourceManagerLoader(MM::Engine& engine) {
|
||||
using namespace entt::literals;
|
||||
auto& rm = MM::ResourceManager<MM::OpenGL::Texture>::ref();
|
||||
static MM::OpenGL::Texture::handle texture = rm.get("default"_hs);
|
||||
|
||||
|
Reference in New Issue
Block a user