Optimization interne de chunk!

This commit is contained in:
Marc-Eric Martel
2021-10-31 00:31:08 -04:00
parent c3c432c369
commit 1639b38c2c
9 changed files with 129 additions and 71 deletions

View File

@@ -3,6 +3,7 @@
#include "define.h"
#include "array3d.h"
#include "vertexbuffer.h"
#include "blockinfo.h"
class Chunk {
private:
@@ -10,7 +11,7 @@ class Chunk {
VertexBuffer m_vertexBuffer;
bool m_isDirty = true;
void AddBlockToMesh(VertexBuffer::VertexData* vd, int& count, BlockType bt, int x, int y, int z);
void AddBlockToMesh(VertexBuffer::VertexData* vd, int& count, BlockType bt, int x, int y, int z, float u, float v, float s);
public:
Chunk();
@@ -20,7 +21,7 @@ class Chunk {
void SetBlock(int x, int y, int z, BlockType type);
BlockType GetBlock(int x, int y, int z);
void Update();
void Update(BlockInfo* blockinfo[BTYPE_LAST]);
void Render() const;
bool IsDirty() const;