From 68694a9c9d7d27d3b79c7b96bb67f56db2f75c45 Mon Sep 17 00:00:00 2001 From: untodesu Date: Thu, 11 Sep 2025 18:18:08 +0500 Subject: Metadata voxels! --- game/shared/world/dimension.hh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'game/shared/world/dimension.hh') diff --git a/game/shared/world/dimension.hh b/game/shared/world/dimension.hh index bf9bfe1..58e0765 100644 --- a/game/shared/world/dimension.hh +++ b/game/shared/world/dimension.hh @@ -11,6 +11,7 @@ class ConfigMap; namespace world { class Chunk; +class Voxel; class VoxelStorage; } // namespace world @@ -40,11 +41,11 @@ public: void remove_chunk(Chunk* chunk); public: - voxel_id get_voxel(const voxel_pos& vpos) const; - voxel_id get_voxel(const chunk_pos& cpos, const local_pos& lpos) const; + const Voxel* get_voxel(const voxel_pos& vpos) const; + const Voxel* get_voxel(const chunk_pos& cpos, const local_pos& lpos) const; - bool set_voxel(voxel_id voxel, const voxel_pos& vpos); - bool set_voxel(voxel_id voxel, const chunk_pos& cpos, const local_pos& lpos); + bool set_voxel(const Voxel* voxel, const voxel_pos& vpos); + bool set_voxel(const Voxel* voxel, const chunk_pos& cpos, const local_pos& lpos); public: virtual void init(io::ConfigMap& config); @@ -92,9 +93,9 @@ struct ChunkUpdateEvent final { struct VoxelSetEvent final { Dimension* dimension; + const Voxel* voxel; chunk_pos cpos; local_pos lpos; - voxel_id voxel; Chunk* chunk; }; } // namespace world -- cgit