From 8bcbd2729388edc63c82d77d314b583af1447c49 Mon Sep 17 00:00:00 2001 From: untodesu Date: Sun, 14 Sep 2025 19:16:44 +0500 Subject: Cleanup math with qfengine ports again --- game/server/world/overworld.cc | 4 ++-- game/server/world/universe.cc | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'game/server/world') diff --git a/game/server/world/overworld.cc b/game/server/world/overworld.cc index 43059d8..b72a816 100644 --- a/game/server/world/overworld.cc +++ b/game/server/world/overworld.cc @@ -15,7 +15,7 @@ static void compute_tree_feature(unsigned int height, world::Feature& feature, c const world::Voxel* leaves_voxel) { // Ensure the tree height is too small - height = math::max(height, 4U); + height = glm::max(height, 4U); // Put down a single piece of dirt feature.push_back({ voxel_pos(0, -1, 0), game_voxels::dirt, true }); @@ -217,7 +217,7 @@ const world::Overworld_Metadata& world::Overworld::get_or_create_metadata(const } auto nvdi_value = 0.5f + 0.5f * fnlGetNoise2D(&m_fnl_nvdi, cpos.x, cpos.y); - auto tree_density = (nvdi_value >= 0.33f) ? math::floor(nvdi_value * 4.0f) : 0U; + auto tree_density = (nvdi_value >= 0.33f) ? static_cast(glm::floor(nvdi_value * 4.0f)) : 0U; for(unsigned int i = 0U; i < tree_density; ++i) { auto lpos = local_pos((twister() % CHUNK_SIZE), (twister() % OW_NUM_TREES), (twister() % CHUNK_SIZE)); diff --git a/game/server/world/universe.cc b/game/server/world/universe.cc index 2dd6053..b27a8de 100644 --- a/game/server/world/universe.cc +++ b/game/server/world/universe.cc @@ -7,6 +7,7 @@ #include "core/io/buffer.hh" #include "core/io/config_map.hh" +#include "core/io/physfs.hh" #include "core/utils/epoch.hh" @@ -51,7 +52,7 @@ static void add_new_dimension(world::Dimension* dimension) auto dimension_dir = std::format("{}/{}", universe_name.get(), dimension->get_name()); if(!PHYSFS_mkdir(dimension_dir.c_str())) { - spdlog::critical("universe: {}: {}", dimension_dir, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("universe: {}: {}", dimension_dir, io::physfs_error()); std::terminate(); } @@ -60,7 +61,7 @@ static void add_new_dimension(world::Dimension* dimension) metadata->zvox_dir = std::format("{}/chunk", dimension_dir); if(!PHYSFS_mkdir(metadata->zvox_dir.c_str())) { - spdlog::critical("universe: {}: {}", metadata->zvox_dir, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("universe: {}: {}", metadata->zvox_dir, io::physfs_error()); std::terminate(); } @@ -109,7 +110,7 @@ void world::universe::init_late(void) const auto universe_dir = std::string(universe_name.get()); if(!PHYSFS_mkdir(universe_dir.c_str())) { - spdlog::critical("universe: {}: {}", universe_dir, PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); + spdlog::critical("universe: {}: {}", universe_dir, io::physfs_error()); std::terminate(); } -- cgit