]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Port to FreeBSD
authorElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 29 Oct 2021 18:38:01 +0000 (18:38 +0000)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Fri, 29 Oct 2021 18:38:01 +0000 (18:38 +0000)
.gitmodules
deps/endian.h
src/CMakeLists.txt
src/server/server_map.c
src/util.c
src/util.h

index 9722994ba134973f3d7670ac4550853364ed6ae9..bb962ba6335e5f4fddb7f06b2bec99adc9a4ca5e 100644 (file)
@@ -12,7 +12,7 @@
        url = https://github.com/dragonblocks/dragontype
 [submodule "deps/endian.h"]
        path = deps/endian.h
-       url = https://github.com/mikepb/endian.h
+       url = https://github.com/dragonblocks/endian.h
 [submodule "deps/dragonport"]
        path = deps/dragonport
        url = https://github.com/dragonblocks/dragonport
index 0f885cbba627efe9b8f763e1c2872e904fe0c0b1..6c7eccf05405eacbb76281550cd69895089f9773 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 0f885cbba627efe9b8f763e1c2872e904fe0c0b1
+Subproject commit 6c7eccf05405eacbb76281550cd69895089f9773
index 012b7a2833829b13946f86e07089a05fae81c4a8..8098a781c02c6cea390f9a23cf8df74c68de13e2 100644 (file)
@@ -29,6 +29,11 @@ include_directories(BEFORE
        ${CMAKE_SOURCE_DIR}
 )
 
+if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
+       link_directories("/usr/local/lib")
+       include_directories("/usr/local/include")
+endif()
+
 add_compile_options(-Wall -Wextra -Wpedantic -Werror)
 
 set(SOURCES_COMMON
index 83b81f7c30966000ee0fda871d0985c1dea96880..4c40931f3de1674777a7db9e2599875abc7e2cf4 100644 (file)
@@ -369,7 +369,7 @@ void server_map_prepare_spawn()
        } else {
                s32 spawn_height = -1;
 
-               while (map_get_node(server_map.map, (v3s32) {0, ++spawn_height, 0}).type != NODE_AIR);
+               while (map_get_node(server_map.map, (v3s32) {0, ++spawn_height, 0}).type != NODE_AIR)
                        ;
 
                server_map.spawn_height = spawn_height + 5;
index c1c1c2dc37ee3d1667240a9b3b6889128d35bdf1..7bdd1de93046bb03b838e26b3eb11df24653417b 100644 (file)
@@ -105,7 +105,7 @@ bool my_decompress(const char *compressed, size_t compressed_size, void *decompr
 bool within_simulation_distance(v3f64 player_pos, v3s32 block_pos, u32 simulation_distance)
 {
        v3s32 player_block_pos = map_node_to_block_pos((v3s32) {player_pos.x, player_pos.y, player_pos.z}, NULL);
-       return abs(player_block_pos.x - block_pos.x) <= simulation_distance && abs(player_block_pos.y - block_pos.y) <= simulation_distance && abs(player_block_pos.z - block_pos.z) <= simulation_distance;
+       return abs(player_block_pos.x - block_pos.x) <= (s32) simulation_distance && abs(player_block_pos.y - block_pos.y) <= (s32) simulation_distance && abs(player_block_pos.z - block_pos.z) <= (s32) simulation_distance;
 }
 
 f64 clamp(f64 v, f64 min, f64 max)
index ddcec815003b2ad81d14be5096b5bb74369a5d90..b7d49d80018108795c581689d74ba7d656b706ce 100644 (file)
@@ -6,7 +6,10 @@
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #else
+#include <sys/types.h>
+#include <sys/socket.h>
 #include <arpa/inet.h>
+#include <netinet/in.h>
 #endif
 #include <dragontype/number.h>