About to relearn this version of the language.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "AssetManager.hpp"
|
||||
#include "loaders/TextureLoader.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
|
||||
@@ -83,7 +83,16 @@ namespace Dawn {
|
||||
* @return The asset loader for the given asset.
|
||||
*/
|
||||
template<class T>
|
||||
std::shared_ptr<T> get(const std::string filename);
|
||||
std::shared_ptr<T> get(const std::string filename) {
|
||||
auto existing = this->getExisting<T>(filename);
|
||||
if(existing) return existing;
|
||||
|
||||
std::shared_ptr<T> loader = std::make_shared<T>(filename);
|
||||
pendingAssetLoaders.push_back(
|
||||
std::static_pointer_cast<AssetLoader>(loader)
|
||||
);
|
||||
return loader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the asset loader for the given asset.
|
||||
|
||||
@@ -12,4 +12,4 @@ target_sources(${DAWN_TARGET_NAME}
|
||||
)
|
||||
|
||||
# Subdirs
|
||||
add_subdirectory(loaders)
|
||||
add_subdirectory(loader)
|
||||
Reference in New Issue
Block a user