ContentGfxCache

This commit is contained in:
MihailRis
2023-11-22 14:53:35 +03:00
parent bf4ad5ca58
commit d92347097e
14 changed files with 86 additions and 51 deletions
+3 -1
View File
@@ -14,6 +14,7 @@ class Chunk;
class Chunks;
class VoxelsVolume;
class ChunksStorage;
class ContentGfxCache;
class BlocksRenderer {
const Content* const content;
@@ -29,6 +30,7 @@ class BlocksRenderer {
VoxelsVolume* voxelsBuffer;
const Block* const* blockDefsCache;
const ContentGfxCache* const cache;
void vertex(const glm::vec3& coord, float u, float v, const glm::vec4& light);
void index(int a, int b, int c, int d, int e, int f);
@@ -68,7 +70,7 @@ class BlocksRenderer {
glm::vec4 pickSoftLight(int x, int y, int z, const glm::ivec3& right, const glm::ivec3& up) const;
void render(const voxel* voxels, int atlas_size);
public:
BlocksRenderer(size_t capacity, const Content* content);
BlocksRenderer(size_t capacity, const Content* content, const ContentGfxCache* cache);
virtual ~BlocksRenderer();
Mesh* render(const Chunk* chunk, int atlas_size, const ChunksStorage* chunks);