Merge pull request #330 from MihailRis/item-models

Add item models
This commit is contained in:
MihailRis
2024-11-01 12:34:05 +03:00
committed by GitHub
66 changed files with 541 additions and 557 deletions
+12
View File
@@ -20,6 +20,7 @@
#include "frontend/menu.hpp"
#include "frontend/screens/Screen.hpp"
#include "frontend/screens/MenuScreen.hpp"
#include "graphics/render/ModelsGenerator.hpp"
#include "graphics/core/Batch2D.hpp"
#include "graphics/core/DrawContext.hpp"
#include "graphics/core/ImageData.hpp"
@@ -280,6 +281,17 @@ void Engine::loadAssets() {
}
}
assets = std::move(new_assets);
if (content) {
for (auto& [name, def] : content->items.getDefs()) {
assets->store(
std::make_unique<model::Model>(
ModelsGenerator::generate(*def, *content, *assets)
),
name + ".model"
);
}
}
}
static void load_configs(const fs::path& root) {