diff --git a/src/assets/AssetsLoader.cpp b/src/assets/AssetsLoader.cpp index e8ec09963..8ffacf6a8 100644 --- a/src/assets/AssetsLoader.cpp +++ b/src/assets/AssetsLoader.cpp @@ -50,18 +50,18 @@ void AssetsLoader::createDefaults(AssetsLoader& loader) { loader.addLoader(ASSET_ATLAS, assetload::atlas); } -void AssetsLoader::addDefaults(AssetsLoader& loader) { - loader.add(ASSET_SHADER, SHADERS_FOLDER"/main", "main"); - loader.add(ASSET_SHADER, SHADERS_FOLDER"/lines", "lines"); - loader.add(ASSET_SHADER, SHADERS_FOLDER"/ui", "ui"); - loader.add(ASSET_SHADER, SHADERS_FOLDER"/ui3d", "ui3d"); - loader.add(ASSET_SHADER, SHADERS_FOLDER"/background", "background"); - loader.add(ASSET_SHADER, SHADERS_FOLDER"/skybox_gen", "skybox_gen"); - - loader.add(ASSET_ATLAS, TEXTURES_FOLDER"/blocks", "blocks"); - loader.add(ASSET_TEXTURE, TEXTURES_FOLDER"/menubg.png", "menubg"); - - loader.add(ASSET_FONT, FONTS_FOLDER"/font", "normal"); +void AssetsLoader::addDefaults(AssetsLoader& loader, bool allAssets) { + if (allAssets) { + loader.add(ASSET_SHADER, SHADERS_FOLDER"/main", "main"); + loader.add(ASSET_SHADER, SHADERS_FOLDER"/lines", "lines"); + loader.add(ASSET_SHADER, SHADERS_FOLDER"/ui", "ui"); + loader.add(ASSET_SHADER, SHADERS_FOLDER"/ui3d", "ui3d"); + loader.add(ASSET_SHADER, SHADERS_FOLDER"/background", "background"); + loader.add(ASSET_SHADER, SHADERS_FOLDER"/skybox_gen", "skybox_gen"); + loader.add(ASSET_TEXTURE, TEXTURES_FOLDER"/menubg.png", "menubg"); + loader.add(ASSET_FONT, FONTS_FOLDER"/font", "normal"); + } + loader.add(ASSET_ATLAS, TEXTURES_FOLDER"/blocks", "blocks"); } const ResPaths* AssetsLoader::getPaths() const { diff --git a/src/assets/AssetsLoader.h b/src/assets/AssetsLoader.h index 9a731780e..13ea12faa 100644 --- a/src/assets/AssetsLoader.h +++ b/src/assets/AssetsLoader.h @@ -36,7 +36,7 @@ class AssetsLoader { bool loadNext(); static void createDefaults(AssetsLoader& loader); - static void addDefaults(AssetsLoader& loader); + static void addDefaults(AssetsLoader& loader, bool allAssets); const ResPaths* getPaths() const; }; diff --git a/src/engine.cpp b/src/engine.cpp index 8a4eecce8..2da0610bd 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -59,7 +59,7 @@ Engine::Engine(EngineSettings& settings, EnginePaths* paths) assets.reset(new Assets()); AssetsLoader loader(assets.get(), resPaths.get()); AssetsLoader::createDefaults(loader); - AssetsLoader::addDefaults(loader); + AssetsLoader::addDefaults(loader, true); Shader::preprocessor->setPaths(resPaths.get()); while (loader.hasNext()) { @@ -189,7 +189,7 @@ void Engine::loadContent() { std::cout << "-- loading assets" << std::endl; AssetsLoader loader(new_assets.get(), resPaths.get()); AssetsLoader::createDefaults(loader); - AssetsLoader::addDefaults(loader); + AssetsLoader::addDefaults(loader, false); while (loader.hasNext()) { if (!loader.loadNext()) { new_assets.reset();