add 'graphics.dense-render' setting

This commit is contained in:
MihailRis
2024-12-21 08:13:05 +03:00
parent 954724c837
commit dc8f5e7873
12 changed files with 111 additions and 47 deletions
+16 -2
View File
@@ -10,19 +10,29 @@
class Content;
class Assets;
class Atlas;
struct Block;
struct UVRegion;
struct GraphicsSettings;
namespace model {
struct Model;
}
class ContentGfxCache {
const Content* content;
const Content& content;
const Assets& assets;
const GraphicsSettings& settings;
// 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, const Assets& assets);
ContentGfxCache(
const Content& content,
const Assets& assets,
const GraphicsSettings& settings
);
~ContentGfxCache();
inline const UVRegion& getRegion(blockid_t id, int side) const {
@@ -32,4 +42,8 @@ public:
const model::Model& getModel(blockid_t id) const;
const Content* getContent() const;
void refresh(const Block& block, const Atlas& atlas);
void refresh();
};