From f6dd28e5ee6f5cd1f79e2f8d15100545e4b5b3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Mon, 11 Jan 2021 17:49:00 +0100 Subject: [PATCH] world_fill_dot --- code/apps/server/CMakeLists.txt | 1 - code/apps/server/source/world.c | 2 ++ code/apps/server/source/world_gen.c | 20 ++++++++++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/code/apps/server/CMakeLists.txt b/code/apps/server/CMakeLists.txt index 9476d75..89ccefc 100644 --- a/code/apps/server/CMakeLists.txt +++ b/code/apps/server/CMakeLists.txt @@ -4,7 +4,6 @@ add_executable(eco2d-server source/perlin.c source/options.c source/world.c - source/world_gen.c source/blocks.c header/network.h diff --git a/code/apps/server/source/world.c b/code/apps/server/source/world.c index 2f6deba..0cd7e00 100644 --- a/code/apps/server/source/world.c +++ b/code/apps/server/source/world.c @@ -34,3 +34,5 @@ uint32_t world_buf(uint8_t const **ptr, uint32_t *width) { if (width) *width = world_width; return world_size; } + +#include "world_gen.c" diff --git a/code/apps/server/source/world_gen.c b/code/apps/server/source/world_gen.c index 92e3140..2747476 100644 --- a/code/apps/server/source/world_gen.c +++ b/code/apps/server/source/world_gen.c @@ -2,16 +2,24 @@ #include "blocks.h" #include "zpl.h" -static void world_fill(uint8_t *world, uint32_t width, uint32_t id, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { +#include + +static void world_fill_rect(uint32_t id, uint32_t x, uint32_t y, uint32_t w, uint32_t h) { for (uint32_t cy=y; cy