feat: new block custom models implementation (WIP)

This commit is contained in:
MihailRis
2024-11-05 19:28:40 +03:00
parent c95c97430a
commit 5e0bcf8ec0
14 changed files with 189 additions and 149 deletions
+9
View File
@@ -3,15 +3,22 @@
#include "typedefs.hpp"
#include <memory>
#include <stdexcept>
#include <unordered_map>
class Content;
class Assets;
struct UVRegion;
namespace model {
struct Model;
}
class ContentGfxCache {
const Content* content;
// array of block sides uv regions (6 per block)
std::unique_ptr<UVRegion[]> sideregions;
std::unordered_map<blockid_t, model::Model> models;
public:
ContentGfxCache(const Content* content, Assets* assets);
~ContentGfxCache();
@@ -19,6 +26,8 @@ public:
inline const UVRegion& getRegion(blockid_t id, int side) const {
return sideregions[id * 6 + side];
}
const model::Model& getModel(blockid_t id) const;
const Content* getContent() const;
};