King_DuckZ
fd8a1cbabc
This is needed to recognize what type of tiles a layer contains. Client code has to fill in a map of hash => add_layer<T>() pointers. As a layer is loaded, the correct add_layer<T>() is called based on the hash saved with the layer itself.
15 lines
492 B
C++
15 lines
492 B
C++
namespace dk {
|
|
template <typename T, uint32_t D>
|
|
HashType make_signature_hash() {
|
|
#if defined(__GNUC__)
|
|
//TODO: use bt::string if possible
|
|
const char* const pf = __PRETTY_FUNCTION__;
|
|
const std::size_t len = sizeof(__PRETTY_FUNCTION__) - 1;
|
|
//constexpr bt::string<sizeof(__PRETTY_FUNCTION__)-1> func_pretty(pf);
|
|
#else
|
|
# error "Unknown compiler"
|
|
#endif
|
|
//return implem::hash_string(func_pretty.data(), func_pretty.size());
|
|
return implem::hash_string(pf, len);
|
|
}
|
|
} //namespace dk
|