mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 15:01:49 +00:00
reformat BlocksRenderer
This commit is contained in:
parent
99fe787cba
commit
7e51f47044
1 changed files with 21 additions and 20 deletions
|
|
@ -22,6 +22,27 @@ class ContentGfxCache;
|
||||||
struct UVRegion;
|
struct UVRegion;
|
||||||
|
|
||||||
class BlocksRenderer {
|
class BlocksRenderer {
|
||||||
|
public:
|
||||||
|
BlocksRenderer(
|
||||||
|
size_t capacity,
|
||||||
|
const Content& content,
|
||||||
|
const ContentGfxCache& cache,
|
||||||
|
const EngineSettings& settings
|
||||||
|
);
|
||||||
|
virtual ~BlocksRenderer();
|
||||||
|
|
||||||
|
void build(const Chunk* chunk, const VoxelsVolume& volume);
|
||||||
|
ChunkMesh render(
|
||||||
|
const Chunk* chunk, const VoxelsVolume& volume
|
||||||
|
);
|
||||||
|
ChunkMeshData createMesh();
|
||||||
|
|
||||||
|
size_t getMemoryConsumption() const;
|
||||||
|
|
||||||
|
bool isCancelled() const {
|
||||||
|
return cancelled;
|
||||||
|
}
|
||||||
|
private:
|
||||||
static const glm::vec3 SUN_VECTOR;
|
static const glm::vec3 SUN_VECTOR;
|
||||||
const Content& content;
|
const Content& content;
|
||||||
std::unique_ptr<ChunkVertex[]> vertexBuffer;
|
std::unique_ptr<ChunkVertex[]> vertexBuffer;
|
||||||
|
|
@ -160,24 +181,4 @@ class BlocksRenderer {
|
||||||
|
|
||||||
void render(const voxel* voxels, const int beginEnds[256][2]);
|
void render(const voxel* voxels, const int beginEnds[256][2]);
|
||||||
SortingMeshData renderTranslucent(const voxel* voxels, int beginEnds[256][2]);
|
SortingMeshData renderTranslucent(const voxel* voxels, int beginEnds[256][2]);
|
||||||
public:
|
|
||||||
BlocksRenderer(
|
|
||||||
size_t capacity,
|
|
||||||
const Content& content,
|
|
||||||
const ContentGfxCache& cache,
|
|
||||||
const EngineSettings& settings
|
|
||||||
);
|
|
||||||
virtual ~BlocksRenderer();
|
|
||||||
|
|
||||||
void build(const Chunk* chunk, const VoxelsVolume& volume);
|
|
||||||
ChunkMesh render(
|
|
||||||
const Chunk* chunk, const VoxelsVolume& volume
|
|
||||||
);
|
|
||||||
ChunkMeshData createMesh();
|
|
||||||
|
|
||||||
size_t getMemoryConsumption() const;
|
|
||||||
|
|
||||||
bool isCancelled() const {
|
|
||||||
return cancelled;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue