[nostalgia/core] Make AssetManager type name verification a static_assert
This commit is contained in:
parent
596c0718e1
commit
eef1bfcbd6
@ -170,13 +170,8 @@ class AssetManager {
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
AssetTypeManager<T> *getTypeManager() noexcept {
|
AssetTypeManager<T> *getTypeManager() noexcept {
|
||||||
#if __cplusplus >= 202002L
|
constexpr auto typeName = ox::ModelTypeName_v<T>;
|
||||||
constexpr auto typeName = ox::getModelTypeName<T>();
|
|
||||||
static_assert(ox_strcmp(typeName, "") != 0, "Types must have TypeName to use AssetManager");
|
static_assert(ox_strcmp(typeName, "") != 0, "Types must have TypeName to use AssetManager");
|
||||||
#else
|
|
||||||
const auto typeName = ox::getModelTypeName<T>();
|
|
||||||
oxAssert(ox_strcmp(typeName, "") != 0, "Types must have TypeName to use AssetManager");
|
|
||||||
#endif
|
|
||||||
auto &am = m_assetTypeManagers[typeName];
|
auto &am = m_assetTypeManagers[typeName];
|
||||||
if (!am) {
|
if (!am) {
|
||||||
am = ox::make_unique<AssetTypeManager<T>>();
|
am = ox::make_unique<AssetTypeManager<T>>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user