add stable name to comps
This commit is contained in:
parent
9ca6adee4f
commit
6f3f9ef191
@ -1,3 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
#include "./components.hpp"
|
#include "./components.hpp"
|
||||||
|
|
||||||
#include <entt/core/type_info.hpp>
|
#include <entt/core/type_info.hpp>
|
||||||
@ -6,8 +8,12 @@
|
|||||||
#define DEFINE_COMP_ID(x) \
|
#define DEFINE_COMP_ID(x) \
|
||||||
template<> \
|
template<> \
|
||||||
constexpr entt::id_type entt::type_hash<x>::value() noexcept { \
|
constexpr entt::id_type entt::type_hash<x>::value() noexcept { \
|
||||||
using namespace entt::literals; \
|
using namespace entt::literals; \
|
||||||
return #x##_hs; \
|
return #x##_hs; \
|
||||||
|
} \
|
||||||
|
template<> \
|
||||||
|
constexpr std::string_view entt::type_name<x>::value() noexcept { \
|
||||||
|
return #x; \
|
||||||
}
|
}
|
||||||
|
|
||||||
// cross compiler stable ids
|
// cross compiler stable ids
|
||||||
|
Loading…
Reference in New Issue
Block a user