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
## Dependencies
To build anything you need CMake. The ZLib development library is needed as well.
+The development versions of OpenGL, GLFW3, GLEW and Freetype are required to build the client.
+For building the server the SQLite3 development library is required.
+
+
+Ubuntu / Debian:
```bash
-sudo apt install build-essential cmake zlib1g-dev
+sudo apt install build-essential cmake zlib1g-dev libgl1-mesa-dev libglfw3-dev libglew-dev libfreetype-dev libsqlite3-dev
```
-The development versions of OpenGL, GLFW3, GLEW and Freetype are required to build the client.
+FreeBSD:
-```bash
-sudo apt install libgl1-mesa-dev libglfw3-dev libglew-dev libfreetype-dev
+```csh
+sudo pkg install cmake gcc lzlib mesa-devel glfw glew freetype sqlite3
```
-For building the server the SQLite3 development library is required.
+OpenBSD:
-```bash
-sudo apt install libsqlite3-dev
+```sh
+sudo pkg_add cmake lzlib glfw glew freetype sqlite3
```
## Building a debug build
## Dependencies
+Both the client and the server depend on ZLib.
The client depends on GLFW3, OpenGL, GLEW and Freetype.
+The server depends on SQLite3.
+
+Ubuntu / Debian:
```bash
-sudo apt install libgl1-mesa-dri libglfw3 libglew2.1 libfreetype6
+sudo apt install zlib1g libgl1-mesa-dri libglfw3 libglew2.1 libfreetype6 libsqlite3-0
+
```
-The server depends on SQLite3.
+FreeBSD:
-```bash
-sudo apt install libsqlite3-0
+```csh
+sudo pkg install lzlib mesa-dri glfw glew freetype sqlite3
```
-both the client and the server depend on ZLib.
+OpenBSD:
-```bash
-sudo apt install zlib1g
+```sh
+sudo pkg_add lzlib glfw glew freetype sqlite3
```
## Setup Requirements
${CMAKE_SOURCE_DIR}
)
-add_compile_options(-Wall -Wextra -Wpedantic -Werror -fmax-errors=4)
+if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
+ link_directories("/usr/local/lib")
+ include_directories("/usr/local/include")
+endif()
+
+if ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
+ link_directories("/usr/X11R6/lib")
+ include_directories("/usr/X11R6/include")
+endif()
+
+add_compile_options(-Wall -Wextra -Wpedantic -Werror)
set(DEPS_SOURCES
"${DEPS_DIR}/dragontype/array.c"
GLuint id = glCreateShader(type);
- const char *version = "#version 460 core\n";
+ const char *version = "#version 420 core\n";
const char *code_list[3] = {
version,
glfwWindowHint(GLFW_SAMPLES, 8);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
- glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
window.handle = glfwCreateWindow(width, height, "Dragonblocks", NULL, NULL);
} 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;
inflate(&stream, Z_NO_FLUSH);
inflateEnd(&stream);
- return stream.total_out == expected_decompressed_size;
+ return (size_t) stream.total_out == expected_decompressed_size;
}
// return true if a player is close enough to a block to access it
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)
#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>