diff --git a/src/assets/Assets.hpp b/src/assets/Assets.hpp index f94adbd9..fa497fcb 100644 --- a/src/assets/Assets.hpp +++ b/src/assets/Assets.hpp @@ -17,19 +17,19 @@ class Assets; namespace assetload { /// @brief final work to do in the main thread using postfunc = std::function; + + using setupfunc = std::function; + + template + void assets_setup(const Assets*); } -template -void assets_setup(const Assets*); - -using assetssetupfunc = std::function; - class Assets { std::vector animations; using assets_map = std::unordered_map>; std::unordered_map assets; - std::vector setupFuncs; + std::vector setupFuncs; public: Assets() {} Assets(const Assets&) = delete; @@ -72,13 +72,13 @@ public: } } - void addSetupFunc(assetssetupfunc setupfunc) { + void addSetupFunc(assetload::setupfunc setupfunc) { setupFuncs.push_back(setupfunc); } }; template -void assets_setup(const Assets* assets) { +void assetload::assets_setup(const Assets* assets) { if (auto mapPtr = assets->getMap()) { for (const auto& entry : **mapPtr) { static_cast(entry.second.get())->setup(assets); diff --git a/src/engine.cpp b/src/engine.cpp index 9e5c7235..8033c798 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -245,7 +245,7 @@ void Engine::loadAssets() { Shader::preprocessor->setPaths(resPaths.get()); auto new_assets = std::make_unique(); - new_assets->addSetupFunc(assets_setup); + new_assets->addSetupFunc(assetload::assets_setup); AssetsLoader loader(new_assets.get(), resPaths.get()); AssetsLoader::addDefaults(loader, content.get());