summaryrefslogtreecommitdiffstats
path: root/game/server/world/overworld.cc
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-09-12 13:33:52 +0500
committeruntodesu <kirill@untode.su>2025-09-12 13:33:52 +0500
commite9076f22fe2a49d1cd8933e54b7b00c5dd943269 (patch)
tree89b8a4ca1861196e067dcba218fad1d7f889b860 /game/server/world/overworld.cc
parent68694a9c9d7d27d3b79c7b96bb67f56db2f75c45 (diff)
downloadvoxelius-e9076f22fe2a49d1cd8933e54b7b00c5dd943269.tar.bz2
voxelius-e9076f22fe2a49d1cd8933e54b7b00c5dd943269.zip
It compiles
Diffstat (limited to 'game/server/world/overworld.cc')
-rw-r--r--game/server/world/overworld.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/game/server/world/overworld.cc b/game/server/world/overworld.cc
index eb801de..43059d8 100644
--- a/game/server/world/overworld.cc
+++ b/game/server/world/overworld.cc
@@ -4,13 +4,15 @@
#include "core/math/vectors.hh"
+#include "shared/world/voxel.hh"
#include "shared/world/voxel_storage.hh"
#include "shared/coord.hh"
#include "shared/game_voxels.hh"
// FIXME: load these from a file
-static void compute_tree_feature(unsigned int height, world::Feature& feature, voxel_id log_voxel, voxel_id leaves_voxel)
+static void compute_tree_feature(unsigned int height, world::Feature& feature, const world::Voxel* log_voxel,
+ const world::Voxel* leaves_voxel)
{
// Ensure the tree height is too small
height = math::max<unsigned int>(height, 4U);
@@ -251,12 +253,12 @@ void world::Overworld::generate_terrain(const chunk_pos& cpos, VoxelStorage& vox
}
if(vpos.y < -variation) {
- voxels[i] = game_voxels::stone;
+ voxels[i] = game_voxels::stone->get_id();
continue;
}
if(is_inside_terrain(vpos)) {
- voxels[i] = game_voxels::stone;
+ voxels[i] = game_voxels::stone->get_id();
continue;
}
}
@@ -308,10 +310,10 @@ void world::Overworld::generate_surface(const chunk_pos& cpos, VoxelStorage& vox
if(depth < 5U) {
if(depth == 0U) {
- voxels[i] = game_voxels::grass;
+ voxels[i] = game_voxels::grass->get_id();
}
else {
- voxels[i] = game_voxels::dirt;
+ voxels[i] = game_voxels::dirt->get_id();
}
}
}