update assets errors handling & add 'atlases' to preload

This commit is contained in:
MihailRis
2024-07-23 19:27:46 +03:00
parent ed60bdc333
commit f9df873382
7 changed files with 112 additions and 51 deletions
+6 -4
View File
@@ -256,11 +256,13 @@ void Engine::loadAssets() {
auto task = loader.startTask([=](){});
task->waitForEnd();
} else {
while (loader.hasNext()) {
if (!loader.loadNext()) {
new_assets.reset();
throw std::runtime_error("could not to load assets");
try {
while (loader.hasNext()) {
loader.loadNext();
}
} catch (const assetload::error& err) {
new_assets.reset();
throw;
}
}
assets = std::move(new_assets);