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
commit f7ac76064b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 541 additions and 557 deletions

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) {