update to entt master (v3.6.0-pre)

This commit is contained in:
2020-11-25 21:41:36 +01:00
parent 840b663d5e
commit 7cf434d877
8 changed files with 13 additions and 6 deletions

View File

@ -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) {

View File

@ -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);