Clean project
This commit is contained in:
parent
b7165d226a
commit
27ec847aea
@ -18,8 +18,6 @@ namespace deerith
|
||||
|
||||
void generate_cluster(voxel_cluster_t *cluster);
|
||||
void render_clusters(glm::ivec3 position, int rad, const camera_t &);
|
||||
void flush_cluster_to_gpu();
|
||||
void shutdown_environment();
|
||||
|
||||
extern std::mutex cluster_workers_mutex;
|
||||
extern std::vector<std::unique_ptr<cluster_generator_t>> cluster_workers;
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
namespace deerith
|
||||
{
|
||||
void add_graphics_function(const std::function<void()>);
|
||||
void execute_graphics_functions();
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
glm::ivec3 voxel_direction_order[6] = {
|
||||
inline constexpr glm::ivec3 voxel_direction_order[6] = {
|
||||
glm::ivec3(-1, 0, 0),
|
||||
glm::ivec3(1, 0, 0),
|
||||
glm::ivec3(0, -1, 0),
|
||||
@ -12,13 +12,14 @@ namespace deerith
|
||||
glm::ivec3(0, 0, 1),
|
||||
};
|
||||
|
||||
glm::vec2 voxel_uv_order[4] = {
|
||||
inline constexpr glm::vec2 voxel_uv_order[4] = {
|
||||
glm::vec2(0.0f, 0.0f),
|
||||
glm::vec2(1.0f, 0.0f),
|
||||
glm::vec2(0.0f, 1.0f),
|
||||
glm::vec2(1.0f, 1.0f),
|
||||
};
|
||||
glm::vec3 voxel_direction_vertices[6][4] = {
|
||||
|
||||
inline constexpr glm::vec3 voxel_direction_vertices[6][4] = {
|
||||
// -X
|
||||
{
|
||||
{0, 0, 1},
|
||||
@ -68,7 +69,7 @@ namespace deerith
|
||||
},
|
||||
};
|
||||
|
||||
uint32_t face_indices_order[6] = {
|
||||
inline constexpr uint32_t face_indices_order[6] = {
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
|
||||
@ -8,17 +8,17 @@ namespace deerith
|
||||
void init_primitives();
|
||||
void shutdown_primitives();
|
||||
|
||||
const glm::vec2 rectangle_vertices[4] = {
|
||||
inline constexpr glm::vec2 rectangle_vertices[4] = {
|
||||
glm::vec2(0, 0),
|
||||
glm::vec2(1, 0),
|
||||
glm::vec2(0, 1),
|
||||
glm::vec2(1, 1),
|
||||
};
|
||||
const unsigned int rectangle_indices[6] = {
|
||||
inline constexpr unsigned int rectangle_indices[6] = {
|
||||
0, 2, 1,
|
||||
1, 2, 3};
|
||||
|
||||
const glm::vec3 cube_vertices[8] = {
|
||||
inline constexpr glm::vec3 cube_vertices[8] = {
|
||||
// Front face (Z = 1)
|
||||
{0, 0, 1}, // 0: Bottom-left
|
||||
{1, 0, 1}, // 1: Bottom-right
|
||||
@ -32,7 +32,7 @@ namespace deerith
|
||||
{1, 1, 0}, // 7: Top-right
|
||||
};
|
||||
|
||||
const unsigned int cube_indices[36] = {
|
||||
inline constexpr unsigned int cube_indices[36] = {
|
||||
// Front (+Z)
|
||||
0,
|
||||
2,
|
||||
|
||||
@ -13,5 +13,5 @@ namespace deerith
|
||||
void generate_voxel_texture();
|
||||
void init_voxel_shader();
|
||||
|
||||
void shutdown_world_variables();
|
||||
void shutdown_environment();
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ namespace deerith
|
||||
bool connect_to_world(const char *address, int port);
|
||||
void shutdown_world();
|
||||
|
||||
bool is_world_running();
|
||||
void render_world();
|
||||
|
||||
void generate_cluster(voxel_cluster_t *_cluster);
|
||||
|
||||
@ -16,7 +16,7 @@ void deerith::init_engine()
|
||||
|
||||
void deerith::shutdown_engine()
|
||||
{
|
||||
shutdown_executing_servers();
|
||||
shutdown_executing_programs();
|
||||
shutdown_network();
|
||||
deerith_trace("shutdown engine");
|
||||
shutdown_log();
|
||||
@ -35,5 +35,4 @@ void deerith::shutdown_engine_render_specific()
|
||||
shutdown_primitives();
|
||||
shutdown_world();
|
||||
shutdown_network();
|
||||
shutdown_world_variables();
|
||||
}
|
||||
}
|
||||
|
||||
29
deerith_client/src/graphics/function_queue.cpp
Normal file
29
deerith_client/src/graphics/function_queue.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include <deerith/client/graphics/graphics_function_queue.h>
|
||||
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
std::vector<std::function<void()>> functions;
|
||||
std::mutex function_usage_mutex;
|
||||
}
|
||||
|
||||
void deerith::add_graphics_function(const std::function<void()> fun)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(function_usage_mutex);
|
||||
|
||||
functions.push_back(fun);
|
||||
}
|
||||
|
||||
void deerith::execute_graphics_functions()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(function_usage_mutex);
|
||||
|
||||
for (std::function<void()> &fun : functions)
|
||||
{
|
||||
fun();
|
||||
}
|
||||
|
||||
functions.clear();
|
||||
}
|
||||
@ -6,6 +6,8 @@
|
||||
#include <deerith/client/internals/world.h>
|
||||
#include <deerith/client/internals/engine.h>
|
||||
|
||||
#include <deerith/client/graphics/graphics_function_queue.h>
|
||||
|
||||
#include <glad/gl.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
@ -96,6 +98,8 @@ bool deerith::begin_window_display()
|
||||
return false;
|
||||
}
|
||||
|
||||
execute_graphics_functions();
|
||||
|
||||
int display_w, display_h;
|
||||
glfwGetFramebufferSize(window, &display_w, &display_h);
|
||||
|
||||
|
||||
@ -30,6 +30,6 @@ int main(int argc, const char **argv)
|
||||
deerith::shutdown_window();
|
||||
}
|
||||
|
||||
deerith::shutdown_executing_servers();
|
||||
deerith::shutdown_executing_programs();
|
||||
deerith::shutdown_engine();
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
#include <deerith/client/world.h>
|
||||
#include <deerith/world/environment.h>
|
||||
#include <deerith/client/internals/cluster_generation.h>
|
||||
#include <deerith/client/graphics/graphics_function_queue.h>
|
||||
#include <deerith/client/graphics/mesh.h>
|
||||
#include <deerith/client/cluster.h>
|
||||
|
||||
@ -11,15 +12,28 @@ namespace deerith
|
||||
{
|
||||
std::mutex cluster_workers_mutex;
|
||||
std::vector<std::unique_ptr<cluster_generator_t>> cluster_workers;
|
||||
|
||||
extern std::unordered_map<glm::ivec3, std::unique_ptr<mesh_3d_t>, ivec3_hash_t> loaded_clusters;
|
||||
}
|
||||
|
||||
void deerith::generate_cluster(voxel_cluster_t *cluster)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(cluster_workers_mutex);
|
||||
|
||||
cluster_workers.push_back(std::make_unique<cluster_generator_t>());
|
||||
cluster_generator_t *generator = cluster_workers.back().get();
|
||||
generator->generate_cluster(cluster);
|
||||
cluster_generator_t generator;
|
||||
generator.generate_cluster(cluster);
|
||||
|
||||
std::function<void()> upload_mesh_to_gpu_function = [generator]()
|
||||
{
|
||||
glm::ivec3 cluster_position;
|
||||
cluster_position.x = generator.cluster->surface_id.x;
|
||||
cluster_position.z = generator.cluster->surface_id.y;
|
||||
cluster_position.y = generator.cluster->layer;
|
||||
|
||||
loaded_clusters[cluster_position] = std::make_unique<mesh_3d_t>(generator.build_data);
|
||||
};
|
||||
|
||||
add_graphics_function(upload_mesh_to_gpu_function);
|
||||
}
|
||||
|
||||
void deerith::cluster_generator_t::generate_cluster(voxel_cluster_t *_cluster)
|
||||
|
||||
@ -16,28 +16,6 @@ namespace deerith
|
||||
void render_cluster(glm::ivec3);
|
||||
}
|
||||
|
||||
void deerith::shutdown_environment()
|
||||
{
|
||||
loaded_clusters.clear();
|
||||
}
|
||||
|
||||
void deerith::flush_cluster_to_gpu()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(cluster_workers_mutex);
|
||||
|
||||
for (std::unique_ptr<cluster_generator_t> &cluster_generator : cluster_workers)
|
||||
{
|
||||
glm::ivec3 cluster_position;
|
||||
cluster_position.x = cluster_generator->cluster->surface_id.x;
|
||||
cluster_position.z = cluster_generator->cluster->surface_id.y;
|
||||
cluster_position.y = cluster_generator->cluster->layer;
|
||||
|
||||
loaded_clusters[cluster_position] = std::make_unique<mesh_3d_t>(cluster_generator->build_data);
|
||||
}
|
||||
|
||||
cluster_workers.clear();
|
||||
}
|
||||
|
||||
void deerith::render_clusters(glm::ivec3 position, int rad, const camera_t &camera)
|
||||
{
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include <deerith/network/packets_voxel.h>
|
||||
#include <deerith/world/components.h>
|
||||
#include <deerith/world/environment.h>
|
||||
#include <deerith/client/graphics/graphics_function_queue.h>
|
||||
|
||||
#include <deerith/client/world.h>
|
||||
|
||||
@ -110,4 +111,11 @@ void deerith::process_packet(deerith::packet_voxel_texture_atlas_t &packet, clie
|
||||
{
|
||||
packet.texture_atlas->save_atlas("client_generated/voxel_texture_atlas.png");
|
||||
set_voxel_texture_atlas(std::move(packet.texture_atlas));
|
||||
|
||||
auto upload_texture_atlas_function = []
|
||||
{
|
||||
generate_voxel_texture();
|
||||
};
|
||||
|
||||
add_graphics_function(upload_texture_atlas_function);
|
||||
}
|
||||
@ -35,11 +35,6 @@ bool deerith::connect_to_world(const char *address, int port)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool deerith::is_world_running()
|
||||
{
|
||||
return world_running;
|
||||
}
|
||||
|
||||
void deerith::world_simulation()
|
||||
{
|
||||
while (world_running)
|
||||
|
||||
@ -20,7 +20,6 @@ namespace deerith
|
||||
void deerith::render_world()
|
||||
{
|
||||
process_player_input();
|
||||
flush_cluster_to_gpu();
|
||||
|
||||
get_lit_shader()->set_vec3("u_color", glm::vec3(0.8f, 0.8f, 0.8f));
|
||||
set_primitive_viewspace(glm::vec2(-10, -10), glm::vec2(10, 10));
|
||||
|
||||
@ -1,12 +1,23 @@
|
||||
#include <deerith/client/world.h>
|
||||
#include <deerith/client/internals/world.h>
|
||||
#include <deerith/client/world.h>
|
||||
#include <deerith/client/graphics/mesh.h>
|
||||
#include <deerith/world/environment.h>
|
||||
#include <memory>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
std::unique_ptr<shader_t> voxel_shader;
|
||||
std::unique_ptr<texture_t> voxel_texture;
|
||||
|
||||
extern std::unordered_map<glm::ivec3, std::unique_ptr<mesh_3d_t>, ivec3_hash_t> loaded_clusters;
|
||||
}
|
||||
|
||||
void deerith::shutdown_environment()
|
||||
{
|
||||
loaded_clusters.clear();
|
||||
voxel_shader.reset();
|
||||
voxel_texture.reset();
|
||||
}
|
||||
|
||||
deerith::shader_t *deerith::get_voxel_shader()
|
||||
@ -16,11 +27,6 @@ deerith::shader_t *deerith::get_voxel_shader()
|
||||
|
||||
deerith::texture_t *deerith::get_voxel_texture()
|
||||
{
|
||||
if (voxel_texture == nullptr)
|
||||
{
|
||||
generate_voxel_texture();
|
||||
}
|
||||
|
||||
return voxel_texture.get();
|
||||
}
|
||||
|
||||
@ -46,8 +52,3 @@ void deerith::init_voxel_shader()
|
||||
"shaders/voxel.vert.glsl",
|
||||
"shaders/voxel.frag.glsl");
|
||||
}
|
||||
|
||||
void deerith::shutdown_world_variables()
|
||||
{
|
||||
voxel_shader.reset();
|
||||
}
|
||||
@ -15,7 +15,7 @@ namespace deerith
|
||||
void shutdown_engine();
|
||||
|
||||
bool execute_client(const char *server_executable_path, int port);
|
||||
void shutdown_executing_servers();
|
||||
void shutdown_executing_programs();
|
||||
|
||||
void start_chrono();
|
||||
float get_chrono_ms();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <deerith/engine.h>
|
||||
#include <deerith/world/voxels.h>
|
||||
#include <deerith/world/world_core.h>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace deerith
|
||||
@ -13,11 +13,9 @@ namespace deerith
|
||||
|
||||
struct voxel_cluster_t
|
||||
{
|
||||
voxel_cluster_t() : last_update_tick_id(get_world_tick()) {}
|
||||
|
||||
int32_t layer;
|
||||
int32_t layer = 0;
|
||||
glm::ivec2 surface_id;
|
||||
uint32_t last_update_tick_id;
|
||||
uint32_t last_update_tick_id = -1;
|
||||
cluster_voxel_type_id_data_t __data = {};
|
||||
};
|
||||
|
||||
@ -32,6 +30,7 @@ namespace deerith
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
void set_voxel(voxel_type_id_t voxel_id, glm::ivec3 coordinates);
|
||||
|
||||
@ -41,7 +41,7 @@ bool deerith::execute_client(const char *client_executable_path, int port)
|
||||
}
|
||||
}
|
||||
|
||||
void deerith::shutdown_executing_servers()
|
||||
void deerith::shutdown_executing_programs()
|
||||
{
|
||||
for (pid_t pid : executing_servers)
|
||||
{
|
||||
|
||||
@ -49,6 +49,7 @@ deerith::voxel_cluster_t *deerith::surface_t::get_create_cluster(int layer)
|
||||
|
||||
cluster->layer = layer;
|
||||
cluster->surface_id = surface_id;
|
||||
cluster->last_update_tick_id = get_world_tick();
|
||||
|
||||
return cluster;
|
||||
}
|
||||
|
||||
@ -2,7 +2,11 @@
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
bool init_server(int port);
|
||||
void flush_network_events();
|
||||
void load_base_protocols();
|
||||
bool init_server(int port);
|
||||
|
||||
int init_network();
|
||||
void shutdown_network();
|
||||
|
||||
void load_core_protocols();
|
||||
}
|
||||
@ -1,10 +1,14 @@
|
||||
#pragma once
|
||||
#include <deerith/network/client.h>
|
||||
#include <deerith/world/components.h>
|
||||
#include <deerith/server/runtime_settings.h>
|
||||
#include <deerith/server/world.h>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
void init_world();
|
||||
void shutdown_world();
|
||||
|
||||
void init_voxel_data();
|
||||
|
||||
// Client lifecycle
|
||||
void client_connects(client_t *client);
|
||||
void client_disconnects(client_t *client);
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
int init_network();
|
||||
void shutdown_network();
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
#include <deerith/world/environment.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
struct world_settings_t
|
||||
{
|
||||
int port = 8080;
|
||||
|
||||
std::function<void(atlas_builder_t &)> define_voxel_texture_atlas_function;
|
||||
std::function<void(texture_atlas_t *)> define_voxels_materials_function;
|
||||
std::function<void()> define_voxels_types_function;
|
||||
|
||||
std::function<void(voxel_cluster_t *)> generate_voxel_cluster;
|
||||
};
|
||||
}
|
||||
@ -1,11 +1,22 @@
|
||||
#pragma once
|
||||
#include <deerith/world/world_core.h>
|
||||
#include <deerith/server/runtime_settings.h>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
struct atlas_builder_t;
|
||||
struct texture_atlas_t;
|
||||
struct voxel_cluster_t;
|
||||
|
||||
struct world_settings_t
|
||||
{
|
||||
int port = 8080;
|
||||
|
||||
std::function<void(atlas_builder_t &)> define_voxel_texture_atlas_function;
|
||||
std::function<void(texture_atlas_t *)> define_voxels_materials_function;
|
||||
std::function<void()> define_voxels_types_function;
|
||||
|
||||
std::function<void(voxel_cluster_t *)> generate_voxel_cluster;
|
||||
};
|
||||
|
||||
void run_world(const world_settings_t &);
|
||||
void shutdown_world();
|
||||
|
||||
bool is_world_running();
|
||||
}
|
||||
@ -1,16 +1,13 @@
|
||||
#include <deerith/engine.h>
|
||||
|
||||
#include <deerith/server/network.h>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
|
||||
}
|
||||
#include <deerith/server/internals/network.h>
|
||||
#include <deerith/server/internals/world.h>
|
||||
|
||||
void deerith::init_engine()
|
||||
{
|
||||
init_log("server");
|
||||
|
||||
init_network();
|
||||
load_core_protocols();
|
||||
|
||||
deerith_trace("init server engine");
|
||||
}
|
||||
@ -21,4 +18,13 @@ void deerith::shutdown_engine()
|
||||
|
||||
deerith_trace("shutdown server engine");
|
||||
shutdown_log();
|
||||
}
|
||||
}
|
||||
|
||||
void deerith::init_world()
|
||||
{
|
||||
init_voxel_data();
|
||||
}
|
||||
|
||||
void deerith::shutdown_world()
|
||||
{
|
||||
}
|
||||
|
||||
@ -4,8 +4,6 @@
|
||||
#include <deerith/network/router.h>
|
||||
#include <deerith/network/packets.h>
|
||||
|
||||
#include <deerith/server/world.h>
|
||||
#include <deerith/server/network.h>
|
||||
#include <deerith/server/internals/network.h>
|
||||
#include <deerith/server/internals/world.h>
|
||||
|
||||
@ -39,8 +37,6 @@ bool deerith::init_server(int port)
|
||||
return false;
|
||||
}
|
||||
|
||||
load_base_protocols();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
7
deerith_engine_server/src/readme.md
Normal file
7
deerith_engine_server/src/readme.md
Normal file
@ -0,0 +1,7 @@
|
||||
# Server Library Documentation
|
||||
|
||||
core.cpp // Init and shutdown all sistems
|
||||
|
||||
World/
|
||||
client_managment.cpp Client managment when connected / disconencted
|
||||
world.cpp Main Loop
|
||||
@ -6,7 +6,6 @@
|
||||
|
||||
#include <deerith/server/world.h>
|
||||
|
||||
#include <deerith/server/network.h>
|
||||
#include <deerith/server/internals/world.h>
|
||||
|
||||
void deerith::client_connects(client_t *client)
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include <deerith/server/internals/world.h>
|
||||
#include <deerith/server/internals/network.h>
|
||||
|
||||
void deerith::load_base_protocols()
|
||||
void deerith::load_core_protocols()
|
||||
{
|
||||
router_add_packet_processor<packet_update_player_input_t>();
|
||||
}
|
||||
|
||||
@ -1,17 +1,7 @@
|
||||
#include <deerith/engine.h>
|
||||
#include <deerith/server/world.h>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
extern world_settings_t world_settings;
|
||||
|
||||
void init_voxel_data();
|
||||
}
|
||||
|
||||
void deerith::init_world()
|
||||
{
|
||||
init_voxel_data();
|
||||
}
|
||||
#include <deerith/world/environment.h>
|
||||
#include <deerith/server/internals/world.h>
|
||||
|
||||
void deerith::init_voxel_data()
|
||||
{
|
||||
@ -1,9 +1,11 @@
|
||||
#include <deerith/server/internals/world.h>
|
||||
|
||||
#include <deerith/world/environment.h>
|
||||
#include <deerith/network/packets_voxel.h>
|
||||
#include <deerith/network/router.h>
|
||||
#include <unordered_map>
|
||||
#include <deerith/world/world_core.h>
|
||||
|
||||
#include <deerith/world/world_core.h>
|
||||
#include <deerith/world/components.h>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
@ -116,5 +118,4 @@ void deerith::send_cluster_info_to_client(client_t *client, voxel_cluster_t *clu
|
||||
*cluster_data.__cluster_data = cluster->__data;
|
||||
|
||||
router_send_packet(cluster_data, client);
|
||||
deerith_trace("sent cluster data to client in {} ms", get_chrono_ms());
|
||||
}
|
||||
@ -4,6 +4,8 @@
|
||||
#include <deerith/server/internals/world.h>
|
||||
#include <deerith/server/internals/network.h>
|
||||
|
||||
#include <deerith/world/world_core.h>
|
||||
|
||||
namespace deerith
|
||||
{
|
||||
void server_loop();
|
||||
@ -20,14 +22,19 @@ void deerith::run_world(const world_settings_t &__world_settings)
|
||||
deerith_error("could not init server");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
deerith_trace("server init on port {}", world_settings.port);
|
||||
}
|
||||
|
||||
init_world();
|
||||
|
||||
deerith_trace("server init on port {}", world_settings.port);
|
||||
while (true)
|
||||
{
|
||||
server_loop();
|
||||
}
|
||||
|
||||
shutdown_world();
|
||||
}
|
||||
|
||||
void deerith::server_loop()
|
||||
|
||||
@ -19,13 +19,11 @@ void sandbox::generate_voxel_cluster(deerith::voxel_cluster_t *cluster)
|
||||
float world_z = static_cast<float>(cluster->surface_id.y * deerith::CLUSTER_SIZE + z) * deerith::VOXEL_SIZE;
|
||||
|
||||
float noise_height_1 = noise.GetNoise(world_x, world_z);
|
||||
float noise_height_2 = noise.GetNoise(world_x * 5 + 101, world_z * 5 + 221);
|
||||
float noise_height_3 = noise.GetNoise(world_x * 8 - 1030, world_z * 8 - 540);
|
||||
float noise_height_2 = noise.GetNoise(world_x * 3 + 101, world_z * 3 + 221);
|
||||
|
||||
// Terrain height in voxel units
|
||||
int terrain_height = static_cast<int>(noise_height_1 * 240.0f * deerith::VOXEL_SIZE);
|
||||
terrain_height += static_cast<int>(noise_height_2 * 20.0f * deerith::VOXEL_SIZE);
|
||||
terrain_height += static_cast<int>(noise_height_3 * 5.0f * deerith::VOXEL_SIZE);
|
||||
int terrain_height = static_cast<int>(noise_height_1 * 121.0f * deerith::VOXEL_SIZE);
|
||||
// terrain_height += static_cast<int>(noise_height_2 * 20.0f * deerith::VOXEL_SIZE);
|
||||
|
||||
// Cluster's bottom position in voxel units
|
||||
int cluster_bottom = cluster->layer * deerith::CLUSTER_SIZE;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#include <deerith/engine.h>
|
||||
#include <deerith/server/world.h>
|
||||
|
||||
#include <thread>
|
||||
#include <args/argh.h>
|
||||
|
||||
#include "voxels.h"
|
||||
@ -9,6 +8,7 @@
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
deerith::init_engine();
|
||||
|
||||
auto cmdl = argh::parser(argc, argv);
|
||||
|
||||
deerith::world_settings_t world_settings;
|
||||
@ -31,6 +31,6 @@ int main(int argc, const char **argv)
|
||||
|
||||
deerith::run_world(world_settings);
|
||||
|
||||
deerith::shutdown_executing_servers();
|
||||
deerith::shutdown_executing_programs();
|
||||
deerith::shutdown_engine();
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user