]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Rework structure
authorElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 25 Apr 2022 10:43:59 +0000 (12:43 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Mon, 25 Apr 2022 10:43:59 +0000 (12:43 +0200)
317 files changed:
.github/workflows/snapshot.yml
.gitignore
.gitmodules
BUILDING.md
README.md
assets/fonts/Minecraftia.ttf [new file with mode: 0644]
assets/meshes/axe.gox [new file with mode: 0644]
assets/meshes/axe.txt [new file with mode: 0644]
assets/meshes/pickaxe.gox [new file with mode: 0644]
assets/meshes/pickaxe.txt [new file with mode: 0644]
assets/meshes/shovel.gox [new file with mode: 0644]
assets/meshes/shovel.txt [new file with mode: 0644]
assets/meshes/unknown.gox [new file with mode: 0644]
assets/meshes/unknown.txt [new file with mode: 0644]
assets/models/player.txt [new file with mode: 0644]
assets/schematics/spawn_hut.gox [new file with mode: 0644]
assets/schematics/spawn_hut.txt [new file with mode: 0644]
assets/shaders/3d/entity/fragment.glsl [new file with mode: 0755]
assets/shaders/3d/entity/vertex.glsl [new file with mode: 0755]
assets/shaders/3d/item/fragment.glsl [new file with mode: 0755]
assets/shaders/3d/item/vertex.glsl [new file with mode: 0755]
assets/shaders/3d/selection/fragment.glsl [new file with mode: 0755]
assets/shaders/3d/selection/vertex.glsl [new file with mode: 0755]
assets/shaders/3d/terrain/fragment.glsl [new file with mode: 0755]
assets/shaders/3d/terrain/vertex.glsl [new file with mode: 0755]
assets/shaders/gui/background/fragment.glsl [new file with mode: 0755]
assets/shaders/gui/background/vertex.glsl [new file with mode: 0755]
assets/shaders/gui/font/fragment.glsl [new file with mode: 0755]
assets/shaders/gui/font/vertex.glsl [new file with mode: 0644]
assets/shaders/gui/image/fragment.glsl [new file with mode: 0755]
assets/shaders/gui/image/vertex.glsl [new file with mode: 0755]
assets/shaders/sky/clouds/fragment.glsl [new file with mode: 0755]
assets/shaders/sky/clouds/vertex.glsl [new file with mode: 0755]
assets/shaders/sky/skybox/fragment.glsl [new file with mode: 0755]
assets/shaders/sky/skybox/vertex.glsl [new file with mode: 0755]
assets/shaders/sky/sun/fragment.glsl [new file with mode: 0755]
assets/shaders/sky/sun/vertex.glsl [new file with mode: 0755]
assets/textures/crosshair.png [new file with mode: 0644]
assets/textures/dirt.png [new file with mode: 0644]
assets/textures/grass.png [new file with mode: 0644]
assets/textures/lava.png [new file with mode: 0644]
assets/textures/lava_nt.png [new file with mode: 0644]
assets/textures/models/player/arm/back.png [new file with mode: 0644]
assets/textures/models/player/arm/bottom.png [new file with mode: 0644]
assets/textures/models/player/arm/front.png [new file with mode: 0644]
assets/textures/models/player/arm/left.png [new file with mode: 0644]
assets/textures/models/player/arm/right.png [new file with mode: 0644]
assets/textures/models/player/arm/top.png [new file with mode: 0644]
assets/textures/models/player/chest/back.png [new file with mode: 0644]
assets/textures/models/player/chest/bottom.png [new file with mode: 0644]
assets/textures/models/player/chest/front.png [new file with mode: 0644]
assets/textures/models/player/chest/left.png [new file with mode: 0644]
assets/textures/models/player/chest/right.png [new file with mode: 0644]
assets/textures/models/player/chest/top.png [new file with mode: 0644]
assets/textures/models/player/head/back.png [new file with mode: 0644]
assets/textures/models/player/head/bottom.png [new file with mode: 0644]
assets/textures/models/player/head/front.png [new file with mode: 0644]
assets/textures/models/player/head/left.png [new file with mode: 0644]
assets/textures/models/player/head/right.png [new file with mode: 0644]
assets/textures/models/player/head/top.png [new file with mode: 0644]
assets/textures/models/player/leg/back.png [new file with mode: 0644]
assets/textures/models/player/leg/bottom.png [new file with mode: 0644]
assets/textures/models/player/leg/front.png [new file with mode: 0644]
assets/textures/models/player/leg/left.png [new file with mode: 0644]
assets/textures/models/player/leg/right.png [new file with mode: 0644]
assets/textures/models/player/leg/top.png [new file with mode: 0644]
assets/textures/needles.png [new file with mode: 0644]
assets/textures/oak_leaves.png [new file with mode: 0644]
assets/textures/oak_wood.png [new file with mode: 0644]
assets/textures/oak_wood_top.png [new file with mode: 0644]
assets/textures/palm_leaves.png [new file with mode: 0644]
assets/textures/palm_wood.png [new file with mode: 0644]
assets/textures/palm_wood_top.png [new file with mode: 0644]
assets/textures/pine_leaves.png [new file with mode: 0644]
assets/textures/pine_wood.png [new file with mode: 0644]
assets/textures/pine_wood_top.png [new file with mode: 0644]
assets/textures/player.png [new file with mode: 0644]
assets/textures/sand.png [new file with mode: 0644]
assets/textures/skybox/day/back.png [new file with mode: 0644]
assets/textures/skybox/day/bottom.png [new file with mode: 0644]
assets/textures/skybox/day/front.png [new file with mode: 0644]
assets/textures/skybox/day/left.png [new file with mode: 0644]
assets/textures/skybox/day/right.png [new file with mode: 0644]
assets/textures/skybox/day/top.png [new file with mode: 0644]
assets/textures/skybox/night/back.png [new file with mode: 0644]
assets/textures/skybox/night/bottom.png [new file with mode: 0644]
assets/textures/skybox/night/front.png [new file with mode: 0644]
assets/textures/skybox/night/left.png [new file with mode: 0644]
assets/textures/skybox/night/right.png [new file with mode: 0644]
assets/textures/skybox/night/top.png [new file with mode: 0644]
assets/textures/snow.png [new file with mode: 0644]
assets/textures/stone.png [new file with mode: 0644]
assets/textures/sun.png [new file with mode: 0644]
assets/textures/unknown.png [new file with mode: 0644]
assets/textures/vulcano_stone.png [new file with mode: 0644]
assets/textures/water.png [new file with mode: 0644]
assets/textures/water_nt.png [new file with mode: 0644]
build/debug.sh [new file with mode: 0755]
build/debug_loop.sh [new file with mode: 0755]
deps/asprintf
deps/dragonnet
deps/dragonstd
deps/endian.h
deps/freetype [new submodule]
deps/getline
deps/glew-cmake [new submodule]
deps/glfw [new submodule]
deps/linenoise
deps/perlin
deps/protogen
deps/sqlite3-cmake [new submodule]
deps/stpcpy [new submodule]
deps/zlib [new submodule]
fonts/Minecraftia.ttf [deleted file]
meshes/axe.gox [deleted file]
meshes/axe.txt [deleted file]
meshes/pickaxe.gox [deleted file]
meshes/pickaxe.txt [deleted file]
meshes/shovel.gox [deleted file]
meshes/shovel.txt [deleted file]
meshes/unknown.gox [deleted file]
meshes/unknown.txt [deleted file]
models/player.txt [deleted file]
schematics/spawn_hut.gox [deleted file]
schematics/spawn_hut.txt [deleted file]
shaders/3d/entity/fragment.glsl [deleted file]
shaders/3d/entity/vertex.glsl [deleted file]
shaders/3d/item/fragment.glsl [deleted file]
shaders/3d/item/vertex.glsl [deleted file]
shaders/3d/selection/fragment.glsl [deleted file]
shaders/3d/selection/vertex.glsl [deleted file]
shaders/3d/terrain/fragment.glsl [deleted file]
shaders/3d/terrain/vertex.glsl [deleted file]
shaders/gui/background/fragment.glsl [deleted file]
shaders/gui/background/vertex.glsl [deleted file]
shaders/gui/font/fragment.glsl [deleted file]
shaders/gui/font/vertex.glsl [deleted file]
shaders/gui/image/fragment.glsl [deleted file]
shaders/gui/image/vertex.glsl [deleted file]
shaders/sky/clouds/fragment.glsl [deleted file]
shaders/sky/clouds/vertex.glsl [deleted file]
shaders/sky/skybox/fragment.glsl [deleted file]
shaders/sky/skybox/vertex.glsl [deleted file]
shaders/sky/sun/fragment.glsl [deleted file]
shaders/sky/sun/vertex.glsl [deleted file]
singleplayer.bat [new file with mode: 0755]
singleplayer.sh
snapshot.sh
src/CMakeLists.txt
src/client/camera.h
src/client/client.c
src/client/client_auth.c
src/client/client_config.c
src/client/client_entity.c
src/client/client_entity.h
src/client/client_inventory.c
src/client/client_item.c
src/client/client_item.h
src/client/client_node.c
src/client/client_node.h
src/client/client_player.c
src/client/client_terrain.c
src/client/client_terrain.h
src/client/debug_menu.c
src/client/font.c
src/client/frustum.h
src/client/game.c
src/client/gui.c
src/client/gui.h
src/client/input.c
src/client/interact.c
src/client/interact.h
src/client/light.c
src/client/mesh.c
src/client/model.c
src/client/model.h
src/client/raycast.h
src/client/screenshot.c
src/client/sky.c
src/client/terrain_gfx.c
src/client/terrain_gfx.h
src/client/texture.c
src/client/window.h
src/color.c [deleted file]
src/color.h [deleted file]
src/common/color.c [new file with mode: 0644]
src/common/color.h [new file with mode: 0644]
src/common/config.c [new file with mode: 0644]
src/common/config.h [new file with mode: 0644]
src/common/day.c [new file with mode: 0644]
src/common/day.h [new file with mode: 0644]
src/common/dig.h [new file with mode: 0644]
src/common/entity.h [new file with mode: 0644]
src/common/environment.c [new file with mode: 0644]
src/common/environment.h [new file with mode: 0644]
src/common/facedir.c [new file with mode: 0644]
src/common/facedir.h [new file with mode: 0644]
src/common/interrupt.c [new file with mode: 0644]
src/common/interrupt.h [new file with mode: 0644]
src/common/item.c [new file with mode: 0644]
src/common/item.h [new file with mode: 0644]
src/common/node.c [new file with mode: 0644]
src/common/node.h [new file with mode: 0644]
src/common/perlin.c [new file with mode: 0644]
src/common/perlin.h [new file with mode: 0644]
src/common/physics.c [new file with mode: 0644]
src/common/physics.h [new file with mode: 0644]
src/common/terrain.c [new file with mode: 0644]
src/common/terrain.h [new file with mode: 0644]
src/config.c [deleted file]
src/config.h [deleted file]
src/day.c [deleted file]
src/day.h [deleted file]
src/debug.sh [deleted file]
src/debug_loop.sh [deleted file]
src/debug_terrain.sh [deleted file]
src/dig.h [deleted file]
src/entity.h [deleted file]
src/environment.c [deleted file]
src/environment.h [deleted file]
src/facedir.c [deleted file]
src/facedir.h [deleted file]
src/interrupt.c [deleted file]
src/interrupt.h [deleted file]
src/item.c [deleted file]
src/item.h [deleted file]
src/mingw.cmake [new file with mode: 0644]
src/node.c [deleted file]
src/node.h [deleted file]
src/perlin.c [deleted file]
src/perlin.h [deleted file]
src/physics.c [deleted file]
src/physics.h [deleted file]
src/server/biomes.h
src/server/database.c
src/server/database.h
src/server/schematic.c
src/server/schematic.h
src/server/server.c
src/server/server_config.c
src/server/server_item.c
src/server/server_item.h
src/server/server_node.h
src/server/server_player.c
src/server/server_player.h
src/server/server_terrain.c
src/server/server_terrain.h
src/server/terrain_gen.c
src/server/terrain_gen.h
src/server/tree.h
src/server/tree_physics.c
src/server/voxel_depth_search.c
src/server/voxel_procedural.c
src/server/voxel_procedural.h
src/terrain.c [deleted file]
src/terrain.h [deleted file]
textures/crosshair.png [deleted file]
textures/dirt.png [deleted file]
textures/grass.png [deleted file]
textures/lava.png [deleted file]
textures/lava_nt.png [deleted file]
textures/models/player/arm/back.png [deleted file]
textures/models/player/arm/bottom.png [deleted file]
textures/models/player/arm/front.png [deleted file]
textures/models/player/arm/left.png [deleted file]
textures/models/player/arm/right.png [deleted file]
textures/models/player/arm/top.png [deleted file]
textures/models/player/chest/back.png [deleted file]
textures/models/player/chest/bottom.png [deleted file]
textures/models/player/chest/front.png [deleted file]
textures/models/player/chest/left.png [deleted file]
textures/models/player/chest/right.png [deleted file]
textures/models/player/chest/top.png [deleted file]
textures/models/player/head/back.png [deleted file]
textures/models/player/head/bottom.png [deleted file]
textures/models/player/head/front.png [deleted file]
textures/models/player/head/left.png [deleted file]
textures/models/player/head/right.png [deleted file]
textures/models/player/head/top.png [deleted file]
textures/models/player/leg/back.png [deleted file]
textures/models/player/leg/bottom.png [deleted file]
textures/models/player/leg/front.png [deleted file]
textures/models/player/leg/left.png [deleted file]
textures/models/player/leg/right.png [deleted file]
textures/models/player/leg/top.png [deleted file]
textures/needles.png [deleted file]
textures/oak_leaves.png [deleted file]
textures/oak_wood.png [deleted file]
textures/oak_wood_top.png [deleted file]
textures/palm_leaves.png [deleted file]
textures/palm_wood.png [deleted file]
textures/palm_wood_top.png [deleted file]
textures/pine_leaves.png [deleted file]
textures/pine_wood.png [deleted file]
textures/pine_wood_top.png [deleted file]
textures/player.png [deleted file]
textures/sand.png [deleted file]
textures/skybox/day/back.png [deleted file]
textures/skybox/day/bottom.png [deleted file]
textures/skybox/day/front.png [deleted file]
textures/skybox/day/left.png [deleted file]
textures/skybox/day/right.png [deleted file]
textures/skybox/day/top.png [deleted file]
textures/skybox/night/back.png [deleted file]
textures/skybox/night/bottom.png [deleted file]
textures/skybox/night/front.png [deleted file]
textures/skybox/night/left.png [deleted file]
textures/skybox/night/right.png [deleted file]
textures/skybox/night/top.png [deleted file]
textures/snow.png [deleted file]
textures/stone.png [deleted file]
textures/sun.png [deleted file]
textures/unknown.png [deleted file]
textures/vulcano_stone.png [deleted file]
textures/water.png [deleted file]
textures/water_nt.png [deleted file]
upload.sh

index c12d6759e31a2fc7d87601cc655b208c22b0091e..232947f214ee1b883c4238d3e6f989c48948ec3e 100644 (file)
@@ -11,11 +11,14 @@ jobs:
       - name: Install deps
         run: |
           sudo apt-get update
-          sudo apt-get install -y build-essential cmake libgl1-mesa-dev libglfw3-dev libglew-dev libsqlite3-dev zlib1g-dev curl zip lua5.3
-      - name: Build
+          sudo apt-get install -y build-essential cmake lua5.3 curl zip
+      - name: Build ubuntu snapshot
         run: |
           ./snapshot.sh
-      - name: Upload snapshot
+      - name: Build windows snapshot
+        run: |
+          ./snapshot.sh mingw
+      - name: Upload snapshots
         env:
           SECRET: ${{ secrets.ELIDRAGON_UPLOAD_TOKEN }}
         run: |
index 576b8e6194c96633713ff13ffe67586db4a78ecd..53912a6668aaa072d98a20640c0ffaf9deb70b85 100644 (file)
@@ -1,30 +1,4 @@
-# CMake
-CMakeLists.txt.user
-CMakeCache.txt
-CMakeFiles
-CMakeScripts
-Testing
-Makefile
-cmake_install.cmake
-install_manifest.txt
-compile_commands.json
-CTestTestfile.cmake
-_deps
-
-# Binaries
-dragonblocks
-dragonblocks_server
-dragonblocks_alpha-*.zip
-dragonblocks_alpha
-
-# Data
-client.conf
-server.conf
-*.sqlite
-*.sqlite-journal
-screenshot-*.png
-
-# Generated code
-version.h
-types.c
-types.h
+build*/*
+!build/debug.sh
+!build/debug_loop.sh
+dragonblocks_alpha*
index 49df65fad72fb679e41359d134b3f9ea529da36e..bf29ca1e792d0d7977eb04fd1e5e21c2fc57a1e9 100644 (file)
@@ -3,7 +3,7 @@
        url = https://github.com/datenwolf/linmath.h
 [submodule "deps/perlin"]
        path = deps/perlin
-       url = https://github.com/czinn/perlin
+       url = https://github.com/dragonblocks/perlin
 [submodule "deps/stb"]
        path = deps/stb
        url = https://github.com/nothings/stb
        url = https://github.com/dragonblocks/dragonnet
 [submodule "deps/linenoise"]
        path = deps/linenoise
-       url = https://github.com/msteveb/linenoise
+       url = https://github.com/dragonblocks/linenoise
 [submodule "deps/protogen"]
        path = deps/protogen
        url = https://github.com/dragonblocks/protogen
 [submodule "deps/getline"]
        path = deps/getline
        url = https://github.com/dragonblocks/getline
+[submodule "deps/glfw"]
+       path = deps/glfw
+       url = https://github.com/glfw/glfw
+[submodule "deps/glew-cmake"]
+       path = deps/glew-cmake
+       url = https://github.com/Perlmint/glew-cmake
+[submodule "deps/freetype"]
+       path = deps/freetype
+       url = https://gitlab.freedesktop.org/freetype/freetype
+[submodule "deps/sqlite3-cmake"]
+       path = deps/sqlite3-cmake
+       url = https://github.com/dragonblocks/sqlite3-cmake
+[submodule "deps/stpcpy"]
+       path = deps/stpcpy
+       url = https://github.com/dragonblocks/stpcpy
+[submodule "deps/zlib"]
+       path = deps/zlib
+       url = https://github.com/dragonblocks/zlib
index 2decc4b6fc0aeb4268d268343bd40ca691fdc896..723d2b71aadc8b352a558a34611ec5c6d8f5e7de 100644 (file)
@@ -1,50 +1,34 @@
 # Building instructions
 
-CMake is used for compiling. Make sure to clone the repository recursively:
-
-```bash
-git clone --recurse-submodules https://github.com/dragonblocks/dragonblocks_alpha.git
-```
-
 ## Dependencies
-To build anything you need CMake and Lua. 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:
+To build anything you need Git, CMake, Lua, Bash and GCC. Make sure these dependencies are installed on your system.
+All other dependencies are included as submodules, compiled automatically and statically linked.
+Make sure to clone the repository recursively:
 
 ```bash
-sudo apt install build-essential cmake zlib1g-dev libgl1-mesa-dev libglfw3-dev libglew-dev libfreetype-dev libsqlite3-dev lua5.3
-```
-
-FreeBSD:
-
-```csh
-sudo pkg install cmake gcc lzlib mesa-devel glfw glew freetype sqlite3 lua
-```
-
-OpenBSD:
-
-```sh
-sudo pkg_add cmake lzlib glfw glew freetype sqlite3 lua
+git clone --recurse-submodules https://github.com/dragonblocks/dragonblocks_alpha.git
 ```
 
 ## Building a debug build
-By default CMake will make a Debug build if nothing else is specified. Simply use
+By default CMake will make a debug build if nothing else is specified. Simply use
 
 ```bash
-cd src
-cmake .
+cmake -B build -S src
+cd build
 make -j$(nproc)
 ```
 
 to build the dragonblocks client and server.
-If you use a debug build, the singleplayer script should be invoked from the src/ directory, because that's where the binaries are located.
+If you use a debug build, the singleplayer script should be invoked from the build/ directory, because that's where the binaries are located.
 
-## Building a snapshot
+## Building a release snapshot
 
 ```bash
+# Native snapshot
 ./snapshot.sh
+
+# Crosscompiling for windows (requires i686-w64-mingw32-gcc-posix)
+./snapshot.sh mingw
 ```
-This script will create a snapshot zipfile.
+
+Creates snapshot zipfiles.
index baa5eece7855deb29553b8e5118b53009e8b7620..581cf19d6b7bcca8989f31bc55f3206a2681e00b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,20 +1,30 @@
 # Dragonblocks Alpha
 
 A multiplayer voxelgame for POSIX systems.
+It has been ported to Linux, Windows, FreeBSD and OpenBSD, but may work on other systems.
 
-Head to <https://www.elidragon.tk/dragonblocks_alpha/> for ubuntu snapshot and release builds.
+Head to <https://www.elidragon.tk/dragonblocks_alpha/> for snapshot and release builds (CURRENTLY DOWN).
 
 ## Invocation
 
-```bash
-./DragonblocksServer <port>
-./Dragonblocks <address> <port>
+```sh
+# on posix
+./dragonblocks_server "[<address>]:<port>"
+./dragonblocks_client "[<address>]:<port>"
+
+# on windows
+dragonblocks_server.exe "[<address>]:<port>"
+dragonblocks_client.exe "[<address>]:<port>"
 ```
 
 or alternatively:
 
-```bash
+```sh
+# on posix
 ./singleplayer.sh
+
+# on windows
+singleplayer.bat
 ```
 
 ## Controls
@@ -35,35 +45,10 @@ or alternatively:
 | F11 | Toggle fullscreen |
 | ESC | Pause / unpause game |
 
-## 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 zlib1g libgl1-mesa-dri libglfw3 libglew2.1 libfreetype6 libsqlite3-0
-
-```
-
-FreeBSD:
-
-```csh
-sudo pkg install lzlib mesa-dri glfw glew freetype sqlite3
-```
-
-OpenBSD:
-
-```sh
-sudo pkg_add lzlib glfw glew freetype sqlite3
-```
-
-## Setup Requirements
+## System Requirements
 Dragonblocks Alpha targets PCs only. Non x86-64 platforms may work, however there is no guarantee whatsoever.
 You need a POSIX system conforming to the ISO C and POSIX 2008 standards. However, so far only GNU/Linux systems, in particular Ubuntu and Debian, have been tested.
-The minimum OpenGL version is 4.6.0. Dragonblocks has been tested on Intel Integrated and NVIDIA GPUs, however other graphics cards should work as well.
+The minimum OpenGL version is 4.2.0. Dragonblocks has been tested on Intel Integrated and NVIDIA GPUs, however other graphics cards should work as well.
 A PC with at least 4 CPU cores is recommended, but not necessarily required.
 
 ## Current Features
diff --git a/assets/fonts/Minecraftia.ttf b/assets/fonts/Minecraftia.ttf
new file mode 100644 (file)
index 0000000..2cf2af4
Binary files /dev/null and b/assets/fonts/Minecraftia.ttf differ
diff --git a/assets/meshes/axe.gox b/assets/meshes/axe.gox
new file mode 100644 (file)
index 0000000..08bb09a
Binary files /dev/null and b/assets/meshes/axe.gox differ
diff --git a/assets/meshes/axe.txt b/assets/meshes/axe.txt
new file mode 100644 (file)
index 0000000..1e29a2a
--- /dev/null
@@ -0,0 +1,39 @@
+# Goxel 0.10.6
+# One line per voxel
+# X Y Z RRGGBB
+0 -1 9 a5a5a5
+0 -1 10 a0a0a0
+0 0 0 503612
+0 0 1 503612
+0 0 2 584120
+0 0 3 43351e
+0 0 4 503612
+0 0 5 503612
+0 0 6 4a3312
+0 0 7 5c421a
+0 3 7 a0a0a0
+0 4 7 9e9e9e
+0 0 8 5a380e
+0 2 8 9e9e9e
+0 3 8 a1a1a1
+0 4 8 a1a1a1
+0 0 9 a1a1a1
+1 0 9 a0a0a0
+0 1 9 9e9e9e
+0 2 9 9e9e9e
+0 3 9 a1a1a1
+0 4 9 9e9e9e
+0 0 10 989898
+1 0 10 a0a0a0
+0 1 10 a0a0a0
+0 2 10 9e9e9e
+0 3 10 9e9e9e
+0 4 10 9e9e9e
+0 0 11 5c421a
+0 2 11 a0a0a0
+0 3 11 9e9e9e
+0 4 11 a1a1a1
+0 3 12 9e9e9e
+0 4 12 9e9e9e
+-1 0 9 a0a0a0
+-1 0 10 a0a0a0
diff --git a/assets/meshes/pickaxe.gox b/assets/meshes/pickaxe.gox
new file mode 100644 (file)
index 0000000..95e9c21
Binary files /dev/null and b/assets/meshes/pickaxe.gox differ
diff --git a/assets/meshes/pickaxe.txt b/assets/meshes/pickaxe.txt
new file mode 100644 (file)
index 0000000..c14d78e
--- /dev/null
@@ -0,0 +1,31 @@
+# Goxel 0.10.6
+# One line per voxel
+# X Y Z RRGGBB
+0 -4 7 a0a0a0
+0 -4 8 a0a0a0
+0 -3 8 999999
+0 -3 9 a0a0a0
+0 -2 9 a0a0a0
+0 -1 9 8b8b8b
+0 -2 10 a0a0a0
+0 -1 10 a9a9a9
+0 0 0 503612
+0 0 1 503612
+0 0 2 584120
+0 0 3 43351e
+0 0 4 503612
+0 0 5 503612
+0 0 6 4a3312
+0 0 7 5c421a
+0 4 7 999999
+0 0 8 5a380e
+0 3 8 999999
+0 4 8 a0a0a0
+0 0 9 a0a0a0
+0 1 9 a9a9a9
+0 2 9 a0a0a0
+0 3 9 a0a0a0
+0 0 10 a9a9a9
+0 1 10 8b8b8b
+0 2 10 a0a0a0
+0 0 11 a0a0a0
diff --git a/assets/meshes/shovel.gox b/assets/meshes/shovel.gox
new file mode 100644 (file)
index 0000000..76d6155
Binary files /dev/null and b/assets/meshes/shovel.gox differ
diff --git a/assets/meshes/shovel.txt b/assets/meshes/shovel.txt
new file mode 100644 (file)
index 0000000..808bc2a
--- /dev/null
@@ -0,0 +1,22 @@
+# Goxel 0.10.6
+# One line per voxel
+# X Y Z RRGGBB
+0 0 0 503612
+0 0 1 503612
+0 0 2 584120
+0 0 3 43351e
+0 0 4 503612
+0 0 5 503612
+0 0 6 4a3312
+0 0 7 5c421a
+0 0 8 5a380e
+0 0 9 959595
+1 0 9 a0a0a0
+0 0 10 959595
+1 0 10 959595
+0 0 11 7e7e7e
+1 0 11 a0a0a0
+0 0 12 a0a0a0
+-1 0 9 7e7e7e
+-1 0 10 959595
+-1 0 11 959595
diff --git a/assets/meshes/unknown.gox b/assets/meshes/unknown.gox
new file mode 100644 (file)
index 0000000..61584af
Binary files /dev/null and b/assets/meshes/unknown.gox differ
diff --git a/assets/meshes/unknown.txt b/assets/meshes/unknown.txt
new file mode 100644 (file)
index 0000000..78bbd97
--- /dev/null
@@ -0,0 +1,732 @@
+# Goxel 0.10.6
+# One line per voxel
+# X Y Z RRGGBB
+0 0 0 920088
+1 0 0 920088
+2 0 0 920088
+3 0 0 920088
+4 0 0 920088
+5 0 0 920088
+6 0 0 920088
+7 0 0 920088
+8 0 0 920088
+0 1 0 920088
+1 1 0 c400bc
+2 1 0 c400bc
+3 1 0 c400bc
+4 1 0 c400bc
+5 1 0 c400bc
+6 1 0 c400bc
+7 1 0 c400bc
+8 1 0 920088
+0 2 0 920088
+1 2 0 c400bc
+2 2 0 c400bc
+3 2 0 cdd300
+4 2 0 cdd300
+5 2 0 cdd300
+6 2 0 c400bc
+7 2 0 c400bc
+8 2 0 920088
+0 3 0 920088
+1 3 0 c400bc
+2 3 0 cdd300
+3 3 0 c400bc
+4 3 0 c400bc
+5 3 0 c400bc
+6 3 0 cdd300
+7 3 0 c400bc
+8 3 0 920088
+0 4 0 920088
+1 4 0 c400bc
+2 4 0 c400bc
+3 4 0 c400bc
+4 4 0 cdd300
+5 4 0 cdd300
+6 4 0 c400bc
+7 4 0 c400bc
+8 4 0 920088
+0 5 0 920088
+1 5 0 c400bc
+2 5 0 c400bc
+3 5 0 c400bc
+4 5 0 c400bc
+5 5 0 c400bc
+6 5 0 c400bc
+7 5 0 c400bc
+8 5 0 920088
+0 6 0 920088
+1 6 0 c400bc
+2 6 0 c400bc
+3 6 0 c400bc
+4 6 0 cdd300
+5 6 0 c400bc
+6 6 0 c400bc
+7 6 0 c400bc
+8 6 0 920088
+0 7 0 920088
+1 7 0 c400bc
+2 7 0 c400bc
+3 7 0 c400bc
+4 7 0 c400bc
+5 7 0 c400bc
+6 7 0 c400bc
+7 7 0 c400bc
+8 7 0 920088
+0 8 0 920088
+1 8 0 920088
+2 8 0 920088
+3 8 0 920088
+4 8 0 920088
+5 8 0 920088
+6 8 0 920088
+7 8 0 920088
+8 8 0 920088
+0 0 1 920088
+1 0 1 c400bc
+2 0 1 c400bc
+3 0 1 c400bc
+4 0 1 c400bc
+5 0 1 c400bc
+6 0 1 c400bc
+7 0 1 c400bc
+8 0 1 920088
+0 1 1 c400bc
+1 1 1 ffffff
+2 1 1 ffffff
+3 1 1 ffffff
+4 1 1 ffffff
+5 1 1 ffffff
+6 1 1 ffffff
+7 1 1 ffffff
+8 1 1 c400bc
+0 2 1 c400bc
+1 2 1 ffffff
+2 2 1 ffffff
+3 2 1 ffffff
+4 2 1 ffffff
+5 2 1 ffffff
+6 2 1 ffffff
+7 2 1 ffffff
+8 2 1 c400bc
+0 3 1 c400bc
+1 3 1 ffffff
+2 3 1 ffffff
+3 3 1 ffffff
+4 3 1 ffffff
+5 3 1 ffffff
+6 3 1 ffffff
+7 3 1 ffffff
+8 3 1 c400bc
+0 4 1 c400bc
+1 4 1 ffffff
+2 4 1 ffffff
+3 4 1 ffffff
+4 4 1 ffffff
+5 4 1 ffffff
+6 4 1 ffffff
+7 4 1 ffffff
+8 4 1 c400bc
+0 5 1 c400bc
+1 5 1 ffffff
+2 5 1 ffffff
+3 5 1 ffffff
+4 5 1 ffffff
+5 5 1 ffffff
+6 5 1 ffffff
+7 5 1 ffffff
+8 5 1 c400bc
+0 6 1 c400bc
+1 6 1 ffffff
+2 6 1 ffffff
+3 6 1 ffffff
+4 6 1 ffffff
+5 6 1 ffffff
+6 6 1 ffffff
+7 6 1 ffffff
+8 6 1 c400bc
+0 7 1 c400bc
+1 7 1 ffffff
+2 7 1 ffffff
+3 7 1 ffffff
+4 7 1 ffffff
+5 7 1 ffffff
+6 7 1 ffffff
+7 7 1 ffffff
+8 7 1 c400bc
+0 8 1 920088
+1 8 1 c400bc
+2 8 1 c400bc
+3 8 1 c400bc
+4 8 1 c400bc
+5 8 1 c400bc
+6 8 1 c400bc
+7 8 1 c400bc
+8 8 1 920088
+0 0 2 920088
+1 0 2 c400bc
+2 0 2 c400bc
+3 0 2 c400bc
+4 0 2 cdd300
+5 0 2 c400bc
+6 0 2 c400bc
+7 0 2 c400bc
+8 0 2 920088
+0 1 2 c400bc
+1 1 2 ffffff
+2 1 2 ffffff
+3 1 2 ffffff
+4 1 2 ffffff
+5 1 2 ffffff
+6 1 2 ffffff
+7 1 2 ffffff
+8 1 2 c400bc
+0 2 2 c400bc
+1 2 2 ffffff
+2 2 2 ffffff
+3 2 2 ffffff
+4 2 2 ffffff
+5 2 2 ffffff
+6 2 2 ffffff
+7 2 2 ffffff
+8 2 2 c400bc
+0 3 2 c400bc
+1 3 2 ffffff
+2 3 2 ffffff
+3 3 2 ffffff
+4 3 2 ffffff
+5 3 2 ffffff
+6 3 2 ffffff
+7 3 2 ffffff
+8 3 2 c400bc
+0 4 2 cdd300
+1 4 2 ffffff
+2 4 2 ffffff
+3 4 2 ffffff
+4 4 2 ffffff
+5 4 2 ffffff
+6 4 2 ffffff
+7 4 2 ffffff
+8 4 2 cdd300
+0 5 2 c400bc
+1 5 2 ffffff
+2 5 2 ffffff
+3 5 2 ffffff
+4 5 2 ffffff
+5 5 2 ffffff
+6 5 2 ffffff
+7 5 2 ffffff
+8 5 2 c400bc
+0 6 2 c400bc
+1 6 2 ffffff
+2 6 2 ffffff
+3 6 2 ffffff
+4 6 2 ffffff
+5 6 2 ffffff
+6 6 2 ffffff
+7 6 2 ffffff
+8 6 2 c400bc
+0 7 2 c400bc
+1 7 2 ffffff
+2 7 2 ffffff
+3 7 2 ffffff
+4 7 2 ffffff
+5 7 2 ffffff
+6 7 2 ffffff
+7 7 2 ffffff
+8 7 2 c400bc
+0 8 2 920088
+1 8 2 c400bc
+2 8 2 c400bc
+3 8 2 c400bc
+4 8 2 cdd300
+5 8 2 c400bc
+6 8 2 c400bc
+7 8 2 c400bc
+8 8 2 920088
+0 0 3 920088
+1 0 3 c400bc
+2 0 3 c400bc
+3 0 3 c400bc
+4 0 3 c400bc
+5 0 3 c400bc
+6 0 3 c400bc
+7 0 3 c400bc
+8 0 3 920088
+0 1 3 c400bc
+1 1 3 ffffff
+2 1 3 c400bc
+3 1 3 c400bc
+4 1 3 ffffff
+5 1 3 ffffff
+6 1 3 ffffff
+7 1 3 ffffff
+8 1 3 c400bc
+0 2 3 c400bc
+1 2 3 c400bc
+2 2 3 c400bc
+3 2 3 ffffff
+4 2 3 ffffff
+5 2 3 ffffff
+6 2 3 ffffff
+7 2 3 ffffff
+8 2 3 c400bc
+0 3 3 c400bc
+1 3 3 ffffff
+2 3 3 ffffff
+3 3 3 ffffff
+4 3 3 ffffff
+5 3 3 ffffff
+6 3 3 ffffff
+7 3 3 ffffff
+8 3 3 c400bc
+0 4 3 c400bc
+1 4 3 ffffff
+2 4 3 ffffff
+3 4 3 ffffff
+4 4 3 ffffff
+5 4 3 ffffff
+6 4 3 ffffff
+7 4 3 ffffff
+8 4 3 c400bc
+0 5 3 c400bc
+1 5 3 ffffff
+2 5 3 ffffff
+3 5 3 ffffff
+4 5 3 ffffff
+5 5 3 ffffff
+6 5 3 ffffff
+7 5 3 ffffff
+8 5 3 c400bc
+0 6 3 c400bc
+1 6 3 ffffff
+2 6 3 ffffff
+3 6 3 ffffff
+4 6 3 ffffff
+5 6 3 ffffff
+6 6 3 ffffff
+7 6 3 ffffff
+8 6 3 c400bc
+0 7 3 c400bc
+1 7 3 ffffff
+2 7 3 ffffff
+3 7 3 ffffff
+4 7 3 ffffff
+5 7 3 ffffff
+6 7 3 ffffff
+7 7 3 ffffff
+8 7 3 c400bc
+0 8 3 920088
+1 8 3 c400bc
+2 8 3 c400bc
+3 8 3 c400bc
+4 8 3 c400bc
+5 8 3 c400bc
+6 8 3 c400bc
+7 8 3 c400bc
+8 8 3 920088
+0 0 4 920088
+1 0 4 c400bc
+2 0 4 c400bc
+3 0 4 c400bc
+4 0 4 cdd300
+5 0 4 cdd300
+6 0 4 c400bc
+7 0 4 c400bc
+8 0 4 920088
+0 1 4 c400bc
+1 1 4 c400bc
+2 1 4 c400bc
+3 1 4 ffffff
+4 1 4 ffffff
+5 1 4 ffffff
+6 1 4 ffffff
+7 1 4 ffffff
+8 1 4 c400bc
+0 2 4 c400bc
+1 2 4 c400bc
+2 2 4 ffffff
+3 2 4 ffffff
+4 2 4 ffffff
+5 2 4 ffffff
+6 2 4 ffffff
+7 2 4 ffffff
+8 2 4 c400bc
+0 3 4 cdd300
+1 3 4 ffffff
+2 3 4 ffffff
+3 3 4 ffffff
+4 3 4 ffffff
+5 3 4 ffffff
+6 3 4 ffffff
+7 3 4 ffffff
+8 3 4 c400bc
+0 4 4 cdd300
+1 4 4 ffffff
+2 4 4 ffffff
+3 4 4 ffffff
+4 4 4 ffffff
+5 4 4 ffffff
+6 4 4 ffffff
+7 4 4 ffffff
+8 4 4 cdd300
+0 5 4 c400bc
+1 5 4 ffffff
+2 5 4 ffffff
+3 5 4 ffffff
+4 5 4 ffffff
+5 5 4 ffffff
+6 5 4 ffffff
+7 5 4 ffffff
+8 5 4 cdd300
+0 6 4 c400bc
+1 6 4 ffffff
+2 6 4 ffffff
+3 6 4 ffffff
+4 6 4 ffffff
+5 6 4 ffffff
+6 6 4 ffffff
+7 6 4 ffffff
+8 6 4 c400bc
+0 7 4 c400bc
+1 7 4 ffffff
+2 7 4 ffffff
+3 7 4 ffffff
+4 7 4 ffffff
+5 7 4 ffffff
+6 7 4 ffffff
+7 7 4 ffffff
+8 7 4 c400bc
+0 8 4 920088
+1 8 4 c400bc
+2 8 4 c400bc
+3 8 4 cdd300
+4 8 4 cdd300
+5 8 4 c400bc
+6 8 4 c400bc
+7 8 4 c400bc
+8 8 4 920088
+0 0 5 920088
+1 0 5 c400bc
+2 0 5 cdd300
+3 0 5 c400bc
+4 0 5 c400bc
+5 0 5 c400bc
+6 0 5 cdd300
+7 0 5 c400bc
+8 0 5 920088
+0 1 5 c400bc
+1 1 5 c400bc
+2 1 5 ffffff
+3 1 5 ffffff
+4 1 5 ffffff
+5 1 5 ffffff
+6 1 5 ffffff
+7 1 5 ffffff
+8 1 5 c400bc
+0 2 5 cdd300
+1 2 5 ffffff
+2 2 5 ffffff
+3 2 5 ffffff
+4 2 5 ffffff
+5 2 5 ffffff
+6 2 5 ffffff
+7 2 5 ffffff
+8 2 5 cdd300
+0 3 5 c400bc
+1 3 5 ffffff
+2 3 5 ffffff
+3 3 5 ffffff
+4 3 5 ffffff
+5 3 5 ffffff
+6 3 5 ffffff
+7 3 5 ffffff
+8 3 5 c400bc
+0 4 5 c400bc
+1 4 5 ffffff
+2 4 5 ffffff
+3 4 5 ffffff
+4 4 5 ffffff
+5 4 5 ffffff
+6 4 5 ffffff
+7 4 5 ffffff
+8 4 5 c400bc
+0 5 5 c400bc
+1 5 5 ffffff
+2 5 5 ffffff
+3 5 5 ffffff
+4 5 5 ffffff
+5 5 5 ffffff
+6 5 5 ffffff
+7 5 5 ffffff
+8 5 5 c400bc
+0 6 5 cdd300
+1 6 5 ffffff
+2 6 5 ffffff
+3 6 5 ffffff
+4 6 5 ffffff
+5 6 5 ffffff
+6 6 5 ffffff
+7 6 5 ffffff
+8 6 5 cdd300
+0 7 5 c400bc
+1 7 5 ffffff
+2 7 5 ffffff
+3 7 5 ffffff
+4 7 5 ffffff
+5 7 5 ffffff
+6 7 5 ffffff
+7 7 5 ffffff
+8 7 5 c400bc
+0 8 5 920088
+1 8 5 c400bc
+2 8 5 cdd300
+3 8 5 c400bc
+4 8 5 c400bc
+5 8 5 c400bc
+6 8 5 cdd300
+7 8 5 c400bc
+8 8 5 920088
+0 0 6 920088
+1 0 6 c400bc
+2 0 6 c400bc
+3 0 6 cdd300
+4 0 6 cdd300
+5 0 6 cdd300
+6 0 6 c400bc
+7 0 6 c400bc
+8 0 6 920088
+0 1 6 c400bc
+1 1 6 c400bc
+2 1 6 c400bc
+3 1 6 c400bc
+4 1 6 ffffff
+5 1 6 ffffff
+6 1 6 c400bc
+7 1 6 c400bc
+8 1 6 c400bc
+0 2 6 c400bc
+1 2 6 c400bc
+2 2 6 ffffff
+3 2 6 ffffff
+4 2 6 ffffff
+5 2 6 ffffff
+6 2 6 ffffff
+7 2 6 ffffff
+8 2 6 c400bc
+0 3 6 cdd300
+1 3 6 ffffff
+2 3 6 ffffff
+3 3 6 ffffff
+4 3 6 ffffff
+5 3 6 ffffff
+6 3 6 ffffff
+7 3 6 ffffff
+8 3 6 cdd300
+0 4 6 cdd300
+1 4 6 ffffff
+2 4 6 ffffff
+3 4 6 ffffff
+4 4 6 ffffff
+5 4 6 ffffff
+6 4 6 ffffff
+7 4 6 ffffff
+8 4 6 cdd300
+0 5 6 cdd300
+1 5 6 ffffff
+2 5 6 ffffff
+3 5 6 ffffff
+4 5 6 ffffff
+5 5 6 ffffff
+6 5 6 ffffff
+7 5 6 ffffff
+8 5 6 cdd300
+0 6 6 c400bc
+1 6 6 ffffff
+2 6 6 ffffff
+3 6 6 ffffff
+4 6 6 ffffff
+5 6 6 ffffff
+6 6 6 ffffff
+7 6 6 ffffff
+8 6 6 c400bc
+0 7 6 c400bc
+1 7 6 ffffff
+2 7 6 ffffff
+3 7 6 ffffff
+4 7 6 ffffff
+5 7 6 ffffff
+6 7 6 ffffff
+7 7 6 ffffff
+8 7 6 c400bc
+0 8 6 920088
+1 8 6 c400bc
+2 8 6 c400bc
+3 8 6 cdd300
+4 8 6 cdd300
+5 8 6 cdd300
+6 8 6 c400bc
+7 8 6 c400bc
+8 8 6 920088
+0 0 7 920088
+1 0 7 c400bc
+2 0 7 c400bc
+3 0 7 c400bc
+4 0 7 c400bc
+5 0 7 c400bc
+6 0 7 c400bc
+7 0 7 c400bc
+8 0 7 920088
+0 1 7 c400bc
+1 1 7 ffffff
+2 1 7 c400bc
+3 1 7 ffffff
+4 1 7 ffffff
+5 1 7 ffffff
+6 1 7 ffffff
+7 1 7 c400bc
+8 1 7 c400bc
+0 2 7 c400bc
+1 2 7 c400bc
+2 2 7 c400bc
+3 2 7 c400bc
+4 2 7 ffffff
+5 2 7 c400bc
+6 2 7 c400bc
+7 2 7 c400bc
+8 2 7 c400bc
+0 3 7 c400bc
+1 3 7 c400bc
+2 3 7 ffffff
+3 3 7 ffffff
+4 3 7 c400bc
+5 3 7 c400bc
+6 3 7 c400bc
+7 3 7 ffffff
+8 3 7 c400bc
+0 4 7 c400bc
+1 4 7 ffffff
+2 4 7 ffffff
+3 4 7 ffffff
+4 4 7 ffffff
+5 4 7 ffffff
+6 4 7 ffffff
+7 4 7 ffffff
+8 4 7 c400bc
+0 5 7 c400bc
+1 5 7 ffffff
+2 5 7 ffffff
+3 5 7 ffffff
+4 5 7 ffffff
+5 5 7 ffffff
+6 5 7 ffffff
+7 5 7 ffffff
+8 5 7 c400bc
+0 6 7 c400bc
+1 6 7 ffffff
+2 6 7 ffffff
+3 6 7 ffffff
+4 6 7 ffffff
+5 6 7 ffffff
+6 6 7 ffffff
+7 6 7 ffffff
+8 6 7 c400bc
+0 7 7 c400bc
+1 7 7 ffffff
+2 7 7 ffffff
+3 7 7 ffffff
+4 7 7 ffffff
+5 7 7 ffffff
+6 7 7 ffffff
+7 7 7 ffffff
+8 7 7 c400bc
+0 8 7 920088
+1 8 7 c400bc
+2 8 7 c400bc
+3 8 7 c400bc
+4 8 7 c400bc
+5 8 7 c400bc
+6 8 7 c400bc
+7 8 7 c400bc
+8 8 7 920088
+0 0 8 920088
+1 0 8 920088
+2 0 8 920088
+3 0 8 920088
+4 0 8 920088
+5 0 8 920088
+6 0 8 920088
+7 0 8 920088
+8 0 8 920088
+0 1 8 920088
+1 1 8 c400bc
+2 1 8 c400bc
+3 1 8 c400bc
+4 1 8 c400bc
+5 1 8 c400bc
+6 1 8 c400bc
+7 1 8 c400bc
+8 1 8 920088
+0 2 8 920088
+1 2 8 c400bc
+2 2 8 c400bc
+3 2 8 c400bc
+4 2 8 cdd300
+5 2 8 c400bc
+6 2 8 c400bc
+7 2 8 c400bc
+8 2 8 920088
+0 3 8 920088
+1 3 8 c400bc
+2 3 8 c400bc
+3 3 8 c400bc
+4 3 8 c400bc
+5 3 8 c400bc
+6 3 8 c400bc
+7 3 8 c400bc
+8 3 8 920088
+0 4 8 920088
+1 4 8 c400bc
+2 4 8 c400bc
+3 4 8 c400bc
+4 4 8 cdd300
+5 4 8 cdd300
+6 4 8 c400bc
+7 4 8 c400bc
+8 4 8 920088
+0 5 8 920088
+1 5 8 c400bc
+2 5 8 cdd300
+3 5 8 c400bc
+4 5 8 c400bc
+5 5 8 c400bc
+6 5 8 cdd300
+7 5 8 c400bc
+8 5 8 920088
+0 6 8 920088
+1 6 8 c400bc
+2 6 8 c400bc
+3 6 8 cdd300
+4 6 8 cdd300
+5 6 8 cdd300
+6 6 8 c400bc
+7 6 8 c400bc
+8 6 8 920088
+0 7 8 920088
+1 7 8 c400bc
+2 7 8 c400bc
+3 7 8 c400bc
+4 7 8 c400bc
+5 7 8 c400bc
+6 7 8 c400bc
+7 7 8 c400bc
+8 7 8 920088
+0 8 8 920088
+1 8 8 920088
+2 8 8 920088
+3 8 8 920088
+4 8 8 920088
+5 8 8 920088
+6 8 8 920088
+7 8 8 920088
+8 8 8 920088
diff --git a/assets/models/player.txt b/assets/models/player.txt
new file mode 100644 (file)
index 0000000..ec997b8
--- /dev/null
@@ -0,0 +1,15 @@
+name nametag pos 0 2 0
+name neck pos 0 1.35 0
+       name head pos 0 0.225 0 scale 0.45 0.45 0.45 cube head
+               name eyes pos 0 0 +0.5
+name chest pos 0 1.0125 0 scale 0.48 0.675 0.225 cube chest
+name arm_left pos +0.36 1.35 0
+       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube arm
+       name hand pos 0 -0.585 0 scale 0.0625 0.0625 0.0625 rot 90 0 0
+name arm_right pos -0.36 1.35 0 scale -1 1 1 clockwise
+       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube arm
+       name hand pos 0 -0.585 0 scale 0.0625 0.0625 0.0625 rot 90 0 0
+name leg_left pos +0.12 0.675 0
+       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube leg
+name leg_right pos -0.12 0.675 0 scale -1 1 1 clockwise
+       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube leg
diff --git a/assets/schematics/spawn_hut.gox b/assets/schematics/spawn_hut.gox
new file mode 100644 (file)
index 0000000..7387575
Binary files /dev/null and b/assets/schematics/spawn_hut.gox differ
diff --git a/assets/schematics/spawn_hut.txt b/assets/schematics/spawn_hut.txt
new file mode 100644 (file)
index 0000000..5e33f2d
--- /dev/null
@@ -0,0 +1,429 @@
+# Goxel 0.10.6
+# One line per voxel
+# X Y Z RRGGBB
+0 -3 0 7d5435
+1 -3 0 7d5435
+2 -3 0 7d5435
+3 -3 0 7d5435
+4 -3 0 7d5435
+0 -2 0 7d5435
+1 -2 0 7d5435
+2 -2 0 7d5435
+3 -2 0 7d5435
+4 -2 0 7d5435
+0 -1 0 7d5435
+1 -1 0 7d5435
+2 -1 0 7d5435
+3 -1 0 7d5435
+4 -1 0 7d5435
+0 -3 1 7d5435
+1 -3 1 7d5435
+2 -3 1 7d5435
+3 -3 1 7d5435
+4 -3 1 7d5435
+4 -2 1 7d5435
+4 -1 1 7d5435
+0 -3 2 7d5435
+3 -3 2 7d5435
+4 -3 2 7d5435
+4 -2 2 7d5435
+4 -1 2 7d5435
+0 -3 3 7d5435
+3 -3 3 7d5435
+4 -3 3 7d5435
+4 -2 3 7d5435
+4 -1 3 7d5435
+0 -3 4 7d5435
+1 -3 4 7d5435
+2 -3 4 7d5435
+3 -3 4 7d5435
+4 -3 4 7d5435
+4 -2 4 7d5435
+4 -1 4 7d5435
+0 -4 5 503728
+1 -4 5 503728
+2 -4 5 503728
+3 -4 5 503728
+4 -4 5 503728
+5 -4 5 503728
+0 -3 5 503728
+1 -3 5 503728
+2 -3 5 503728
+3 -3 5 503728
+4 -3 5 503728
+0 -2 5 503728
+1 -2 5 503728
+2 -2 5 503728
+3 -2 5 503728
+4 -2 5 7d5435
+0 -1 5 503728
+1 -1 5 503728
+2 -1 5 503728
+3 -1 5 503728
+4 -1 5 7d5435
+0 -3 6 503728
+1 -3 6 503728
+2 -3 6 503728
+3 -3 6 503728
+4 -3 6 503728
+5 -3 6 503728
+0 -2 6 503728
+1 -2 6 503728
+2 -2 6 503728
+3 -2 6 503728
+4 -2 6 503728
+4 -1 6 7d5435
+0 -2 7 503728
+1 -2 7 503728
+2 -2 7 503728
+3 -2 7 503728
+4 -2 7 503728
+5 -2 7 503728
+0 -1 7 503728
+1 -1 7 503728
+2 -1 7 503728
+3 -1 7 503728
+4 -1 7 503728
+0 -1 8 503728
+1 -1 8 503728
+2 -1 8 503728
+3 -1 8 503728
+4 -1 8 503728
+5 -1 8 503728
+-5 -3 0 7d5435
+-4 -3 0 7d5435
+-3 -3 0 7d5435
+-2 -3 0 7d5435
+-1 -3 0 7d5435
+-5 -2 0 7d5435
+-4 -2 0 7d5435
+-3 -2 0 7d5435
+-2 -2 0 7d5435
+-1 -2 0 7d5435
+-5 -1 0 7d5435
+-4 -1 0 7d5435
+-3 -1 0 7d5435
+-2 -1 0 7d5435
+-1 -1 0 7d5435
+-5 -3 1 7d5435
+-4 -3 1 7d5435
+-3 -3 1 7d5435
+-2 -3 1 7d5435
+-1 -3 1 7d5435
+-5 -2 1 7d5435
+-5 -1 1 7d5435
+-5 -3 2 7d5435
+-4 -3 2 7d5435
+-1 -3 2 7d5435
+-5 -3 3 7d5435
+-4 -3 3 7d5435
+-1 -3 3 7d5435
+-5 -3 4 7d5435
+-4 -3 4 7d5435
+-3 -3 4 7d5435
+-2 -3 4 7d5435
+-1 -3 4 7d5435
+-5 -2 4 7d5435
+-5 -1 4 7d5435
+-6 -4 5 503728
+-5 -4 5 503728
+-4 -4 5 503728
+-3 -4 5 503728
+-2 -4 5 503728
+-1 -4 5 503728
+-5 -3 5 503728
+-4 -3 5 503728
+-3 -3 5 503728
+-2 -3 5 503728
+-1 -3 5 503728
+-5 -2 5 7d5435
+-4 -2 5 503728
+-3 -2 5 503728
+-2 -2 5 503728
+-1 -2 5 503728
+-5 -1 5 7d5435
+-4 -1 5 503728
+-3 -1 5 503728
+-2 -1 5 503728
+-1 -1 5 503728
+-6 -3 6 503728
+-5 -3 6 503728
+-4 -3 6 503728
+-3 -3 6 503728
+-2 -3 6 503728
+-1 -3 6 503728
+-5 -2 6 503728
+-4 -2 6 503728
+-3 -2 6 503728
+-2 -2 6 503728
+-1 -2 6 503728
+-5 -1 6 7d5435
+-6 -2 7 503728
+-5 -2 7 503728
+-4 -2 7 503728
+-3 -2 7 503728
+-2 -2 7 503728
+-1 -2 7 503728
+-5 -1 7 503728
+-4 -1 7 503728
+-3 -1 7 503728
+-2 -1 7 503728
+-1 -1 7 503728
+-6 -1 8 503728
+-5 -1 8 503728
+-4 -1 8 503728
+-3 -1 8 503728
+-2 -1 8 503728
+-1 -1 8 503728
+0 0 0 7d5435
+1 0 0 7d5435
+2 0 0 7d5435
+3 0 0 7d5435
+4 0 0 7d5435
+0 1 0 7d5435
+1 1 0 7d5435
+2 1 0 7d5435
+3 1 0 7d5435
+4 1 0 7d5435
+0 2 0 7d5435
+1 2 0 7d5435
+2 2 0 7d5435
+3 2 0 7d5435
+4 2 0 7d5435
+0 3 0 7d5435
+1 3 0 7d5435
+2 3 0 7d5435
+3 3 0 7d5435
+4 3 0 7d5435
+0 4 0 7d5435
+1 4 0 7d5435
+2 4 0 7d5435
+3 4 0 7d5435
+4 4 0 7d5435
+4 2 1 7d5435
+4 3 1 7d5435
+0 4 1 7d5435
+1 4 1 7d5435
+2 4 1 7d5435
+3 4 1 7d5435
+4 4 1 7d5435
+4 2 2 7d5435
+4 3 2 7d5435
+1 4 2 7d5435
+4 4 2 7d5435
+4 2 3 7d5435
+4 3 3 7d5435
+1 4 3 7d5435
+4 4 3 7d5435
+4 0 4 7d5435
+4 1 4 7d5435
+4 2 4 7d5435
+4 3 4 7d5435
+0 4 4 7d5435
+1 4 4 7d5435
+2 4 4 7d5435
+3 4 4 7d5435
+4 4 4 7d5435
+0 0 5 503728
+1 0 5 503728
+2 0 5 503728
+3 0 5 503728
+4 0 5 7d5435
+0 1 5 503728
+1 1 5 503728
+2 1 5 503728
+3 1 5 503728
+4 1 5 7d5435
+0 2 5 503728
+1 2 5 503728
+2 2 5 503728
+3 2 5 503728
+4 2 5 7d5435
+0 3 5 503728
+1 3 5 503728
+2 3 5 503728
+3 3 5 503728
+4 3 5 7d5435
+0 4 5 503728
+1 4 5 503728
+2 4 5 503728
+3 4 5 503728
+4 4 5 503728
+0 5 5 503728
+1 5 5 503728
+2 5 5 503728
+3 5 5 503728
+4 5 5 503728
+5 5 5 503728
+4 0 6 7d5435
+4 1 6 7d5435
+4 2 6 7d5435
+0 3 6 503728
+1 3 6 503728
+2 3 6 503728
+3 3 6 503728
+4 3 6 503728
+0 4 6 503728
+1 4 6 503728
+2 4 6 503728
+3 4 6 503728
+4 4 6 503728
+5 4 6 503728
+4 0 7 503728
+4 1 7 503728
+0 2 7 503728
+1 2 7 503728
+2 2 7 503728
+3 2 7 503728
+4 2 7 503728
+0 3 7 503728
+1 3 7 503728
+2 3 7 503728
+3 3 7 503728
+4 3 7 503728
+5 3 7 503728
+0 0 8 503728
+1 0 8 503728
+2 0 8 503728
+3 0 8 503728
+4 0 8 503728
+5 0 8 503728
+0 1 8 503728
+1 1 8 503728
+2 1 8 503728
+3 1 8 503728
+4 1 8 503728
+5 1 8 503728
+0 2 8 503728
+1 2 8 503728
+2 2 8 503728
+3 2 8 503728
+4 2 8 503728
+5 2 8 503728
+-5 0 0 7d5435
+-4 0 0 7d5435
+-3 0 0 7d5435
+-2 0 0 7d5435
+-1 0 0 7d5435
+-5 1 0 7d5435
+-4 1 0 7d5435
+-3 1 0 7d5435
+-2 1 0 7d5435
+-1 1 0 7d5435
+-5 2 0 7d5435
+-4 2 0 7d5435
+-3 2 0 7d5435
+-2 2 0 7d5435
+-1 2 0 7d5435
+-5 3 0 7d5435
+-4 3 0 7d5435
+-3 3 0 7d5435
+-2 3 0 7d5435
+-1 3 0 7d5435
+-5 4 0 7d5435
+-4 4 0 7d5435
+-3 4 0 7d5435
+-2 4 0 7d5435
+-1 4 0 7d5435
+-5 0 1 7d5435
+-5 1 1 7d5435
+-5 2 1 7d5435
+-5 3 1 7d5435
+-5 4 1 7d5435
+-4 4 1 7d5435
+-3 4 1 7d5435
+-2 4 1 7d5435
+-1 4 1 7d5435
+-5 1 2 7d5435
+-5 2 2 7d5435
+-5 4 2 7d5435
+-3 4 2 7d5435
+-5 1 3 7d5435
+-5 2 3 7d5435
+-5 4 3 7d5435
+-3 4 3 7d5435
+-5 0 4 7d5435
+-5 1 4 7d5435
+-5 2 4 7d5435
+-5 3 4 7d5435
+-5 4 4 7d5435
+-4 4 4 7d5435
+-3 4 4 7d5435
+-2 4 4 7d5435
+-1 4 4 7d5435
+-5 0 5 7d5435
+-4 0 5 503728
+-3 0 5 503728
+-2 0 5 503728
+-1 0 5 503728
+-5 1 5 7d5435
+-4 1 5 503728
+-3 1 5 503728
+-2 1 5 503728
+-1 1 5 503728
+-5 2 5 7d5435
+-4 2 5 503728
+-3 2 5 503728
+-2 2 5 503728
+-1 2 5 503728
+-5 3 5 7d5435
+-4 3 5 503728
+-3 3 5 503728
+-2 3 5 503728
+-1 3 5 503728
+-5 4 5 503728
+-4 4 5 503728
+-3 4 5 503728
+-2 4 5 503728
+-1 4 5 503728
+-6 5 5 503728
+-5 5 5 503728
+-4 5 5 503728
+-3 5 5 503728
+-2 5 5 503728
+-1 5 5 503728
+-5 0 6 7d5435
+-5 1 6 7d5435
+-5 2 6 7d5435
+-5 3 6 503728
+-4 3 6 503728
+-3 3 6 503728
+-2 3 6 503728
+-1 3 6 503728
+-6 4 6 503728
+-5 4 6 503728
+-4 4 6 503728
+-3 4 6 503728
+-2 4 6 503728
+-1 4 6 503728
+-5 0 7 503728
+-5 1 7 503728
+-5 2 7 503728
+-4 2 7 503728
+-3 2 7 503728
+-2 2 7 503728
+-1 2 7 503728
+-6 3 7 503728
+-5 3 7 503728
+-4 3 7 503728
+-3 3 7 503728
+-2 3 7 503728
+-1 3 7 503728
+-6 0 8 503728
+-5 0 8 503728
+-4 0 8 503728
+-3 0 8 503728
+-2 0 8 503728
+-1 0 8 503728
+-6 1 8 503728
+-5 1 8 503728
+-4 1 8 503728
+-3 1 8 503728
+-2 1 8 503728
+-1 1 8 503728
+-6 2 8 503728
+-5 2 8 503728
+-4 2 8 503728
+-3 2 8 503728
+-2 2 8 503728
+-1 2 8 503728
diff --git a/assets/shaders/3d/entity/fragment.glsl b/assets/shaders/3d/entity/fragment.glsl
new file mode 100755 (executable)
index 0000000..d74e86a
--- /dev/null
@@ -0,0 +1,18 @@
+in vec3 fragmentPosition;
+in vec3 fragmentTextureCoordinates;
+in float fragmentLight;
+
+out vec4 outColor;
+
+uniform vec3 fogColor;
+uniform vec3 cameraPos;
+uniform samplerCube texture0;
+
+void main()
+{
+       outColor = texture(texture0, fragmentTextureCoordinates) * vec4(vec3(fragmentLight), 1.0);
+       outColor.rgb = mix(outColor.rgb, fogColor, clamp(length(fragmentPosition - cameraPos) / VIEW_DISTANCE, 0.0, 1.0));
+
+       if (outColor.a == 0.0)
+               discard;
+}
diff --git a/assets/shaders/3d/entity/vertex.glsl b/assets/shaders/3d/entity/vertex.glsl
new file mode 100755 (executable)
index 0000000..1490381
--- /dev/null
@@ -0,0 +1,28 @@
+layout(location = 0) in vec3 vertexPosition;
+layout(location = 1) in vec3 vertexNormal;
+
+out vec3 fragmentPosition;
+out vec3 fragmentTextureCoordinates;
+out float fragmentLight;
+
+uniform mat4 model;
+uniform mat4 VP;
+uniform float daylight;
+uniform float ambientLight;
+uniform vec3 lightDir;
+uniform float depthOffset;
+
+void main()
+{
+       vec4 worldSpace = model * vec4(vertexPosition, 1.0);
+       gl_Position = VP * worldSpace;
+       if (gl_Position.z > -1.0)
+               gl_Position.z = max(-1.0, gl_Position.z - depthOffset);
+
+       fragmentPosition = worldSpace.xyz;
+       fragmentTextureCoordinates = vertexPosition;
+
+       mat3 normalMatrix = transpose(inverse(mat3(model)));
+       vec3 normal = normalize(normalMatrix * vertexNormal);
+       fragmentLight = ambientLight + 0.3 * daylight * clamp(dot(normal, normalize(lightDir)), 0.0, 1.0);
+}
diff --git a/assets/shaders/3d/item/fragment.glsl b/assets/shaders/3d/item/fragment.glsl
new file mode 100755 (executable)
index 0000000..102b9a5
--- /dev/null
@@ -0,0 +1,16 @@
+in vec3 fragmentPosition;
+in vec3 fragmentColor;
+
+out vec4 outColor;
+
+uniform vec3 fogColor;
+uniform vec3 cameraPos;
+
+void main()
+{
+       outColor = vec4(fragmentColor, 1.0);
+       outColor.rgb = mix(outColor.rgb, fogColor, clamp(length(fragmentPosition - cameraPos) / VIEW_DISTANCE, 0.0, 1.0));
+
+       if (outColor.a == 0.0)
+               discard;
+}
diff --git a/assets/shaders/3d/item/vertex.glsl b/assets/shaders/3d/item/vertex.glsl
new file mode 100755 (executable)
index 0000000..897610c
--- /dev/null
@@ -0,0 +1,28 @@
+layout(location = 0) in vec3 vertexPosition;
+layout(location = 1) in vec3 vertexNormal;
+layout(location = 2) in vec3 vertexColor;
+
+out vec3 fragmentPosition;
+out vec3 fragmentColor;
+
+uniform mat4 model;
+uniform mat4 VP;
+uniform float daylight;
+uniform float ambientLight;
+uniform vec3 lightDir;
+uniform float depthOffset;
+
+void main()
+{
+       vec4 worldSpace = model * vec4(vertexPosition, 1.0);
+       gl_Position = VP * worldSpace;
+       if (gl_Position.z > -1.0)
+               gl_Position.z = max(-1.0, gl_Position.z - depthOffset);
+
+       fragmentPosition = worldSpace.xyz;
+       fragmentColor = vertexColor;
+
+       mat3 normalMatrix = transpose(inverse(mat3(model)));
+       vec3 normal = normalize(normalMatrix * vertexNormal);
+       fragmentColor *= ambientLight + 0.3 * daylight * clamp(dot(normal, normalize(lightDir)), 0.0, 1.0);
+}
diff --git a/assets/shaders/3d/selection/fragment.glsl b/assets/shaders/3d/selection/fragment.glsl
new file mode 100755 (executable)
index 0000000..b591cd7
--- /dev/null
@@ -0,0 +1,8 @@
+out vec4 outColor;
+
+uniform vec3 color;
+
+void main()
+{
+       outColor = vec4(color, 0.1);
+}
diff --git a/assets/shaders/3d/selection/vertex.glsl b/assets/shaders/3d/selection/vertex.glsl
new file mode 100755 (executable)
index 0000000..65dc0d2
--- /dev/null
@@ -0,0 +1,8 @@
+layout(location = 0) in vec3 vertexPosition;
+
+uniform mat4 MVP;
+
+void main()
+{
+       gl_Position = MVP * vec4(vertexPosition, 1.0);
+}
diff --git a/assets/shaders/3d/terrain/fragment.glsl b/assets/shaders/3d/terrain/fragment.glsl
new file mode 100755 (executable)
index 0000000..37bc567
--- /dev/null
@@ -0,0 +1,19 @@
+in vec3 fragmentPosition;
+in vec2 fragmentTextureCoordinates;
+in float fragmentTextureIndex;
+in vec3 fragmentColor;
+
+out vec4 outColor;
+
+uniform vec3 fogColor;
+uniform vec3 cameraPos;
+uniform sampler2D textures[MAX_TEXTURE_UNITS];
+
+void main()
+{
+       outColor = texture(textures[int(fragmentTextureIndex + 0.5)], fragmentTextureCoordinates) * vec4(fragmentColor, 1.0);
+       outColor.rgb = mix(outColor.rgb, fogColor, clamp(length(fragmentPosition - cameraPos) / VIEW_DISTANCE, 0.0, 1.0));
+
+       if (outColor.a == 0.0)
+               discard;
+}
diff --git a/assets/shaders/3d/terrain/vertex.glsl b/assets/shaders/3d/terrain/vertex.glsl
new file mode 100755 (executable)
index 0000000..2068cdc
--- /dev/null
@@ -0,0 +1,29 @@
+layout(location = 0) in vec3 vertexPosition;
+layout(location = 1) in vec3 vertexNormal;
+layout(location = 2) in vec2 vertexTextureCoordinates;
+layout(location = 3) in float vertexTextureIndex;
+layout(location = 4) in vec3 vertexColor;
+
+out vec3 fragmentPosition;
+out vec2 fragmentTextureCoordinates;
+out float fragmentTextureIndex;
+out vec3 fragmentColor;
+
+uniform mat4 model;
+uniform mat4 VP;
+uniform float daylight;
+uniform float ambientLight;
+uniform vec3 lightDir;
+
+void main()
+{
+       vec4 worldSpace = model * vec4(vertexPosition, 1.0);
+       gl_Position = VP * worldSpace;
+
+       fragmentPosition = worldSpace.xyz;
+       fragmentTextureCoordinates = vertexTextureCoordinates;
+       fragmentTextureIndex = vertexTextureIndex;
+       fragmentColor = vertexColor;
+
+       fragmentColor *= ambientLight + 0.3 * daylight * clamp(dot(normalize(vertexNormal), normalize(lightDir)), 0.0, 1.0);
+}
diff --git a/assets/shaders/gui/background/fragment.glsl b/assets/shaders/gui/background/fragment.glsl
new file mode 100755 (executable)
index 0000000..5bd15e3
--- /dev/null
@@ -0,0 +1,8 @@
+out vec4 outColor;
+
+uniform vec4 color;
+
+void main()
+{
+       outColor = color;
+}
diff --git a/assets/shaders/gui/background/vertex.glsl b/assets/shaders/gui/background/vertex.glsl
new file mode 100755 (executable)
index 0000000..5815511
--- /dev/null
@@ -0,0 +1,9 @@
+layout(location = 0) in vec2 vertexPosition;
+
+uniform mat4 model;
+uniform mat4 projection;
+
+void main()
+{
+       gl_Position = projection * model * vec4(vertexPosition, 0.0, 1.0);
+}
diff --git a/assets/shaders/gui/font/fragment.glsl b/assets/shaders/gui/font/fragment.glsl
new file mode 100755 (executable)
index 0000000..883a012
--- /dev/null
@@ -0,0 +1,11 @@
+in vec2 fragmentTextureCoordinates;
+
+out vec4 outColor;
+
+uniform sampler2D texture0;
+uniform vec4 color;
+
+void main()
+{
+       outColor = vec4(1.0, 1.0, 1.0, texture(texture0, fragmentTextureCoordinates).r) * color;
+}
diff --git a/assets/shaders/gui/font/vertex.glsl b/assets/shaders/gui/font/vertex.glsl
new file mode 100644 (file)
index 0000000..50bcd6e
--- /dev/null
@@ -0,0 +1,13 @@
+layout(location = 0) in vec2 vertexPosition;
+layout(location = 1) in vec2 vertexTextureCoordinates;
+
+out vec2 fragmentTextureCoordinates;
+
+uniform mat4 model;
+uniform mat4 projection;
+
+void main()
+{
+       gl_Position = projection * model * vec4(vertexPosition, 0.0, 1.0);
+       fragmentTextureCoordinates = vertexTextureCoordinates;
+}
diff --git a/assets/shaders/gui/image/fragment.glsl b/assets/shaders/gui/image/fragment.glsl
new file mode 100755 (executable)
index 0000000..bc8e428
--- /dev/null
@@ -0,0 +1,10 @@
+in vec2 fragmentTextureCoordinates;
+
+out vec4 outColor;
+
+uniform sampler2D texture0;
+
+void main()
+{
+       outColor = texture(texture0, fragmentTextureCoordinates);
+}
diff --git a/assets/shaders/gui/image/vertex.glsl b/assets/shaders/gui/image/vertex.glsl
new file mode 100755 (executable)
index 0000000..50bcd6e
--- /dev/null
@@ -0,0 +1,13 @@
+layout(location = 0) in vec2 vertexPosition;
+layout(location = 1) in vec2 vertexTextureCoordinates;
+
+out vec2 fragmentTextureCoordinates;
+
+uniform mat4 model;
+uniform mat4 projection;
+
+void main()
+{
+       gl_Position = projection * model * vec4(vertexPosition, 0.0, 1.0);
+       fragmentTextureCoordinates = vertexTextureCoordinates;
+}
diff --git a/assets/shaders/sky/clouds/fragment.glsl b/assets/shaders/sky/clouds/fragment.glsl
new file mode 100755 (executable)
index 0000000..32fc25b
--- /dev/null
@@ -0,0 +1,31 @@
+in vec3 fragmentTextureCoordinates;
+
+out vec4 outColor;
+
+uniform float daylight;
+uniform samplerCube texture0;
+
+float reverseMix(float value, float min, float max)
+{
+       return clamp((value - min) / (max - min), 0.0, 1.0);
+}
+
+float strengthen(float value, float exponent, float max)
+{
+       return min((1.0 - pow(1.0 - value, exponent)) / (1.0 - pow(1.0 - max, exponent)), 1.0);
+}
+
+void main()
+{
+       float height = normalize(fragmentTextureCoordinates).y;
+
+       vec4 topColor = texture(texture0, vec3(0.0, 1.0, 0.0));
+       vec4 bottomColor = texture(texture0, vec3(1.0, 0.11, 0.5));
+       vec4 expectedColor = mix(bottomColor, topColor, height);
+
+       vec4 dayColor = texture(texture0, fragmentTextureCoordinates);
+
+       float cloudFactor = reverseMix(length(dayColor.rg - expectedColor.rg), 0.15, length(vec2(1.0)));
+
+       outColor = vec4(dayColor.rgb, mix(cloudFactor, strengthen(cloudFactor, 8.0, 0.1), daylight));
+}
diff --git a/assets/shaders/sky/clouds/vertex.glsl b/assets/shaders/sky/clouds/vertex.glsl
new file mode 100755 (executable)
index 0000000..1b361b7
--- /dev/null
@@ -0,0 +1,12 @@
+layout(location = 0) in vec3 vertexPosition;
+
+out vec3 fragmentTextureCoordinates;
+
+uniform mat4 VP;
+
+void main()
+{
+       gl_Position = VP * vec4(vertexPosition, 1.0);
+       gl_Position.z = gl_Position.w;
+       fragmentTextureCoordinates = vertexPosition;
+}
diff --git a/assets/shaders/sky/skybox/fragment.glsl b/assets/shaders/sky/skybox/fragment.glsl
new file mode 100755 (executable)
index 0000000..e6c61b4
--- /dev/null
@@ -0,0 +1,17 @@
+in vec3 fragmentTextureCoordinates;
+
+out vec4 outColor;
+
+uniform float daylight;
+uniform samplerCube textures[2];
+
+void main()
+{
+       vec4 topColor = texture(textures[0], vec3(0.0, 1.0, 0.0));
+       vec4 bottomColor = texture(textures[0], vec3(1.0, 0.11, 0.5));
+
+       vec4 dayColor = mix(bottomColor, topColor, normalize(fragmentTextureCoordinates).y);
+       vec4 nightColor = texture(textures[1], fragmentTextureCoordinates);
+
+       outColor = mix(nightColor, dayColor, daylight);
+}
diff --git a/assets/shaders/sky/skybox/vertex.glsl b/assets/shaders/sky/skybox/vertex.glsl
new file mode 100755 (executable)
index 0000000..1b361b7
--- /dev/null
@@ -0,0 +1,12 @@
+layout(location = 0) in vec3 vertexPosition;
+
+out vec3 fragmentTextureCoordinates;
+
+uniform mat4 VP;
+
+void main()
+{
+       gl_Position = VP * vec4(vertexPosition, 1.0);
+       gl_Position.z = gl_Position.w;
+       fragmentTextureCoordinates = vertexPosition;
+}
diff --git a/assets/shaders/sky/sun/fragment.glsl b/assets/shaders/sky/sun/fragment.glsl
new file mode 100755 (executable)
index 0000000..bc8e428
--- /dev/null
@@ -0,0 +1,10 @@
+in vec2 fragmentTextureCoordinates;
+
+out vec4 outColor;
+
+uniform sampler2D texture0;
+
+void main()
+{
+       outColor = texture(texture0, fragmentTextureCoordinates);
+}
diff --git a/assets/shaders/sky/sun/vertex.glsl b/assets/shaders/sky/sun/vertex.glsl
new file mode 100755 (executable)
index 0000000..243d17f
--- /dev/null
@@ -0,0 +1,13 @@
+layout(location = 0) in vec3 vertexPosition;
+layout(location = 1) in vec2 vertexTextureCoordinates;
+
+out vec2 fragmentTextureCoordinates;
+
+uniform mat4 MVP;
+
+void main()
+{
+       gl_Position = MVP * vec4(vertexPosition, 1.0);
+       gl_Position.z = gl_Position.w;
+       fragmentTextureCoordinates = vertexTextureCoordinates;
+}
diff --git a/assets/textures/crosshair.png b/assets/textures/crosshair.png
new file mode 100644 (file)
index 0000000..8f03d32
Binary files /dev/null and b/assets/textures/crosshair.png differ
diff --git a/assets/textures/dirt.png b/assets/textures/dirt.png
new file mode 100644 (file)
index 0000000..9a64b49
Binary files /dev/null and b/assets/textures/dirt.png differ
diff --git a/assets/textures/grass.png b/assets/textures/grass.png
new file mode 100644 (file)
index 0000000..70a3522
Binary files /dev/null and b/assets/textures/grass.png differ
diff --git a/assets/textures/lava.png b/assets/textures/lava.png
new file mode 100644 (file)
index 0000000..48aaccf
Binary files /dev/null and b/assets/textures/lava.png differ
diff --git a/assets/textures/lava_nt.png b/assets/textures/lava_nt.png
new file mode 100644 (file)
index 0000000..e44018f
Binary files /dev/null and b/assets/textures/lava_nt.png differ
diff --git a/assets/textures/models/player/arm/back.png b/assets/textures/models/player/arm/back.png
new file mode 100644 (file)
index 0000000..69ffff3
Binary files /dev/null and b/assets/textures/models/player/arm/back.png differ
diff --git a/assets/textures/models/player/arm/bottom.png b/assets/textures/models/player/arm/bottom.png
new file mode 100644 (file)
index 0000000..fda334e
Binary files /dev/null and b/assets/textures/models/player/arm/bottom.png differ
diff --git a/assets/textures/models/player/arm/front.png b/assets/textures/models/player/arm/front.png
new file mode 100644 (file)
index 0000000..ce19461
Binary files /dev/null and b/assets/textures/models/player/arm/front.png differ
diff --git a/assets/textures/models/player/arm/left.png b/assets/textures/models/player/arm/left.png
new file mode 100644 (file)
index 0000000..c2b2325
Binary files /dev/null and b/assets/textures/models/player/arm/left.png differ
diff --git a/assets/textures/models/player/arm/right.png b/assets/textures/models/player/arm/right.png
new file mode 100644 (file)
index 0000000..9ae2e41
Binary files /dev/null and b/assets/textures/models/player/arm/right.png differ
diff --git a/assets/textures/models/player/arm/top.png b/assets/textures/models/player/arm/top.png
new file mode 100644 (file)
index 0000000..e12765d
Binary files /dev/null and b/assets/textures/models/player/arm/top.png differ
diff --git a/assets/textures/models/player/chest/back.png b/assets/textures/models/player/chest/back.png
new file mode 100644 (file)
index 0000000..5eca9ec
Binary files /dev/null and b/assets/textures/models/player/chest/back.png differ
diff --git a/assets/textures/models/player/chest/bottom.png b/assets/textures/models/player/chest/bottom.png
new file mode 100644 (file)
index 0000000..131d33d
Binary files /dev/null and b/assets/textures/models/player/chest/bottom.png differ
diff --git a/assets/textures/models/player/chest/front.png b/assets/textures/models/player/chest/front.png
new file mode 100644 (file)
index 0000000..d44fd42
Binary files /dev/null and b/assets/textures/models/player/chest/front.png differ
diff --git a/assets/textures/models/player/chest/left.png b/assets/textures/models/player/chest/left.png
new file mode 100644 (file)
index 0000000..995ad5f
Binary files /dev/null and b/assets/textures/models/player/chest/left.png differ
diff --git a/assets/textures/models/player/chest/right.png b/assets/textures/models/player/chest/right.png
new file mode 100644 (file)
index 0000000..e48eb66
Binary files /dev/null and b/assets/textures/models/player/chest/right.png differ
diff --git a/assets/textures/models/player/chest/top.png b/assets/textures/models/player/chest/top.png
new file mode 100644 (file)
index 0000000..df84083
Binary files /dev/null and b/assets/textures/models/player/chest/top.png differ
diff --git a/assets/textures/models/player/head/back.png b/assets/textures/models/player/head/back.png
new file mode 100644 (file)
index 0000000..935a2b9
Binary files /dev/null and b/assets/textures/models/player/head/back.png differ
diff --git a/assets/textures/models/player/head/bottom.png b/assets/textures/models/player/head/bottom.png
new file mode 100644 (file)
index 0000000..1fdae43
Binary files /dev/null and b/assets/textures/models/player/head/bottom.png differ
diff --git a/assets/textures/models/player/head/front.png b/assets/textures/models/player/head/front.png
new file mode 100644 (file)
index 0000000..805fec0
Binary files /dev/null and b/assets/textures/models/player/head/front.png differ
diff --git a/assets/textures/models/player/head/left.png b/assets/textures/models/player/head/left.png
new file mode 100644 (file)
index 0000000..7dc2a81
Binary files /dev/null and b/assets/textures/models/player/head/left.png differ
diff --git a/assets/textures/models/player/head/right.png b/assets/textures/models/player/head/right.png
new file mode 100644 (file)
index 0000000..47436ba
Binary files /dev/null and b/assets/textures/models/player/head/right.png differ
diff --git a/assets/textures/models/player/head/top.png b/assets/textures/models/player/head/top.png
new file mode 100644 (file)
index 0000000..916ea2b
Binary files /dev/null and b/assets/textures/models/player/head/top.png differ
diff --git a/assets/textures/models/player/leg/back.png b/assets/textures/models/player/leg/back.png
new file mode 100644 (file)
index 0000000..48b93ce
Binary files /dev/null and b/assets/textures/models/player/leg/back.png differ
diff --git a/assets/textures/models/player/leg/bottom.png b/assets/textures/models/player/leg/bottom.png
new file mode 100644 (file)
index 0000000..0c942fb
Binary files /dev/null and b/assets/textures/models/player/leg/bottom.png differ
diff --git a/assets/textures/models/player/leg/front.png b/assets/textures/models/player/leg/front.png
new file mode 100644 (file)
index 0000000..13b1016
Binary files /dev/null and b/assets/textures/models/player/leg/front.png differ
diff --git a/assets/textures/models/player/leg/left.png b/assets/textures/models/player/leg/left.png
new file mode 100644 (file)
index 0000000..104c6e7
Binary files /dev/null and b/assets/textures/models/player/leg/left.png differ
diff --git a/assets/textures/models/player/leg/right.png b/assets/textures/models/player/leg/right.png
new file mode 100644 (file)
index 0000000..a97a13a
Binary files /dev/null and b/assets/textures/models/player/leg/right.png differ
diff --git a/assets/textures/models/player/leg/top.png b/assets/textures/models/player/leg/top.png
new file mode 100644 (file)
index 0000000..d575dc7
Binary files /dev/null and b/assets/textures/models/player/leg/top.png differ
diff --git a/assets/textures/needles.png b/assets/textures/needles.png
new file mode 100644 (file)
index 0000000..24e3ed4
Binary files /dev/null and b/assets/textures/needles.png differ
diff --git a/assets/textures/oak_leaves.png b/assets/textures/oak_leaves.png
new file mode 100644 (file)
index 0000000..a29369a
Binary files /dev/null and b/assets/textures/oak_leaves.png differ
diff --git a/assets/textures/oak_wood.png b/assets/textures/oak_wood.png
new file mode 100644 (file)
index 0000000..90af189
Binary files /dev/null and b/assets/textures/oak_wood.png differ
diff --git a/assets/textures/oak_wood_top.png b/assets/textures/oak_wood_top.png
new file mode 100644 (file)
index 0000000..cf8ed6f
Binary files /dev/null and b/assets/textures/oak_wood_top.png differ
diff --git a/assets/textures/palm_leaves.png b/assets/textures/palm_leaves.png
new file mode 100644 (file)
index 0000000..9d44925
Binary files /dev/null and b/assets/textures/palm_leaves.png differ
diff --git a/assets/textures/palm_wood.png b/assets/textures/palm_wood.png
new file mode 100644 (file)
index 0000000..5f0295d
Binary files /dev/null and b/assets/textures/palm_wood.png differ
diff --git a/assets/textures/palm_wood_top.png b/assets/textures/palm_wood_top.png
new file mode 100644 (file)
index 0000000..276ae1e
Binary files /dev/null and b/assets/textures/palm_wood_top.png differ
diff --git a/assets/textures/pine_leaves.png b/assets/textures/pine_leaves.png
new file mode 100644 (file)
index 0000000..24e3ed4
Binary files /dev/null and b/assets/textures/pine_leaves.png differ
diff --git a/assets/textures/pine_wood.png b/assets/textures/pine_wood.png
new file mode 100644 (file)
index 0000000..fae7da1
Binary files /dev/null and b/assets/textures/pine_wood.png differ
diff --git a/assets/textures/pine_wood_top.png b/assets/textures/pine_wood_top.png
new file mode 100644 (file)
index 0000000..276ae1e
Binary files /dev/null and b/assets/textures/pine_wood_top.png differ
diff --git a/assets/textures/player.png b/assets/textures/player.png
new file mode 100644 (file)
index 0000000..f403dc3
Binary files /dev/null and b/assets/textures/player.png differ
diff --git a/assets/textures/sand.png b/assets/textures/sand.png
new file mode 100644 (file)
index 0000000..3899f4b
Binary files /dev/null and b/assets/textures/sand.png differ
diff --git a/assets/textures/skybox/day/back.png b/assets/textures/skybox/day/back.png
new file mode 100644 (file)
index 0000000..6b98546
Binary files /dev/null and b/assets/textures/skybox/day/back.png differ
diff --git a/assets/textures/skybox/day/bottom.png b/assets/textures/skybox/day/bottom.png
new file mode 100644 (file)
index 0000000..ceaa6aa
Binary files /dev/null and b/assets/textures/skybox/day/bottom.png differ
diff --git a/assets/textures/skybox/day/front.png b/assets/textures/skybox/day/front.png
new file mode 100644 (file)
index 0000000..f62ee88
Binary files /dev/null and b/assets/textures/skybox/day/front.png differ
diff --git a/assets/textures/skybox/day/left.png b/assets/textures/skybox/day/left.png
new file mode 100644 (file)
index 0000000..558391a
Binary files /dev/null and b/assets/textures/skybox/day/left.png differ
diff --git a/assets/textures/skybox/day/right.png b/assets/textures/skybox/day/right.png
new file mode 100644 (file)
index 0000000..b1b7b9f
Binary files /dev/null and b/assets/textures/skybox/day/right.png differ
diff --git a/assets/textures/skybox/day/top.png b/assets/textures/skybox/day/top.png
new file mode 100644 (file)
index 0000000..45567ca
Binary files /dev/null and b/assets/textures/skybox/day/top.png differ
diff --git a/assets/textures/skybox/night/back.png b/assets/textures/skybox/night/back.png
new file mode 100644 (file)
index 0000000..0a0a862
Binary files /dev/null and b/assets/textures/skybox/night/back.png differ
diff --git a/assets/textures/skybox/night/bottom.png b/assets/textures/skybox/night/bottom.png
new file mode 100644 (file)
index 0000000..e51749a
Binary files /dev/null and b/assets/textures/skybox/night/bottom.png differ
diff --git a/assets/textures/skybox/night/front.png b/assets/textures/skybox/night/front.png
new file mode 100644 (file)
index 0000000..6ec46e1
Binary files /dev/null and b/assets/textures/skybox/night/front.png differ
diff --git a/assets/textures/skybox/night/left.png b/assets/textures/skybox/night/left.png
new file mode 100644 (file)
index 0000000..c04fb71
Binary files /dev/null and b/assets/textures/skybox/night/left.png differ
diff --git a/assets/textures/skybox/night/right.png b/assets/textures/skybox/night/right.png
new file mode 100644 (file)
index 0000000..60329f4
Binary files /dev/null and b/assets/textures/skybox/night/right.png differ
diff --git a/assets/textures/skybox/night/top.png b/assets/textures/skybox/night/top.png
new file mode 100644 (file)
index 0000000..2711dd1
Binary files /dev/null and b/assets/textures/skybox/night/top.png differ
diff --git a/assets/textures/snow.png b/assets/textures/snow.png
new file mode 100644 (file)
index 0000000..359335e
Binary files /dev/null and b/assets/textures/snow.png differ
diff --git a/assets/textures/stone.png b/assets/textures/stone.png
new file mode 100644 (file)
index 0000000..3af8ac9
Binary files /dev/null and b/assets/textures/stone.png differ
diff --git a/assets/textures/sun.png b/assets/textures/sun.png
new file mode 100644 (file)
index 0000000..fb3b88d
Binary files /dev/null and b/assets/textures/sun.png differ
diff --git a/assets/textures/unknown.png b/assets/textures/unknown.png
new file mode 100644 (file)
index 0000000..bbea82c
Binary files /dev/null and b/assets/textures/unknown.png differ
diff --git a/assets/textures/vulcano_stone.png b/assets/textures/vulcano_stone.png
new file mode 100644 (file)
index 0000000..c359713
Binary files /dev/null and b/assets/textures/vulcano_stone.png differ
diff --git a/assets/textures/water.png b/assets/textures/water.png
new file mode 100644 (file)
index 0000000..b9a66fd
Binary files /dev/null and b/assets/textures/water.png differ
diff --git a/assets/textures/water_nt.png b/assets/textures/water_nt.png
new file mode 100644 (file)
index 0000000..f457566
Binary files /dev/null and b/assets/textures/water_nt.png differ
diff --git a/build/debug.sh b/build/debug.sh
new file mode 100755 (executable)
index 0000000..4323a99
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+if ! make -j$(nproc); then
+       exit 1
+fi
+
+DEBUG_DIR=/tmp/dragonblocks_alpha_debug_$$/
+mkdir $DEBUG_DIR
+
+echo "singleplayer" > $DEBUG_DIR/name
+
+COMMON="set confirm off
+handle SIGTERM nostop print pass
+handle SIGPIPE nostop noprint pass
+set height 0
+set \$_exitcode=1
+define hook-stop
+    if \$_exitcode == 0
+        quit
+    end
+end
+"
+
+echo "$COMMON
+break gl_error
+run \"[::1]:4000\" < $DEBUG_DIR/name
+" > $DEBUG_DIR/client_script
+
+echo "$COMMON
+set print thread-events off
+run \"[::1]:4000\"
+" > $DEBUG_DIR/server_script
+
+alacritty -e bash -c "
+       echo \$\$ > $DEBUG_DIR/server_pid
+       exec gdb --command $DEBUG_DIR/server_script ./dragonblocks_server
+" &
+sleep 0.5
+
+gdb --command $DEBUG_DIR/client_script ./dragonblocks_client
+
+kill `cat $DEBUG_DIR/server_pid`
+
+rm -rf $DEBUG_DIR
diff --git a/build/debug_loop.sh b/build/debug_loop.sh
new file mode 100755 (executable)
index 0000000..3c6c460
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+COMMAND="./debug.sh"
+
+if [[ $1 == "terrain" ]]; then
+       COMMAND="./debug_terrain.sh"
+fi
+
+while true; do
+       if ! $COMMAND; then
+               read
+       fi
+done
index 84c7e7cb1e0a6ea4102ca785cca31a3e66f34a48..305d3f995280196f4c88146b03f09b94191e8cca 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 84c7e7cb1e0a6ea4102ca785cca31a3e66f34a48
+Subproject commit 305d3f995280196f4c88146b03f09b94191e8cca
index 9ab2148e1b8d03dab816bbba6209794663b31576..72fd472f45d9589269d7786877dff8d45586c006 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9ab2148e1b8d03dab816bbba6209794663b31576
+Subproject commit 72fd472f45d9589269d7786877dff8d45586c006
index 7d8cdeeb49fc6fa0b4b7ac9c3bb3e1fb27f4f0bf..ae5dd6c930ccef19ad313aa903f0528aa803ee80 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7d8cdeeb49fc6fa0b4b7ac9c3bb3e1fb27f4f0bf
+Subproject commit ae5dd6c930ccef19ad313aa903f0528aa803ee80
index 6c7eccf05405eacbb76281550cd69895089f9773..f24960eca3bb806fa72d8de2b9a761a889fdeee3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6c7eccf05405eacbb76281550cd69895089f9773
+Subproject commit f24960eca3bb806fa72d8de2b9a761a889fdeee3
diff --git a/deps/freetype b/deps/freetype
new file mode 160000 (submodule)
index 0000000..d59c7ce
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit d59c7ce1b970bfe38b3df161e9dd711b75392709
index 9d102be3fb622bcd3fab9f7feaafe2b1abf3980a..305c38b4595254706f103e0043ac2fd6e491d8ed 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9d102be3fb622bcd3fab9f7feaafe2b1abf3980a
+Subproject commit 305c38b4595254706f103e0043ac2fd6e491d8ed
diff --git a/deps/glew-cmake b/deps/glew-cmake
new file mode 160000 (submodule)
index 0000000..7c2b751
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 7c2b7514f64234756f7df051b9316f1e46f5a6e7
diff --git a/deps/glfw b/deps/glfw
new file mode 160000 (submodule)
index 0000000..4cb3687
--- /dev/null
+++ b/deps/glfw
@@ -0,0 +1 @@
+Subproject commit 4cb36872a5fe448c205d0b46f0e8c8b57530cfe0
index 9430e6e4e7fc09e8ca6a2fd5e3fcafa07818542e..2da54ed285c5da913c9fb11e0b0410becccb8a39 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 9430e6e4e7fc09e8ca6a2fd5e3fcafa07818542e
+Subproject commit 2da54ed285c5da913c9fb11e0b0410becccb8a39
index 78efd369ac89a1db0dee71e277bf5e74309ef9fe..2b584521c2657c8c8e8cb4a49ca80c2ffa0c3f96 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 78efd369ac89a1db0dee71e277bf5e74309ef9fe
+Subproject commit 2b584521c2657c8c8e8cb4a49ca80c2ffa0c3f96
index 2200835ac31adfa47f2baaa93f0a79a7c9a9007c..f506262076d602340500786703ac384d92683e26 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 2200835ac31adfa47f2baaa93f0a79a7c9a9007c
+Subproject commit f506262076d602340500786703ac384d92683e26
diff --git a/deps/sqlite3-cmake b/deps/sqlite3-cmake
new file mode 160000 (submodule)
index 0000000..a8200e0
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit a8200e0816fb742617347d3e1a43c35b5b2f424e
diff --git a/deps/stpcpy b/deps/stpcpy
new file mode 160000 (submodule)
index 0000000..c85c304
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c85c304ae7cb6867a732c4183c1d260f746bd73d
diff --git a/deps/zlib b/deps/zlib
new file mode 160000 (submodule)
index 0000000..4b4fbf4
--- /dev/null
+++ b/deps/zlib
@@ -0,0 +1 @@
+Subproject commit 4b4fbf4ee10310760f763bcb674775f0325b842a
diff --git a/fonts/Minecraftia.ttf b/fonts/Minecraftia.ttf
deleted file mode 100644 (file)
index 2cf2af4..0000000
Binary files a/fonts/Minecraftia.ttf and /dev/null differ
diff --git a/meshes/axe.gox b/meshes/axe.gox
deleted file mode 100644 (file)
index 08bb09a..0000000
Binary files a/meshes/axe.gox and /dev/null differ
diff --git a/meshes/axe.txt b/meshes/axe.txt
deleted file mode 100644 (file)
index 1e29a2a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-# Goxel 0.10.6
-# One line per voxel
-# X Y Z RRGGBB
-0 -1 9 a5a5a5
-0 -1 10 a0a0a0
-0 0 0 503612
-0 0 1 503612
-0 0 2 584120
-0 0 3 43351e
-0 0 4 503612
-0 0 5 503612
-0 0 6 4a3312
-0 0 7 5c421a
-0 3 7 a0a0a0
-0 4 7 9e9e9e
-0 0 8 5a380e
-0 2 8 9e9e9e
-0 3 8 a1a1a1
-0 4 8 a1a1a1
-0 0 9 a1a1a1
-1 0 9 a0a0a0
-0 1 9 9e9e9e
-0 2 9 9e9e9e
-0 3 9 a1a1a1
-0 4 9 9e9e9e
-0 0 10 989898
-1 0 10 a0a0a0
-0 1 10 a0a0a0
-0 2 10 9e9e9e
-0 3 10 9e9e9e
-0 4 10 9e9e9e
-0 0 11 5c421a
-0 2 11 a0a0a0
-0 3 11 9e9e9e
-0 4 11 a1a1a1
-0 3 12 9e9e9e
-0 4 12 9e9e9e
--1 0 9 a0a0a0
--1 0 10 a0a0a0
diff --git a/meshes/pickaxe.gox b/meshes/pickaxe.gox
deleted file mode 100644 (file)
index 95e9c21..0000000
Binary files a/meshes/pickaxe.gox and /dev/null differ
diff --git a/meshes/pickaxe.txt b/meshes/pickaxe.txt
deleted file mode 100644 (file)
index c14d78e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# Goxel 0.10.6
-# One line per voxel
-# X Y Z RRGGBB
-0 -4 7 a0a0a0
-0 -4 8 a0a0a0
-0 -3 8 999999
-0 -3 9 a0a0a0
-0 -2 9 a0a0a0
-0 -1 9 8b8b8b
-0 -2 10 a0a0a0
-0 -1 10 a9a9a9
-0 0 0 503612
-0 0 1 503612
-0 0 2 584120
-0 0 3 43351e
-0 0 4 503612
-0 0 5 503612
-0 0 6 4a3312
-0 0 7 5c421a
-0 4 7 999999
-0 0 8 5a380e
-0 3 8 999999
-0 4 8 a0a0a0
-0 0 9 a0a0a0
-0 1 9 a9a9a9
-0 2 9 a0a0a0
-0 3 9 a0a0a0
-0 0 10 a9a9a9
-0 1 10 8b8b8b
-0 2 10 a0a0a0
-0 0 11 a0a0a0
diff --git a/meshes/shovel.gox b/meshes/shovel.gox
deleted file mode 100644 (file)
index 76d6155..0000000
Binary files a/meshes/shovel.gox and /dev/null differ
diff --git a/meshes/shovel.txt b/meshes/shovel.txt
deleted file mode 100644 (file)
index 808bc2a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# Goxel 0.10.6
-# One line per voxel
-# X Y Z RRGGBB
-0 0 0 503612
-0 0 1 503612
-0 0 2 584120
-0 0 3 43351e
-0 0 4 503612
-0 0 5 503612
-0 0 6 4a3312
-0 0 7 5c421a
-0 0 8 5a380e
-0 0 9 959595
-1 0 9 a0a0a0
-0 0 10 959595
-1 0 10 959595
-0 0 11 7e7e7e
-1 0 11 a0a0a0
-0 0 12 a0a0a0
--1 0 9 7e7e7e
--1 0 10 959595
--1 0 11 959595
diff --git a/meshes/unknown.gox b/meshes/unknown.gox
deleted file mode 100644 (file)
index 61584af..0000000
Binary files a/meshes/unknown.gox and /dev/null differ
diff --git a/meshes/unknown.txt b/meshes/unknown.txt
deleted file mode 100644 (file)
index 78bbd97..0000000
+++ /dev/null
@@ -1,732 +0,0 @@
-# Goxel 0.10.6
-# One line per voxel
-# X Y Z RRGGBB
-0 0 0 920088
-1 0 0 920088
-2 0 0 920088
-3 0 0 920088
-4 0 0 920088
-5 0 0 920088
-6 0 0 920088
-7 0 0 920088
-8 0 0 920088
-0 1 0 920088
-1 1 0 c400bc
-2 1 0 c400bc
-3 1 0 c400bc
-4 1 0 c400bc
-5 1 0 c400bc
-6 1 0 c400bc
-7 1 0 c400bc
-8 1 0 920088
-0 2 0 920088
-1 2 0 c400bc
-2 2 0 c400bc
-3 2 0 cdd300
-4 2 0 cdd300
-5 2 0 cdd300
-6 2 0 c400bc
-7 2 0 c400bc
-8 2 0 920088
-0 3 0 920088
-1 3 0 c400bc
-2 3 0 cdd300
-3 3 0 c400bc
-4 3 0 c400bc
-5 3 0 c400bc
-6 3 0 cdd300
-7 3 0 c400bc
-8 3 0 920088
-0 4 0 920088
-1 4 0 c400bc
-2 4 0 c400bc
-3 4 0 c400bc
-4 4 0 cdd300
-5 4 0 cdd300
-6 4 0 c400bc
-7 4 0 c400bc
-8 4 0 920088
-0 5 0 920088
-1 5 0 c400bc
-2 5 0 c400bc
-3 5 0 c400bc
-4 5 0 c400bc
-5 5 0 c400bc
-6 5 0 c400bc
-7 5 0 c400bc
-8 5 0 920088
-0 6 0 920088
-1 6 0 c400bc
-2 6 0 c400bc
-3 6 0 c400bc
-4 6 0 cdd300
-5 6 0 c400bc
-6 6 0 c400bc
-7 6 0 c400bc
-8 6 0 920088
-0 7 0 920088
-1 7 0 c400bc
-2 7 0 c400bc
-3 7 0 c400bc
-4 7 0 c400bc
-5 7 0 c400bc
-6 7 0 c400bc
-7 7 0 c400bc
-8 7 0 920088
-0 8 0 920088
-1 8 0 920088
-2 8 0 920088
-3 8 0 920088
-4 8 0 920088
-5 8 0 920088
-6 8 0 920088
-7 8 0 920088
-8 8 0 920088
-0 0 1 920088
-1 0 1 c400bc
-2 0 1 c400bc
-3 0 1 c400bc
-4 0 1 c400bc
-5 0 1 c400bc
-6 0 1 c400bc
-7 0 1 c400bc
-8 0 1 920088
-0 1 1 c400bc
-1 1 1 ffffff
-2 1 1 ffffff
-3 1 1 ffffff
-4 1 1 ffffff
-5 1 1 ffffff
-6 1 1 ffffff
-7 1 1 ffffff
-8 1 1 c400bc
-0 2 1 c400bc
-1 2 1 ffffff
-2 2 1 ffffff
-3 2 1 ffffff
-4 2 1 ffffff
-5 2 1 ffffff
-6 2 1 ffffff
-7 2 1 ffffff
-8 2 1 c400bc
-0 3 1 c400bc
-1 3 1 ffffff
-2 3 1 ffffff
-3 3 1 ffffff
-4 3 1 ffffff
-5 3 1 ffffff
-6 3 1 ffffff
-7 3 1 ffffff
-8 3 1 c400bc
-0 4 1 c400bc
-1 4 1 ffffff
-2 4 1 ffffff
-3 4 1 ffffff
-4 4 1 ffffff
-5 4 1 ffffff
-6 4 1 ffffff
-7 4 1 ffffff
-8 4 1 c400bc
-0 5 1 c400bc
-1 5 1 ffffff
-2 5 1 ffffff
-3 5 1 ffffff
-4 5 1 ffffff
-5 5 1 ffffff
-6 5 1 ffffff
-7 5 1 ffffff
-8 5 1 c400bc
-0 6 1 c400bc
-1 6 1 ffffff
-2 6 1 ffffff
-3 6 1 ffffff
-4 6 1 ffffff
-5 6 1 ffffff
-6 6 1 ffffff
-7 6 1 ffffff
-8 6 1 c400bc
-0 7 1 c400bc
-1 7 1 ffffff
-2 7 1 ffffff
-3 7 1 ffffff
-4 7 1 ffffff
-5 7 1 ffffff
-6 7 1 ffffff
-7 7 1 ffffff
-8 7 1 c400bc
-0 8 1 920088
-1 8 1 c400bc
-2 8 1 c400bc
-3 8 1 c400bc
-4 8 1 c400bc
-5 8 1 c400bc
-6 8 1 c400bc
-7 8 1 c400bc
-8 8 1 920088
-0 0 2 920088
-1 0 2 c400bc
-2 0 2 c400bc
-3 0 2 c400bc
-4 0 2 cdd300
-5 0 2 c400bc
-6 0 2 c400bc
-7 0 2 c400bc
-8 0 2 920088
-0 1 2 c400bc
-1 1 2 ffffff
-2 1 2 ffffff
-3 1 2 ffffff
-4 1 2 ffffff
-5 1 2 ffffff
-6 1 2 ffffff
-7 1 2 ffffff
-8 1 2 c400bc
-0 2 2 c400bc
-1 2 2 ffffff
-2 2 2 ffffff
-3 2 2 ffffff
-4 2 2 ffffff
-5 2 2 ffffff
-6 2 2 ffffff
-7 2 2 ffffff
-8 2 2 c400bc
-0 3 2 c400bc
-1 3 2 ffffff
-2 3 2 ffffff
-3 3 2 ffffff
-4 3 2 ffffff
-5 3 2 ffffff
-6 3 2 ffffff
-7 3 2 ffffff
-8 3 2 c400bc
-0 4 2 cdd300
-1 4 2 ffffff
-2 4 2 ffffff
-3 4 2 ffffff
-4 4 2 ffffff
-5 4 2 ffffff
-6 4 2 ffffff
-7 4 2 ffffff
-8 4 2 cdd300
-0 5 2 c400bc
-1 5 2 ffffff
-2 5 2 ffffff
-3 5 2 ffffff
-4 5 2 ffffff
-5 5 2 ffffff
-6 5 2 ffffff
-7 5 2 ffffff
-8 5 2 c400bc
-0 6 2 c400bc
-1 6 2 ffffff
-2 6 2 ffffff
-3 6 2 ffffff
-4 6 2 ffffff
-5 6 2 ffffff
-6 6 2 ffffff
-7 6 2 ffffff
-8 6 2 c400bc
-0 7 2 c400bc
-1 7 2 ffffff
-2 7 2 ffffff
-3 7 2 ffffff
-4 7 2 ffffff
-5 7 2 ffffff
-6 7 2 ffffff
-7 7 2 ffffff
-8 7 2 c400bc
-0 8 2 920088
-1 8 2 c400bc
-2 8 2 c400bc
-3 8 2 c400bc
-4 8 2 cdd300
-5 8 2 c400bc
-6 8 2 c400bc
-7 8 2 c400bc
-8 8 2 920088
-0 0 3 920088
-1 0 3 c400bc
-2 0 3 c400bc
-3 0 3 c400bc
-4 0 3 c400bc
-5 0 3 c400bc
-6 0 3 c400bc
-7 0 3 c400bc
-8 0 3 920088
-0 1 3 c400bc
-1 1 3 ffffff
-2 1 3 c400bc
-3 1 3 c400bc
-4 1 3 ffffff
-5 1 3 ffffff
-6 1 3 ffffff
-7 1 3 ffffff
-8 1 3 c400bc
-0 2 3 c400bc
-1 2 3 c400bc
-2 2 3 c400bc
-3 2 3 ffffff
-4 2 3 ffffff
-5 2 3 ffffff
-6 2 3 ffffff
-7 2 3 ffffff
-8 2 3 c400bc
-0 3 3 c400bc
-1 3 3 ffffff
-2 3 3 ffffff
-3 3 3 ffffff
-4 3 3 ffffff
-5 3 3 ffffff
-6 3 3 ffffff
-7 3 3 ffffff
-8 3 3 c400bc
-0 4 3 c400bc
-1 4 3 ffffff
-2 4 3 ffffff
-3 4 3 ffffff
-4 4 3 ffffff
-5 4 3 ffffff
-6 4 3 ffffff
-7 4 3 ffffff
-8 4 3 c400bc
-0 5 3 c400bc
-1 5 3 ffffff
-2 5 3 ffffff
-3 5 3 ffffff
-4 5 3 ffffff
-5 5 3 ffffff
-6 5 3 ffffff
-7 5 3 ffffff
-8 5 3 c400bc
-0 6 3 c400bc
-1 6 3 ffffff
-2 6 3 ffffff
-3 6 3 ffffff
-4 6 3 ffffff
-5 6 3 ffffff
-6 6 3 ffffff
-7 6 3 ffffff
-8 6 3 c400bc
-0 7 3 c400bc
-1 7 3 ffffff
-2 7 3 ffffff
-3 7 3 ffffff
-4 7 3 ffffff
-5 7 3 ffffff
-6 7 3 ffffff
-7 7 3 ffffff
-8 7 3 c400bc
-0 8 3 920088
-1 8 3 c400bc
-2 8 3 c400bc
-3 8 3 c400bc
-4 8 3 c400bc
-5 8 3 c400bc
-6 8 3 c400bc
-7 8 3 c400bc
-8 8 3 920088
-0 0 4 920088
-1 0 4 c400bc
-2 0 4 c400bc
-3 0 4 c400bc
-4 0 4 cdd300
-5 0 4 cdd300
-6 0 4 c400bc
-7 0 4 c400bc
-8 0 4 920088
-0 1 4 c400bc
-1 1 4 c400bc
-2 1 4 c400bc
-3 1 4 ffffff
-4 1 4 ffffff
-5 1 4 ffffff
-6 1 4 ffffff
-7 1 4 ffffff
-8 1 4 c400bc
-0 2 4 c400bc
-1 2 4 c400bc
-2 2 4 ffffff
-3 2 4 ffffff
-4 2 4 ffffff
-5 2 4 ffffff
-6 2 4 ffffff
-7 2 4 ffffff
-8 2 4 c400bc
-0 3 4 cdd300
-1 3 4 ffffff
-2 3 4 ffffff
-3 3 4 ffffff
-4 3 4 ffffff
-5 3 4 ffffff
-6 3 4 ffffff
-7 3 4 ffffff
-8 3 4 c400bc
-0 4 4 cdd300
-1 4 4 ffffff
-2 4 4 ffffff
-3 4 4 ffffff
-4 4 4 ffffff
-5 4 4 ffffff
-6 4 4 ffffff
-7 4 4 ffffff
-8 4 4 cdd300
-0 5 4 c400bc
-1 5 4 ffffff
-2 5 4 ffffff
-3 5 4 ffffff
-4 5 4 ffffff
-5 5 4 ffffff
-6 5 4 ffffff
-7 5 4 ffffff
-8 5 4 cdd300
-0 6 4 c400bc
-1 6 4 ffffff
-2 6 4 ffffff
-3 6 4 ffffff
-4 6 4 ffffff
-5 6 4 ffffff
-6 6 4 ffffff
-7 6 4 ffffff
-8 6 4 c400bc
-0 7 4 c400bc
-1 7 4 ffffff
-2 7 4 ffffff
-3 7 4 ffffff
-4 7 4 ffffff
-5 7 4 ffffff
-6 7 4 ffffff
-7 7 4 ffffff
-8 7 4 c400bc
-0 8 4 920088
-1 8 4 c400bc
-2 8 4 c400bc
-3 8 4 cdd300
-4 8 4 cdd300
-5 8 4 c400bc
-6 8 4 c400bc
-7 8 4 c400bc
-8 8 4 920088
-0 0 5 920088
-1 0 5 c400bc
-2 0 5 cdd300
-3 0 5 c400bc
-4 0 5 c400bc
-5 0 5 c400bc
-6 0 5 cdd300
-7 0 5 c400bc
-8 0 5 920088
-0 1 5 c400bc
-1 1 5 c400bc
-2 1 5 ffffff
-3 1 5 ffffff
-4 1 5 ffffff
-5 1 5 ffffff
-6 1 5 ffffff
-7 1 5 ffffff
-8 1 5 c400bc
-0 2 5 cdd300
-1 2 5 ffffff
-2 2 5 ffffff
-3 2 5 ffffff
-4 2 5 ffffff
-5 2 5 ffffff
-6 2 5 ffffff
-7 2 5 ffffff
-8 2 5 cdd300
-0 3 5 c400bc
-1 3 5 ffffff
-2 3 5 ffffff
-3 3 5 ffffff
-4 3 5 ffffff
-5 3 5 ffffff
-6 3 5 ffffff
-7 3 5 ffffff
-8 3 5 c400bc
-0 4 5 c400bc
-1 4 5 ffffff
-2 4 5 ffffff
-3 4 5 ffffff
-4 4 5 ffffff
-5 4 5 ffffff
-6 4 5 ffffff
-7 4 5 ffffff
-8 4 5 c400bc
-0 5 5 c400bc
-1 5 5 ffffff
-2 5 5 ffffff
-3 5 5 ffffff
-4 5 5 ffffff
-5 5 5 ffffff
-6 5 5 ffffff
-7 5 5 ffffff
-8 5 5 c400bc
-0 6 5 cdd300
-1 6 5 ffffff
-2 6 5 ffffff
-3 6 5 ffffff
-4 6 5 ffffff
-5 6 5 ffffff
-6 6 5 ffffff
-7 6 5 ffffff
-8 6 5 cdd300
-0 7 5 c400bc
-1 7 5 ffffff
-2 7 5 ffffff
-3 7 5 ffffff
-4 7 5 ffffff
-5 7 5 ffffff
-6 7 5 ffffff
-7 7 5 ffffff
-8 7 5 c400bc
-0 8 5 920088
-1 8 5 c400bc
-2 8 5 cdd300
-3 8 5 c400bc
-4 8 5 c400bc
-5 8 5 c400bc
-6 8 5 cdd300
-7 8 5 c400bc
-8 8 5 920088
-0 0 6 920088
-1 0 6 c400bc
-2 0 6 c400bc
-3 0 6 cdd300
-4 0 6 cdd300
-5 0 6 cdd300
-6 0 6 c400bc
-7 0 6 c400bc
-8 0 6 920088
-0 1 6 c400bc
-1 1 6 c400bc
-2 1 6 c400bc
-3 1 6 c400bc
-4 1 6 ffffff
-5 1 6 ffffff
-6 1 6 c400bc
-7 1 6 c400bc
-8 1 6 c400bc
-0 2 6 c400bc
-1 2 6 c400bc
-2 2 6 ffffff
-3 2 6 ffffff
-4 2 6 ffffff
-5 2 6 ffffff
-6 2 6 ffffff
-7 2 6 ffffff
-8 2 6 c400bc
-0 3 6 cdd300
-1 3 6 ffffff
-2 3 6 ffffff
-3 3 6 ffffff
-4 3 6 ffffff
-5 3 6 ffffff
-6 3 6 ffffff
-7 3 6 ffffff
-8 3 6 cdd300
-0 4 6 cdd300
-1 4 6 ffffff
-2 4 6 ffffff
-3 4 6 ffffff
-4 4 6 ffffff
-5 4 6 ffffff
-6 4 6 ffffff
-7 4 6 ffffff
-8 4 6 cdd300
-0 5 6 cdd300
-1 5 6 ffffff
-2 5 6 ffffff
-3 5 6 ffffff
-4 5 6 ffffff
-5 5 6 ffffff
-6 5 6 ffffff
-7 5 6 ffffff
-8 5 6 cdd300
-0 6 6 c400bc
-1 6 6 ffffff
-2 6 6 ffffff
-3 6 6 ffffff
-4 6 6 ffffff
-5 6 6 ffffff
-6 6 6 ffffff
-7 6 6 ffffff
-8 6 6 c400bc
-0 7 6 c400bc
-1 7 6 ffffff
-2 7 6 ffffff
-3 7 6 ffffff
-4 7 6 ffffff
-5 7 6 ffffff
-6 7 6 ffffff
-7 7 6 ffffff
-8 7 6 c400bc
-0 8 6 920088
-1 8 6 c400bc
-2 8 6 c400bc
-3 8 6 cdd300
-4 8 6 cdd300
-5 8 6 cdd300
-6 8 6 c400bc
-7 8 6 c400bc
-8 8 6 920088
-0 0 7 920088
-1 0 7 c400bc
-2 0 7 c400bc
-3 0 7 c400bc
-4 0 7 c400bc
-5 0 7 c400bc
-6 0 7 c400bc
-7 0 7 c400bc
-8 0 7 920088
-0 1 7 c400bc
-1 1 7 ffffff
-2 1 7 c400bc
-3 1 7 ffffff
-4 1 7 ffffff
-5 1 7 ffffff
-6 1 7 ffffff
-7 1 7 c400bc
-8 1 7 c400bc
-0 2 7 c400bc
-1 2 7 c400bc
-2 2 7 c400bc
-3 2 7 c400bc
-4 2 7 ffffff
-5 2 7 c400bc
-6 2 7 c400bc
-7 2 7 c400bc
-8 2 7 c400bc
-0 3 7 c400bc
-1 3 7 c400bc
-2 3 7 ffffff
-3 3 7 ffffff
-4 3 7 c400bc
-5 3 7 c400bc
-6 3 7 c400bc
-7 3 7 ffffff
-8 3 7 c400bc
-0 4 7 c400bc
-1 4 7 ffffff
-2 4 7 ffffff
-3 4 7 ffffff
-4 4 7 ffffff
-5 4 7 ffffff
-6 4 7 ffffff
-7 4 7 ffffff
-8 4 7 c400bc
-0 5 7 c400bc
-1 5 7 ffffff
-2 5 7 ffffff
-3 5 7 ffffff
-4 5 7 ffffff
-5 5 7 ffffff
-6 5 7 ffffff
-7 5 7 ffffff
-8 5 7 c400bc
-0 6 7 c400bc
-1 6 7 ffffff
-2 6 7 ffffff
-3 6 7 ffffff
-4 6 7 ffffff
-5 6 7 ffffff
-6 6 7 ffffff
-7 6 7 ffffff
-8 6 7 c400bc
-0 7 7 c400bc
-1 7 7 ffffff
-2 7 7 ffffff
-3 7 7 ffffff
-4 7 7 ffffff
-5 7 7 ffffff
-6 7 7 ffffff
-7 7 7 ffffff
-8 7 7 c400bc
-0 8 7 920088
-1 8 7 c400bc
-2 8 7 c400bc
-3 8 7 c400bc
-4 8 7 c400bc
-5 8 7 c400bc
-6 8 7 c400bc
-7 8 7 c400bc
-8 8 7 920088
-0 0 8 920088
-1 0 8 920088
-2 0 8 920088
-3 0 8 920088
-4 0 8 920088
-5 0 8 920088
-6 0 8 920088
-7 0 8 920088
-8 0 8 920088
-0 1 8 920088
-1 1 8 c400bc
-2 1 8 c400bc
-3 1 8 c400bc
-4 1 8 c400bc
-5 1 8 c400bc
-6 1 8 c400bc
-7 1 8 c400bc
-8 1 8 920088
-0 2 8 920088
-1 2 8 c400bc
-2 2 8 c400bc
-3 2 8 c400bc
-4 2 8 cdd300
-5 2 8 c400bc
-6 2 8 c400bc
-7 2 8 c400bc
-8 2 8 920088
-0 3 8 920088
-1 3 8 c400bc
-2 3 8 c400bc
-3 3 8 c400bc
-4 3 8 c400bc
-5 3 8 c400bc
-6 3 8 c400bc
-7 3 8 c400bc
-8 3 8 920088
-0 4 8 920088
-1 4 8 c400bc
-2 4 8 c400bc
-3 4 8 c400bc
-4 4 8 cdd300
-5 4 8 cdd300
-6 4 8 c400bc
-7 4 8 c400bc
-8 4 8 920088
-0 5 8 920088
-1 5 8 c400bc
-2 5 8 cdd300
-3 5 8 c400bc
-4 5 8 c400bc
-5 5 8 c400bc
-6 5 8 cdd300
-7 5 8 c400bc
-8 5 8 920088
-0 6 8 920088
-1 6 8 c400bc
-2 6 8 c400bc
-3 6 8 cdd300
-4 6 8 cdd300
-5 6 8 cdd300
-6 6 8 c400bc
-7 6 8 c400bc
-8 6 8 920088
-0 7 8 920088
-1 7 8 c400bc
-2 7 8 c400bc
-3 7 8 c400bc
-4 7 8 c400bc
-5 7 8 c400bc
-6 7 8 c400bc
-7 7 8 c400bc
-8 7 8 920088
-0 8 8 920088
-1 8 8 920088
-2 8 8 920088
-3 8 8 920088
-4 8 8 920088
-5 8 8 920088
-6 8 8 920088
-7 8 8 920088
-8 8 8 920088
diff --git a/models/player.txt b/models/player.txt
deleted file mode 100644 (file)
index ec997b8..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-name nametag pos 0 2 0
-name neck pos 0 1.35 0
-       name head pos 0 0.225 0 scale 0.45 0.45 0.45 cube head
-               name eyes pos 0 0 +0.5
-name chest pos 0 1.0125 0 scale 0.48 0.675 0.225 cube chest
-name arm_left pos +0.36 1.35 0
-       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube arm
-       name hand pos 0 -0.585 0 scale 0.0625 0.0625 0.0625 rot 90 0 0
-name arm_right pos -0.36 1.35 0 scale -1 1 1 clockwise
-       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube arm
-       name hand pos 0 -0.585 0 scale 0.0625 0.0625 0.0625 rot 90 0 0
-name leg_left pos +0.12 0.675 0
-       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube leg
-name leg_right pos -0.12 0.675 0 scale -1 1 1 clockwise
-       pos 0 -0.3375 0 scale 0.24 0.675 0.225 cube leg
diff --git a/schematics/spawn_hut.gox b/schematics/spawn_hut.gox
deleted file mode 100644 (file)
index 7387575..0000000
Binary files a/schematics/spawn_hut.gox and /dev/null differ
diff --git a/schematics/spawn_hut.txt b/schematics/spawn_hut.txt
deleted file mode 100644 (file)
index 5e33f2d..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-# Goxel 0.10.6
-# One line per voxel
-# X Y Z RRGGBB
-0 -3 0 7d5435
-1 -3 0 7d5435
-2 -3 0 7d5435
-3 -3 0 7d5435
-4 -3 0 7d5435
-0 -2 0 7d5435
-1 -2 0 7d5435
-2 -2 0 7d5435
-3 -2 0 7d5435
-4 -2 0 7d5435
-0 -1 0 7d5435
-1 -1 0 7d5435
-2 -1 0 7d5435
-3 -1 0 7d5435
-4 -1 0 7d5435
-0 -3 1 7d5435
-1 -3 1 7d5435
-2 -3 1 7d5435
-3 -3 1 7d5435
-4 -3 1 7d5435
-4 -2 1 7d5435
-4 -1 1 7d5435
-0 -3 2 7d5435
-3 -3 2 7d5435
-4 -3 2 7d5435
-4 -2 2 7d5435
-4 -1 2 7d5435
-0 -3 3 7d5435
-3 -3 3 7d5435
-4 -3 3 7d5435
-4 -2 3 7d5435
-4 -1 3 7d5435
-0 -3 4 7d5435
-1 -3 4 7d5435
-2 -3 4 7d5435
-3 -3 4 7d5435
-4 -3 4 7d5435
-4 -2 4 7d5435
-4 -1 4 7d5435
-0 -4 5 503728
-1 -4 5 503728
-2 -4 5 503728
-3 -4 5 503728
-4 -4 5 503728
-5 -4 5 503728
-0 -3 5 503728
-1 -3 5 503728
-2 -3 5 503728
-3 -3 5 503728
-4 -3 5 503728
-0 -2 5 503728
-1 -2 5 503728
-2 -2 5 503728
-3 -2 5 503728
-4 -2 5 7d5435
-0 -1 5 503728
-1 -1 5 503728
-2 -1 5 503728
-3 -1 5 503728
-4 -1 5 7d5435
-0 -3 6 503728
-1 -3 6 503728
-2 -3 6 503728
-3 -3 6 503728
-4 -3 6 503728
-5 -3 6 503728
-0 -2 6 503728
-1 -2 6 503728
-2 -2 6 503728
-3 -2 6 503728
-4 -2 6 503728
-4 -1 6 7d5435
-0 -2 7 503728
-1 -2 7 503728
-2 -2 7 503728
-3 -2 7 503728
-4 -2 7 503728
-5 -2 7 503728
-0 -1 7 503728
-1 -1 7 503728
-2 -1 7 503728
-3 -1 7 503728
-4 -1 7 503728
-0 -1 8 503728
-1 -1 8 503728
-2 -1 8 503728
-3 -1 8 503728
-4 -1 8 503728
-5 -1 8 503728
--5 -3 0 7d5435
--4 -3 0 7d5435
--3 -3 0 7d5435
--2 -3 0 7d5435
--1 -3 0 7d5435
--5 -2 0 7d5435
--4 -2 0 7d5435
--3 -2 0 7d5435
--2 -2 0 7d5435
--1 -2 0 7d5435
--5 -1 0 7d5435
--4 -1 0 7d5435
--3 -1 0 7d5435
--2 -1 0 7d5435
--1 -1 0 7d5435
--5 -3 1 7d5435
--4 -3 1 7d5435
--3 -3 1 7d5435
--2 -3 1 7d5435
--1 -3 1 7d5435
--5 -2 1 7d5435
--5 -1 1 7d5435
--5 -3 2 7d5435
--4 -3 2 7d5435
--1 -3 2 7d5435
--5 -3 3 7d5435
--4 -3 3 7d5435
--1 -3 3 7d5435
--5 -3 4 7d5435
--4 -3 4 7d5435
--3 -3 4 7d5435
--2 -3 4 7d5435
--1 -3 4 7d5435
--5 -2 4 7d5435
--5 -1 4 7d5435
--6 -4 5 503728
--5 -4 5 503728
--4 -4 5 503728
--3 -4 5 503728
--2 -4 5 503728
--1 -4 5 503728
--5 -3 5 503728
--4 -3 5 503728
--3 -3 5 503728
--2 -3 5 503728
--1 -3 5 503728
--5 -2 5 7d5435
--4 -2 5 503728
--3 -2 5 503728
--2 -2 5 503728
--1 -2 5 503728
--5 -1 5 7d5435
--4 -1 5 503728
--3 -1 5 503728
--2 -1 5 503728
--1 -1 5 503728
--6 -3 6 503728
--5 -3 6 503728
--4 -3 6 503728
--3 -3 6 503728
--2 -3 6 503728
--1 -3 6 503728
--5 -2 6 503728
--4 -2 6 503728
--3 -2 6 503728
--2 -2 6 503728
--1 -2 6 503728
--5 -1 6 7d5435
--6 -2 7 503728
--5 -2 7 503728
--4 -2 7 503728
--3 -2 7 503728
--2 -2 7 503728
--1 -2 7 503728
--5 -1 7 503728
--4 -1 7 503728
--3 -1 7 503728
--2 -1 7 503728
--1 -1 7 503728
--6 -1 8 503728
--5 -1 8 503728
--4 -1 8 503728
--3 -1 8 503728
--2 -1 8 503728
--1 -1 8 503728
-0 0 0 7d5435
-1 0 0 7d5435
-2 0 0 7d5435
-3 0 0 7d5435
-4 0 0 7d5435
-0 1 0 7d5435
-1 1 0 7d5435
-2 1 0 7d5435
-3 1 0 7d5435
-4 1 0 7d5435
-0 2 0 7d5435
-1 2 0 7d5435
-2 2 0 7d5435
-3 2 0 7d5435
-4 2 0 7d5435
-0 3 0 7d5435
-1 3 0 7d5435
-2 3 0 7d5435
-3 3 0 7d5435
-4 3 0 7d5435
-0 4 0 7d5435
-1 4 0 7d5435
-2 4 0 7d5435
-3 4 0 7d5435
-4 4 0 7d5435
-4 2 1 7d5435
-4 3 1 7d5435
-0 4 1 7d5435
-1 4 1 7d5435
-2 4 1 7d5435
-3 4 1 7d5435
-4 4 1 7d5435
-4 2 2 7d5435
-4 3 2 7d5435
-1 4 2 7d5435
-4 4 2 7d5435
-4 2 3 7d5435
-4 3 3 7d5435
-1 4 3 7d5435
-4 4 3 7d5435
-4 0 4 7d5435
-4 1 4 7d5435
-4 2 4 7d5435
-4 3 4 7d5435
-0 4 4 7d5435
-1 4 4 7d5435
-2 4 4 7d5435
-3 4 4 7d5435
-4 4 4 7d5435
-0 0 5 503728
-1 0 5 503728
-2 0 5 503728
-3 0 5 503728
-4 0 5 7d5435
-0 1 5 503728
-1 1 5 503728
-2 1 5 503728
-3 1 5 503728
-4 1 5 7d5435
-0 2 5 503728
-1 2 5 503728
-2 2 5 503728
-3 2 5 503728
-4 2 5 7d5435
-0 3 5 503728
-1 3 5 503728
-2 3 5 503728
-3 3 5 503728
-4 3 5 7d5435
-0 4 5 503728
-1 4 5 503728
-2 4 5 503728
-3 4 5 503728
-4 4 5 503728
-0 5 5 503728
-1 5 5 503728
-2 5 5 503728
-3 5 5 503728
-4 5 5 503728
-5 5 5 503728
-4 0 6 7d5435
-4 1 6 7d5435
-4 2 6 7d5435
-0 3 6 503728
-1 3 6 503728
-2 3 6 503728
-3 3 6 503728
-4 3 6 503728
-0 4 6 503728
-1 4 6 503728
-2 4 6 503728
-3 4 6 503728
-4 4 6 503728
-5 4 6 503728
-4 0 7 503728
-4 1 7 503728
-0 2 7 503728
-1 2 7 503728
-2 2 7 503728
-3 2 7 503728
-4 2 7 503728
-0 3 7 503728
-1 3 7 503728
-2 3 7 503728
-3 3 7 503728
-4 3 7 503728
-5 3 7 503728
-0 0 8 503728
-1 0 8 503728
-2 0 8 503728
-3 0 8 503728
-4 0 8 503728
-5 0 8 503728
-0 1 8 503728
-1 1 8 503728
-2 1 8 503728
-3 1 8 503728
-4 1 8 503728
-5 1 8 503728
-0 2 8 503728
-1 2 8 503728
-2 2 8 503728
-3 2 8 503728
-4 2 8 503728
-5 2 8 503728
--5 0 0 7d5435
--4 0 0 7d5435
--3 0 0 7d5435
--2 0 0 7d5435
--1 0 0 7d5435
--5 1 0 7d5435
--4 1 0 7d5435
--3 1 0 7d5435
--2 1 0 7d5435
--1 1 0 7d5435
--5 2 0 7d5435
--4 2 0 7d5435
--3 2 0 7d5435
--2 2 0 7d5435
--1 2 0 7d5435
--5 3 0 7d5435
--4 3 0 7d5435
--3 3 0 7d5435
--2 3 0 7d5435
--1 3 0 7d5435
--5 4 0 7d5435
--4 4 0 7d5435
--3 4 0 7d5435
--2 4 0 7d5435
--1 4 0 7d5435
--5 0 1 7d5435
--5 1 1 7d5435
--5 2 1 7d5435
--5 3 1 7d5435
--5 4 1 7d5435
--4 4 1 7d5435
--3 4 1 7d5435
--2 4 1 7d5435
--1 4 1 7d5435
--5 1 2 7d5435
--5 2 2 7d5435
--5 4 2 7d5435
--3 4 2 7d5435
--5 1 3 7d5435
--5 2 3 7d5435
--5 4 3 7d5435
--3 4 3 7d5435
--5 0 4 7d5435
--5 1 4 7d5435
--5 2 4 7d5435
--5 3 4 7d5435
--5 4 4 7d5435
--4 4 4 7d5435
--3 4 4 7d5435
--2 4 4 7d5435
--1 4 4 7d5435
--5 0 5 7d5435
--4 0 5 503728
--3 0 5 503728
--2 0 5 503728
--1 0 5 503728
--5 1 5 7d5435
--4 1 5 503728
--3 1 5 503728
--2 1 5 503728
--1 1 5 503728
--5 2 5 7d5435
--4 2 5 503728
--3 2 5 503728
--2 2 5 503728
--1 2 5 503728
--5 3 5 7d5435
--4 3 5 503728
--3 3 5 503728
--2 3 5 503728
--1 3 5 503728
--5 4 5 503728
--4 4 5 503728
--3 4 5 503728
--2 4 5 503728
--1 4 5 503728
--6 5 5 503728
--5 5 5 503728
--4 5 5 503728
--3 5 5 503728
--2 5 5 503728
--1 5 5 503728
--5 0 6 7d5435
--5 1 6 7d5435
--5 2 6 7d5435
--5 3 6 503728
--4 3 6 503728
--3 3 6 503728
--2 3 6 503728
--1 3 6 503728
--6 4 6 503728
--5 4 6 503728
--4 4 6 503728
--3 4 6 503728
--2 4 6 503728
--1 4 6 503728
--5 0 7 503728
--5 1 7 503728
--5 2 7 503728
--4 2 7 503728
--3 2 7 503728
--2 2 7 503728
--1 2 7 503728
--6 3 7 503728
--5 3 7 503728
--4 3 7 503728
--3 3 7 503728
--2 3 7 503728
--1 3 7 503728
--6 0 8 503728
--5 0 8 503728
--4 0 8 503728
--3 0 8 503728
--2 0 8 503728
--1 0 8 503728
--6 1 8 503728
--5 1 8 503728
--4 1 8 503728
--3 1 8 503728
--2 1 8 503728
--1 1 8 503728
--6 2 8 503728
--5 2 8 503728
--4 2 8 503728
--3 2 8 503728
--2 2 8 503728
--1 2 8 503728
diff --git a/shaders/3d/entity/fragment.glsl b/shaders/3d/entity/fragment.glsl
deleted file mode 100755 (executable)
index d74e86a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-in vec3 fragmentPosition;
-in vec3 fragmentTextureCoordinates;
-in float fragmentLight;
-
-out vec4 outColor;
-
-uniform vec3 fogColor;
-uniform vec3 cameraPos;
-uniform samplerCube texture0;
-
-void main()
-{
-       outColor = texture(texture0, fragmentTextureCoordinates) * vec4(vec3(fragmentLight), 1.0);
-       outColor.rgb = mix(outColor.rgb, fogColor, clamp(length(fragmentPosition - cameraPos) / VIEW_DISTANCE, 0.0, 1.0));
-
-       if (outColor.a == 0.0)
-               discard;
-}
diff --git a/shaders/3d/entity/vertex.glsl b/shaders/3d/entity/vertex.glsl
deleted file mode 100755 (executable)
index 1490381..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-layout(location = 0) in vec3 vertexPosition;
-layout(location = 1) in vec3 vertexNormal;
-
-out vec3 fragmentPosition;
-out vec3 fragmentTextureCoordinates;
-out float fragmentLight;
-
-uniform mat4 model;
-uniform mat4 VP;
-uniform float daylight;
-uniform float ambientLight;
-uniform vec3 lightDir;
-uniform float depthOffset;
-
-void main()
-{
-       vec4 worldSpace = model * vec4(vertexPosition, 1.0);
-       gl_Position = VP * worldSpace;
-       if (gl_Position.z > -1.0)
-               gl_Position.z = max(-1.0, gl_Position.z - depthOffset);
-
-       fragmentPosition = worldSpace.xyz;
-       fragmentTextureCoordinates = vertexPosition;
-
-       mat3 normalMatrix = transpose(inverse(mat3(model)));
-       vec3 normal = normalize(normalMatrix * vertexNormal);
-       fragmentLight = ambientLight + 0.3 * daylight * clamp(dot(normal, normalize(lightDir)), 0.0, 1.0);
-}
diff --git a/shaders/3d/item/fragment.glsl b/shaders/3d/item/fragment.glsl
deleted file mode 100755 (executable)
index 102b9a5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-in vec3 fragmentPosition;
-in vec3 fragmentColor;
-
-out vec4 outColor;
-
-uniform vec3 fogColor;
-uniform vec3 cameraPos;
-
-void main()
-{
-       outColor = vec4(fragmentColor, 1.0);
-       outColor.rgb = mix(outColor.rgb, fogColor, clamp(length(fragmentPosition - cameraPos) / VIEW_DISTANCE, 0.0, 1.0));
-
-       if (outColor.a == 0.0)
-               discard;
-}
diff --git a/shaders/3d/item/vertex.glsl b/shaders/3d/item/vertex.glsl
deleted file mode 100755 (executable)
index 897610c..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-layout(location = 0) in vec3 vertexPosition;
-layout(location = 1) in vec3 vertexNormal;
-layout(location = 2) in vec3 vertexColor;
-
-out vec3 fragmentPosition;
-out vec3 fragmentColor;
-
-uniform mat4 model;
-uniform mat4 VP;
-uniform float daylight;
-uniform float ambientLight;
-uniform vec3 lightDir;
-uniform float depthOffset;
-
-void main()
-{
-       vec4 worldSpace = model * vec4(vertexPosition, 1.0);
-       gl_Position = VP * worldSpace;
-       if (gl_Position.z > -1.0)
-               gl_Position.z = max(-1.0, gl_Position.z - depthOffset);
-
-       fragmentPosition = worldSpace.xyz;
-       fragmentColor = vertexColor;
-
-       mat3 normalMatrix = transpose(inverse(mat3(model)));
-       vec3 normal = normalize(normalMatrix * vertexNormal);
-       fragmentColor *= ambientLight + 0.3 * daylight * clamp(dot(normal, normalize(lightDir)), 0.0, 1.0);
-}
diff --git a/shaders/3d/selection/fragment.glsl b/shaders/3d/selection/fragment.glsl
deleted file mode 100755 (executable)
index b591cd7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-out vec4 outColor;
-
-uniform vec3 color;
-
-void main()
-{
-       outColor = vec4(color, 0.1);
-}
diff --git a/shaders/3d/selection/vertex.glsl b/shaders/3d/selection/vertex.glsl
deleted file mode 100755 (executable)
index 65dc0d2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-layout(location = 0) in vec3 vertexPosition;
-
-uniform mat4 MVP;
-
-void main()
-{
-       gl_Position = MVP * vec4(vertexPosition, 1.0);
-}
diff --git a/shaders/3d/terrain/fragment.glsl b/shaders/3d/terrain/fragment.glsl
deleted file mode 100755 (executable)
index 37bc567..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-in vec3 fragmentPosition;
-in vec2 fragmentTextureCoordinates;
-in float fragmentTextureIndex;
-in vec3 fragmentColor;
-
-out vec4 outColor;
-
-uniform vec3 fogColor;
-uniform vec3 cameraPos;
-uniform sampler2D textures[MAX_TEXTURE_UNITS];
-
-void main()
-{
-       outColor = texture(textures[int(fragmentTextureIndex + 0.5)], fragmentTextureCoordinates) * vec4(fragmentColor, 1.0);
-       outColor.rgb = mix(outColor.rgb, fogColor, clamp(length(fragmentPosition - cameraPos) / VIEW_DISTANCE, 0.0, 1.0));
-
-       if (outColor.a == 0.0)
-               discard;
-}
diff --git a/shaders/3d/terrain/vertex.glsl b/shaders/3d/terrain/vertex.glsl
deleted file mode 100755 (executable)
index 2068cdc..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-layout(location = 0) in vec3 vertexPosition;
-layout(location = 1) in vec3 vertexNormal;
-layout(location = 2) in vec2 vertexTextureCoordinates;
-layout(location = 3) in float vertexTextureIndex;
-layout(location = 4) in vec3 vertexColor;
-
-out vec3 fragmentPosition;
-out vec2 fragmentTextureCoordinates;
-out float fragmentTextureIndex;
-out vec3 fragmentColor;
-
-uniform mat4 model;
-uniform mat4 VP;
-uniform float daylight;
-uniform float ambientLight;
-uniform vec3 lightDir;
-
-void main()
-{
-       vec4 worldSpace = model * vec4(vertexPosition, 1.0);
-       gl_Position = VP * worldSpace;
-
-       fragmentPosition = worldSpace.xyz;
-       fragmentTextureCoordinates = vertexTextureCoordinates;
-       fragmentTextureIndex = vertexTextureIndex;
-       fragmentColor = vertexColor;
-
-       fragmentColor *= ambientLight + 0.3 * daylight * clamp(dot(normalize(vertexNormal), normalize(lightDir)), 0.0, 1.0);
-}
diff --git a/shaders/gui/background/fragment.glsl b/shaders/gui/background/fragment.glsl
deleted file mode 100755 (executable)
index 5bd15e3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-out vec4 outColor;
-
-uniform vec4 color;
-
-void main()
-{
-       outColor = color;
-}
diff --git a/shaders/gui/background/vertex.glsl b/shaders/gui/background/vertex.glsl
deleted file mode 100755 (executable)
index 5815511..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-layout(location = 0) in vec2 vertexPosition;
-
-uniform mat4 model;
-uniform mat4 projection;
-
-void main()
-{
-       gl_Position = projection * model * vec4(vertexPosition, 0.0, 1.0);
-}
diff --git a/shaders/gui/font/fragment.glsl b/shaders/gui/font/fragment.glsl
deleted file mode 100755 (executable)
index 883a012..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-in vec2 fragmentTextureCoordinates;
-
-out vec4 outColor;
-
-uniform sampler2D texture0;
-uniform vec4 color;
-
-void main()
-{
-       outColor = vec4(1.0, 1.0, 1.0, texture(texture0, fragmentTextureCoordinates).r) * color;
-}
diff --git a/shaders/gui/font/vertex.glsl b/shaders/gui/font/vertex.glsl
deleted file mode 100644 (file)
index 50bcd6e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-layout(location = 0) in vec2 vertexPosition;
-layout(location = 1) in vec2 vertexTextureCoordinates;
-
-out vec2 fragmentTextureCoordinates;
-
-uniform mat4 model;
-uniform mat4 projection;
-
-void main()
-{
-       gl_Position = projection * model * vec4(vertexPosition, 0.0, 1.0);
-       fragmentTextureCoordinates = vertexTextureCoordinates;
-}
diff --git a/shaders/gui/image/fragment.glsl b/shaders/gui/image/fragment.glsl
deleted file mode 100755 (executable)
index bc8e428..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-in vec2 fragmentTextureCoordinates;
-
-out vec4 outColor;
-
-uniform sampler2D texture0;
-
-void main()
-{
-       outColor = texture(texture0, fragmentTextureCoordinates);
-}
diff --git a/shaders/gui/image/vertex.glsl b/shaders/gui/image/vertex.glsl
deleted file mode 100755 (executable)
index 50bcd6e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-layout(location = 0) in vec2 vertexPosition;
-layout(location = 1) in vec2 vertexTextureCoordinates;
-
-out vec2 fragmentTextureCoordinates;
-
-uniform mat4 model;
-uniform mat4 projection;
-
-void main()
-{
-       gl_Position = projection * model * vec4(vertexPosition, 0.0, 1.0);
-       fragmentTextureCoordinates = vertexTextureCoordinates;
-}
diff --git a/shaders/sky/clouds/fragment.glsl b/shaders/sky/clouds/fragment.glsl
deleted file mode 100755 (executable)
index 32fc25b..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-in vec3 fragmentTextureCoordinates;
-
-out vec4 outColor;
-
-uniform float daylight;
-uniform samplerCube texture0;
-
-float reverseMix(float value, float min, float max)
-{
-       return clamp((value - min) / (max - min), 0.0, 1.0);
-}
-
-float strengthen(float value, float exponent, float max)
-{
-       return min((1.0 - pow(1.0 - value, exponent)) / (1.0 - pow(1.0 - max, exponent)), 1.0);
-}
-
-void main()
-{
-       float height = normalize(fragmentTextureCoordinates).y;
-
-       vec4 topColor = texture(texture0, vec3(0.0, 1.0, 0.0));
-       vec4 bottomColor = texture(texture0, vec3(1.0, 0.11, 0.5));
-       vec4 expectedColor = mix(bottomColor, topColor, height);
-
-       vec4 dayColor = texture(texture0, fragmentTextureCoordinates);
-
-       float cloudFactor = reverseMix(length(dayColor.rg - expectedColor.rg), 0.15, length(vec2(1.0)));
-
-       outColor = vec4(dayColor.rgb, mix(cloudFactor, strengthen(cloudFactor, 8.0, 0.1), daylight));
-}
diff --git a/shaders/sky/clouds/vertex.glsl b/shaders/sky/clouds/vertex.glsl
deleted file mode 100755 (executable)
index 1b361b7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layout(location = 0) in vec3 vertexPosition;
-
-out vec3 fragmentTextureCoordinates;
-
-uniform mat4 VP;
-
-void main()
-{
-       gl_Position = VP * vec4(vertexPosition, 1.0);
-       gl_Position.z = gl_Position.w;
-       fragmentTextureCoordinates = vertexPosition;
-}
diff --git a/shaders/sky/skybox/fragment.glsl b/shaders/sky/skybox/fragment.glsl
deleted file mode 100755 (executable)
index e6c61b4..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-in vec3 fragmentTextureCoordinates;
-
-out vec4 outColor;
-
-uniform float daylight;
-uniform samplerCube textures[2];
-
-void main()
-{
-       vec4 topColor = texture(textures[0], vec3(0.0, 1.0, 0.0));
-       vec4 bottomColor = texture(textures[0], vec3(1.0, 0.11, 0.5));
-
-       vec4 dayColor = mix(bottomColor, topColor, normalize(fragmentTextureCoordinates).y);
-       vec4 nightColor = texture(textures[1], fragmentTextureCoordinates);
-
-       outColor = mix(nightColor, dayColor, daylight);
-}
diff --git a/shaders/sky/skybox/vertex.glsl b/shaders/sky/skybox/vertex.glsl
deleted file mode 100755 (executable)
index 1b361b7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-layout(location = 0) in vec3 vertexPosition;
-
-out vec3 fragmentTextureCoordinates;
-
-uniform mat4 VP;
-
-void main()
-{
-       gl_Position = VP * vec4(vertexPosition, 1.0);
-       gl_Position.z = gl_Position.w;
-       fragmentTextureCoordinates = vertexPosition;
-}
diff --git a/shaders/sky/sun/fragment.glsl b/shaders/sky/sun/fragment.glsl
deleted file mode 100755 (executable)
index bc8e428..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-in vec2 fragmentTextureCoordinates;
-
-out vec4 outColor;
-
-uniform sampler2D texture0;
-
-void main()
-{
-       outColor = texture(texture0, fragmentTextureCoordinates);
-}
diff --git a/shaders/sky/sun/vertex.glsl b/shaders/sky/sun/vertex.glsl
deleted file mode 100755 (executable)
index 243d17f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-layout(location = 0) in vec3 vertexPosition;
-layout(location = 1) in vec2 vertexTextureCoordinates;
-
-out vec2 fragmentTextureCoordinates;
-
-uniform mat4 MVP;
-
-void main()
-{
-       gl_Position = MVP * vec4(vertexPosition, 1.0);
-       gl_Position.z = gl_Position.w;
-       fragmentTextureCoordinates = vertexTextureCoordinates;
-}
diff --git a/singleplayer.bat b/singleplayer.bat
new file mode 100755 (executable)
index 0000000..0328b33
--- /dev/null
@@ -0,0 +1,5 @@
+@echo off
+start "Internal Server" dragonblocks_server.exe "[::1]:4000"
+echo "singleplayer" | dragonblocks_client.exe "[::1]:4000"
+taskkill /FI "Internal Server" /T /F
+
index 0daa513c474054ac3620d036afedc83899bacfdc..5f084ad54a789be395aeb8afdc9a0818a344432c 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/bash
 ./dragonblocks_server "[::1]:4000" &
-echo "singleplayer" | ./dragonblocks "[::1]:4000"
-pkill -P $$ -9
+echo "singleplayer" | ./dragonblocks_client "[::1]:4000"
+pkill -P $$
index 9c1098fc482e74c3cfdcc7c174f8753af72db74c..e99ab63474ec59939842768c1ae77aa112a56071 100755 (executable)
@@ -1,23 +1,44 @@
 #!/bin/bash
+set -e
+
 VERSION=`git tag --points-at HEAD`
 if [[ $VERSION = "" ]]; then
        VERSION=`git rev-parse --short HEAD`
 fi
-DIR=dragonblocks_alpha-$VERSION
-mkdir .build
-cp -r * .build/
-cd .build/
-mkdir build
-cd build
-if ! (cmake -B . -S ../src -DCMAKE_BUILD_TYPE=Release -DRESSOURCE_PATH="\"\"" -DCMAKE_C_FLAGS="-Ofast" && make clean && make -j$(nproc)); then
-       cd ../..
-       rm -rf .build
-       exit 1
+
+BUILD=build-release
+SNAPSHOT=dragonblocks_alpha-$VERSION
+TOOLCHAIN=
+DOTEXE=
+DOTSH=".sh"
+if [[ "$1" == "mingw" ]]; then
+       BUILD=build-mingw
+       SNAPSHOT=dragonblocks_alpha-win64-$VERSION
+       TOOLCHAIN=mingw.cmake
+       DOTEXE=".exe"
+       DOTSH=".bat"
 fi
-cp dragonblocks dragonblocks_server ..
-cd ..
-rm -rf .git* deps src build BUILDING.md snapshot.sh upload.sh dragonblocks_alpha-* screenshot-*.png
-cd ..
-mv .build $DIR
-zip -r $DIR.zip $DIR/*
-rm -rf $DIR
+
+mkdir -p $BUILD
+
+cmake -B $BUILD -S src \
+       -DCMAKE_BUILD_TYPE="Release" \
+       -DASSET_PATH="assets/" \
+       -DCMAKE_C_FLAGS="-Ofast" \
+       -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN"
+
+make --no-print-directory -C $BUILD -j$(nproc)
+
+rm -rf $SNAPSHOT
+mkdir $SNAPSHOT
+
+cp -r \
+       assets \
+       $BUILD/dragonblocks_client$DOTEXE \
+       $BUILD/dragonblocks_server$DOTEXE \
+       singleplayer$DOTSH \
+       LICENSE \
+       README.md \
+       $SNAPSHOT
+
+zip -r $SNAPSHOT.zip $SNAPSHOT/*
index 896d84537a3078c66ca4163845d38253368952d6..6c9838a0f36dd22bb86df0c07fc5121b6952bcac 100644 (file)
@@ -1,41 +1,44 @@
-cmake_minimum_required(VERSION 3.12)
+cmake_minimum_required(VERSION 3.14)
 project(Dragonblocks)
 
 # Variables
 
-set(DEPS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../deps/")
+set(DEPS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../deps")
 
 if(NOT CMAKE_BUILD_TYPE)
        set(CMAKE_BUILD_TYPE Debug)
 endif()
 
-if(NOT RESSOURCE_PATH)
-       set(RESSOURCE_PATH "../")
+if(NOT ASSET_PATH)
+       set(ASSET_PATH "../assets/")
 endif()
 
 # Dependencies
 
-find_package(OpenGL REQUIRED)
-
-if(NOT GLEW_LIBRARIES OR NOT GLEW_INCLUDE_DIRS)
-       find_package(GLEW REQUIRED)
-endif()
-
-if(NOT GLFW_LIBRARIES OR NOT GLFW_INCLUDE_DIRS)
-       find_package(glfw3 3.3 REQUIRED)
-       set(GLFW_LIBRARIES glfw)
-       set(GLFW_INCLUDE_DIRS)
-endif()
-
-if(NOT FREETYPE_LIBRARIES OR NOT FREETYPE_INCLUDE_DIRS)
-       find_package(Freetype REQUIRED)
-endif()
-
-if(NOT ZLIB_LIBRARIES OR NOT ZLIB_INCLUDE_DIRS)
-       find_package(ZLIB REQUIRED)
-       set(ZLIB_LIBRARIES ZLIB::ZLIB)
-       set(ZLIB_INCLUDE_DIRS)
-endif()
+cmake_policy(SET CMP0077 NEW)
+
+set(SKIP_INSTALL_ALL ON)
+set(BUILD_SHARED_LIBS OFF)
+set(ZLIB_LIBRARY zlibstatic)
+
+set(FT_DISABLE_ZLIB OFF)
+set(FT_DISABLE_BZIP2 ON)
+set(FT_DISABLE_PNG ON)
+set(FT_DISABLE_HARFBUZZ ON)
+set(FT_DISABLE_BROTLI ON)
+
+add_subdirectory("${DEPS_DIR}/glfw" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/glfw")
+add_subdirectory("${DEPS_DIR}/glew-cmake" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/glew")
+add_subdirectory("${DEPS_DIR}/sqlite3-cmake" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/sqlite3")
+add_subdirectory("${DEPS_DIR}/perlin" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/perlin")
+add_subdirectory("${DEPS_DIR}/asprintf" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/asprintf")
+add_subdirectory("${DEPS_DIR}/dragonnet" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/dragonnet")
+add_subdirectory("${DEPS_DIR}/dragonstd" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/dragonstd")
+add_subdirectory("${DEPS_DIR}/getline" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/getline")
+add_subdirectory("${DEPS_DIR}/stpcpy" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/stpcpy")
+add_subdirectory("${DEPS_DIR}/linenoise" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/linenoise")
+add_subdirectory("${DEPS_DIR}/zlib" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/zlib")
+add_subdirectory("${DEPS_DIR}/freetype" EXCLUDE_FROM_ALL "${CMAKE_CURRENT_BINARY_DIR}/freetype")
 
 # Options
 
@@ -44,21 +47,17 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
 endif()
 
 add_compile_definitions("USE_DRAGONNET")
-add_compile_definitions("RESSOURCE_PATH=\"${RESSOURCE_PATH}\"")
-
-add_compile_options(-Wall -Wextra -Werror -Wno-address-of-packed-member -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-maybe-uninitialized -fmax-errors=4)
-
-link_libraries(
-       pthread
-       m
-       ${ZLIB_LIBRARIES}
+add_compile_definitions("GLEW_STATIC")
+add_compile_definitions("ASSET_PATH=\"${ASSET_PATH}\"")
+
+add_compile_options(
+       -Wall
+       -Wextra
+       -Werror
+       -Wno-address-of-packed-member
+       -fmax-errors=4
 )
 
-include_directories(SYSTEM ${DEPS_DIR})
-include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
-include_directories(${ZLIB_INCLUDE_DIRS})
-
 # System specific options
 
 if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
@@ -73,45 +72,43 @@ endif()
 
 # Common sources
 
-set(COMMON_SOURCES
+add_library(dragonblocks
        "${CMAKE_CURRENT_BINARY_DIR}/types.c"
-       "${DEPS_DIR}/asprintf/asprintf.c"
-       "${DEPS_DIR}/dragonnet/addr.c"
-       "${DEPS_DIR}/dragonnet/listen.c"
-       "${DEPS_DIR}/dragonnet/peer.c"
-       "${DEPS_DIR}/dragonnet/recv.c"
-       "${DEPS_DIR}/dragonnet/recv_thread.c"
-       "${DEPS_DIR}/dragonnet/send.c"
-       "${DEPS_DIR}/dragonstd/array.c"
-       "${DEPS_DIR}/dragonstd/flag.c"
-       "${DEPS_DIR}/dragonstd/list.c"
-       "${DEPS_DIR}/dragonstd/map.c"
-       "${DEPS_DIR}/dragonstd/queue.c"
-       "${DEPS_DIR}/dragonstd/refcount.c"
-       "${DEPS_DIR}/dragonstd/tree.c"
-       "${DEPS_DIR}/dragonstd/bits/compare.c"
-       "${DEPS_DIR}/getline/getline.c"
-       "${DEPS_DIR}/linenoise/linenoise.c"
-       "${DEPS_DIR}/linenoise/stringbuf.c"
-       "${DEPS_DIR}/linenoise/utf8.c"
-       "${DEPS_DIR}/perlin/perlin.c"
-       color.c
-       config.c
-       day.c
-       environment.c
-       facedir.c
-       interrupt.c
-       item.c
-       node.c
-       perlin.c
-       physics.c
-       terrain.c
+       common/color.c
+       common/config.c
+       common/day.c
+       common/environment.c
+       common/facedir.c
+       common/interrupt.c
+       common/item.c
+       common/node.c
+       common/perlin.c
+       common/physics.c
+       common/terrain.c
+)
+
+target_include_directories(dragonblocks
+       PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
+       PUBLIC ${CMAKE_CURRENT_BINARY_DIR}
+       PUBLIC "${DEPS_DIR}/linmath.h"
+       PUBLIC "${DEPS_DIR}/endian.h"
+       PUBLIC "${DEPS_DIR}/stb"
+)
+
+target_link_libraries(dragonblocks
+       PUBLIC pthread
+       PUBLIC m
+       PUBLIC perlin
+       PUBLIC dragonnet
+       PUBLIC dragonstd
+       PUBLIC getline
+       PUBLIC zlibstatic
+       PUBLIC stpcpy
 )
 
 # Client
 
-add_executable(dragonblocks
-       ${COMMON_SOURCES}
+add_executable(dragonblocks_client
        client/camera.c
        client/client.c
        client/client_auth.c
@@ -144,23 +141,18 @@ add_executable(dragonblocks
        client/window.c
 )
 
-target_link_libraries(dragonblocks
-       ${OPENGL_LIBRARIES}
-       ${GLEW_LIBRARIES}
-       ${GLFW_LIBRARIES}
-       ${FREETYPE_LIBRARIES}
-)
-
-target_include_directories(dragonblocks PUBLIC
-       ${GLEW_INCLUDE_DIRS}
-       ${GLFW_INCLUDE_DIRS}
-       ${FREETYPE_INCLUDE_DIRS}
+target_link_libraries(dragonblocks_client
+       PUBLIC dragonblocks
+       PUBLIC libglew_static
+       PUBLIC glfw
+       PUBLIC asprintf
+       PUBLIC linenoise
+       PUBLIC freetype
 )
 
 # Server
 
 add_executable(dragonblocks_server
-       ${COMMON_SOURCES}
        server/biomes.c
        server/database.c
        server/schematic.c
@@ -178,7 +170,8 @@ add_executable(dragonblocks_server
 )
 
 target_link_libraries(dragonblocks_server
-       sqlite3
+       PUBLIC dragonblocks
+       PUBLIC sqlite3
 )
 
 # Version
@@ -189,7 +182,6 @@ add_custom_target(version
 )
 
 add_dependencies(dragonblocks version)
-add_dependencies(dragonblocks_server version)
 
 # Types
 
@@ -206,4 +198,3 @@ add_custom_target(types
 )
 
 add_dependencies(dragonblocks types)
-add_dependencies(dragonblocks_server types)
index 3e3d517c2e8f6f8574ba9fd88c8a5f106f5dd572..740ece2abe082096da12f108f418558f561fca2b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _CAMERA_H_
 #define _CAMERA_H_
 
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include "types.h"
 
 extern struct Camera {
index 55bfc4516c460bcf8472bd233dff68bb86927173..2adb649eb596aefc1608603a75df4e72615f2d54 100644 (file)
@@ -14,9 +14,9 @@
 #include "client/debug_menu.h"
 #include "client/game.h"
 #include "client/input.h"
-#include "day.h"
-#include "interrupt.h"
-#include "perlin.h"
+#include "common/day.h"
+#include "common/interrupt.h"
+#include "common/perlin.h"
 #include "types.h"
 
 DragonnetPeer *client;
index b955cd5c7711196ed4ea03a97075ca9a9d2af14e..a338aa1551bf953f8b28df9d7132c1d8ac53b5af 100644 (file)
@@ -1,10 +1,10 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <linenoise/linenoise.h>
+#include <linenoise.h>
 #include "client.h"
 #include "client_auth.h"
-#include "interrupt.h"
+#include "common/interrupt.h"
 #include "types.h"
 
 struct ClientAuth client_auth;
index cc49c97b19a295d6829e4ff3c52c183731be8393..a1c34ab0a69d8036f92e93dd36a2ae63884a57c7 100644 (file)
@@ -1,5 +1,5 @@
-#include "config.h"
 #include "client/client_config.h"
+#include "common/config.h"
 
 struct ClientConfig client_config = {
        .antialiasing = 4,
index 2174e1b8951cf3725f6deac0e11b953e2a1d9bb7..49f8d614eccc6e44a72886496e21dfd21b451337 100644 (file)
@@ -1,4 +1,4 @@
-#include <asprintf/asprintf.h>
+#include <asprintf.h>
 #include <dragonstd/map.h>
 #include <inttypes.h>
 #include <stdio.h>
@@ -170,7 +170,7 @@ void client_entity_gfx_init()
 {
        char *shader_def;
        asprintf(&shader_def, "#define VIEW_DISTANCE %lf\n", client_config.view_distance);
-       shader_prog = shader_program_create(RESSOURCE_PATH "shaders/3d/entity", shader_def);
+       shader_prog = shader_program_create(ASSET_PATH "shaders/3d/entity", shader_def);
        free(shader_def);
 
        loc_VP = glGetUniformLocation(shader_prog, "VP"); GL_DEBUG
index a0e43dffce244a2448249b2767ee3c14b2c51389..7d009a99e43c471fb084dbf4f2dd3670173aa4af 100644 (file)
@@ -5,8 +5,8 @@
 #include <pthread.h>
 #include "client/gui.h"
 #include "client/model.h"
-#include "entity.h"
-#include "item.h"
+#include "common/entity.h"
+#include "common/item.h"
 #include "types.h"
 
 typedef struct {
index 4bc4124209b45c01f3eee0aa5aa7b89c91c6af09..c0f780b3bd58d30e7e890b3ed139e98fd7e7f595 100644 (file)
@@ -1,4 +1,4 @@
-#include <asprintf/asprintf.h>
+#include <asprintf.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "client/client_config.h"
@@ -19,7 +19,7 @@ void client_inventory_init()
 {
        char *_3d_shader_def;
        asprintf(&_3d_shader_def, "#define VIEW_DISTANCE %lf\n", client_config.view_distance);
-       _3d_shader_prog = shader_program_create(RESSOURCE_PATH "shaders/3d/item", _3d_shader_def);
+       _3d_shader_prog = shader_program_create(ASSET_PATH "shaders/3d/item", _3d_shader_def);
        free(_3d_shader_def);
 
        _3d_loc_VP = glGetUniformLocation(_3d_shader_prog, "VP");
index 5685cbf604706dd63831e0a155b3cd6a56f374fa..0d16ee72c5274e59da1589ed657fcf965e49ac75 100644 (file)
@@ -1,6 +1,6 @@
 #include "client/client_item.h"
 #include "client/interact.h"
-#include "node.h"
+#include "common/node.h"
 
 static bool use_dig(__attribute__((unused)) ItemStack *stack)
 {
@@ -11,7 +11,7 @@ static bool use_dig(__attribute__((unused)) ItemStack *stack)
 ClientItemDef client_item_def[COUNT_ITEM] = {
        // unknown
        {
-               .mesh_path = RESSOURCE_PATH "meshes/unknown.txt",
+               .mesh_path = ASSET_PATH "meshes/unknown.txt",
                .mesh = {0},
                .use = NULL,
        },
@@ -23,19 +23,19 @@ ClientItemDef client_item_def[COUNT_ITEM] = {
        },
        // pickaxe
        {
-               .mesh_path = RESSOURCE_PATH "meshes/pickaxe.txt",
+               .mesh_path = ASSET_PATH "meshes/pickaxe.txt",
                .mesh = {0},
                .use = &use_dig,
        },
        // axe
        {
-               .mesh_path = RESSOURCE_PATH "meshes/axe.txt",
+               .mesh_path = ASSET_PATH "meshes/axe.txt",
                .mesh = {0},
                .use = &use_dig,
        },
        // shovel
        {
-               .mesh_path = RESSOURCE_PATH "meshes/shovel.txt",
+               .mesh_path = ASSET_PATH "meshes/shovel.txt",
                .mesh = {0},
                .use = &use_dig,
        },
index cbd633462af027da739d48a1a5d8d203a28b5fba..16552b04430568ee08ad92b02562794a2ef640b5 100644 (file)
@@ -3,8 +3,8 @@
 
 #include <stdbool.h>
 #include "client/mesh.h"
-#include "item.h"
-#include "node.h"
+#include "common/item.h"
+#include "common/node.h"
 
 typedef struct {
        const char *mesh_path;
index 1142a85b0d59cb5511276d219a9576327d40678f..76eb7384216221ee23c13f8bcc3cdc4464817fe6 100644 (file)
@@ -1,10 +1,10 @@
 #include <stdlib.h>
 #include "client/client.h"
 #include "client/client_node.h"
-#include "color.h"
-#include "environment.h"
-#include "node.h"
-#include "perlin.h"
+#include "common/color.h"
+#include "common/environment.h"
+#include "common/node.h"
+#include "common/perlin.h"
 
 #define TILES_SIMPLE(path) {.paths = {path, NULL, NULL, NULL, NULL, NULL}, .indices = {0, 0, 0, 0, 0, 0}, .textures = {NULL}}
 #define TILES_NONE {.paths = {NULL}, .indices = {0}, .textures = {NULL}}
@@ -42,7 +42,7 @@ static void render_color(NodeArgsRender *args)
 ClientNodeDef client_node_def[COUNT_NODE] = {
        // unknown
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/unknown.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/unknown.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = NULL,
@@ -62,7 +62,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // grass
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/grass.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/grass.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = &render_grass,
@@ -72,7 +72,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // dirt
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/dirt.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/dirt.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = NULL,
@@ -82,7 +82,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // stone
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/stone.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/stone.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = &render_stone,
@@ -92,7 +92,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // snow
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/snow.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/snow.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = NULL,
@@ -103,7 +103,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        // oak wood
        {
                .tiles = {
-                       .paths = {RESSOURCE_PATH "textures/oak_wood.png", RESSOURCE_PATH "textures/oak_wood_top.png", NULL, NULL, NULL, NULL},
+                       .paths = {ASSET_PATH "textures/oak_wood.png", ASSET_PATH "textures/oak_wood_top.png", NULL, NULL, NULL, NULL},
                        .indices = {0, 0, 0, 0, 1, 1},
                        .textures = {NULL},
                },
@@ -116,7 +116,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // oak leaves
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/oak_leaves.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/oak_leaves.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = &render_color,
@@ -127,7 +127,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        // pine wood
        {
                .tiles = {
-                       .paths = {RESSOURCE_PATH "textures/pine_wood.png", RESSOURCE_PATH "textures/pine_wood_top.png", NULL, NULL, NULL, NULL},
+                       .paths = {ASSET_PATH "textures/pine_wood.png", ASSET_PATH "textures/pine_wood_top.png", NULL, NULL, NULL, NULL},
                        .indices = {0, 0, 0, 0, 1, 1},
                        .textures = {NULL},
                },
@@ -140,7 +140,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // pine leaves
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/pine_leaves.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/pine_leaves.png"),
                .visibility = VISIBILITY_CLIP,
                .mipmap = true,
                .render = &render_color,
@@ -151,7 +151,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        // palm wood
        {
                .tiles = {
-                       .paths = {RESSOURCE_PATH "textures/palm_wood.png", RESSOURCE_PATH "textures/palm_wood_top.png", NULL, NULL, NULL, NULL},
+                       .paths = {ASSET_PATH "textures/palm_wood.png", ASSET_PATH "textures/palm_wood_top.png", NULL, NULL, NULL, NULL},
                        .indices = {0, 0, 0, 0, 1, 1},
                        .textures = {NULL},
                },
@@ -164,7 +164,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // palm leaves
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/palm_leaves.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/palm_leaves.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = &render_color,
@@ -174,7 +174,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // sand
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/sand.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/sand.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = NULL,
@@ -184,7 +184,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // water
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/water.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/water.png"),
                .visibility = VISIBILITY_BLEND,
                .mipmap = true,
                .render = NULL,
@@ -194,7 +194,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // lava
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/lava.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/lava.png"),
                .visibility = VISIBILITY_BLEND,
                .mipmap = true,
                .render = NULL,
@@ -204,7 +204,7 @@ ClientNodeDef client_node_def[COUNT_NODE] = {
        },
        // vulcano_stone
        {
-               .tiles = TILES_SIMPLE(RESSOURCE_PATH "textures/vulcano_stone.png"),
+               .tiles = TILES_SIMPLE(ASSET_PATH "textures/vulcano_stone.png"),
                .visibility = VISIBILITY_SOLID,
                .mipmap = true,
                .render = NULL,
index 8068eca4c6f28d18ed774c2b0915eca4e9605df8..a2f88eeee6f3baebb6aafc46b4bb07c5f5e29646 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "client/terrain_gfx.h"
 #include "client/texture.h"
-#include "terrain.h"
+#include "common/terrain.h"
 
 typedef enum {
        VISIBILITY_NONE,
index ffdc6b2215ae1b60803a7732d087c1c4a0178e04..d6c9cc00c65a683ffd06e16b36bac22c6e9faa20 100644 (file)
@@ -8,8 +8,8 @@
 #include "client/cube.h"
 #include "client/debug_menu.h"
 #include "client/texture.h"
-#include "environment.h"
-#include "physics.h"
+#include "common/environment.h"
+#include "common/physics.h"
 
 struct ClientPlayer client_player;
 
@@ -233,7 +233,7 @@ void client_player_deinit()
 void client_player_gfx_init()
 {
        player_model = model_load(
-               RESSOURCE_PATH "models/player.txt", RESSOURCE_PATH "textures/models/player",
+               ASSET_PATH "models/player.txt", ASSET_PATH "textures/models/player",
                &client_entity_cube, &client_entity_shader);
 
        player_model->callbacks.delete = &on_model_delete;
index e8eae363b9a34f8f4c45a3a0ce1c72ac4d41410b..86f3f212bb3f023df8240b332e37d6f1b9b387b1 100644 (file)
@@ -14,7 +14,7 @@
 #include "client/client_terrain.h"
 #include "client/debug_menu.h"
 #include "client/terrain_gfx.h"
-#include "facedir.h"
+#include "common/facedir.h"
 
 #define MAX_REQUESTS 4
 
index 262a3d50a676a621beef92da37663c38206c9991..a33732548400e2173f8da9d6929b85a9b0695530 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdatomic.h>
 #include <stdbool.h>
 #include "client/model.h"
-#include "terrain.h"
+#include "common/terrain.h"
 #include "types.h"
 
 #define CHUNK_MODE_NOCREATE 2
index ddf36c41c2ebf5d13f12071b24a410b1f03f70e6..ef1c457d03fd5bf63fcebbddb5f517ff888617a5 100644 (file)
@@ -1,4 +1,4 @@
-#include <asprintf/asprintf.h>
+#include <asprintf.h>
 #include <GL/glew.h>
 #include <GL/gl.h>
 #include <stdbool.h>
@@ -15,9 +15,9 @@
 #include "client/gui.h"
 #include "client/interact.h"
 #include "client/window.h"
-#include "day.h"
-#include "environment.h"
-#include "perlin.h"
+#include "common/day.h"
+#include "common/environment.h"
+#include "common/perlin.h"
 #include "version.h"
 
 static GUIElement *gui_elements[COUNT_ENTRY] = {NULL};
index 8014d97618510e2e35929df83cb262755c3ce5e6..56c6e07f1fa30d0ec724cec47df76cc3a37012cd 100644 (file)
@@ -39,7 +39,7 @@ void font_init()
                abort();
        }
 
-       if (FT_New_Face(font_library, RESSOURCE_PATH "fonts/Minecraftia.ttf", 0, &font_face)) {
+       if (FT_New_Face(font_library, ASSET_PATH "fonts/Minecraftia.ttf", 0, &font_face)) {
                fprintf(stderr, "[error] failed to load Minecraftia.ttf\n");
                abort();
        }
index a7472659f0bdb394d3c4ab1745c6297ad1069a9e..59304aa1543194f8b8d39328465e070608977c74 100644 (file)
@@ -2,7 +2,7 @@
 #define _FRUSTUM_H_
 
 #include <stdbool.h>
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include "types.h"
 
 extern mat4x4 frustum;
index b45499a98cce2ce3a60ce54ce621e59f50a600fa..859d9cfd80527558d534a19f11a5af96c9007b46 100644 (file)
@@ -21,8 +21,8 @@
 #include "client/interact.h"
 #include "client/sky.h"
 #include "client/window.h"
-#include "day.h"
-#include "interrupt.h"
+#include "common/day.h"
+#include "common/interrupt.h"
 
 #ifdef _WIN32
 #include <pthread_time.h>
index 9cda646956bec6e3297a98426e7ed7e03326a661..8e5e1f3b14562f26a64947ca245c07968bd60077 100644 (file)
@@ -253,18 +253,18 @@ static void transform_element(GUIElement *element)
 void gui_init()
 {
        // initialize background pipeline
-       background_prog = shader_program_create(RESSOURCE_PATH "shaders/gui/background", NULL);
+       background_prog = shader_program_create(ASSET_PATH "shaders/gui/background", NULL);
        background_loc_model = glGetUniformLocation(background_prog, "model"); GL_DEBUG
        background_loc_projection = glGetUniformLocation(background_prog, "projection"); GL_DEBUG
        background_loc_color = glGetUniformLocation(background_prog, "color"); GL_DEBUG
 
        // initialize image pipeline
-       image_prog = shader_program_create(RESSOURCE_PATH "shaders/gui/image", NULL);
+       image_prog = shader_program_create(ASSET_PATH "shaders/gui/image", NULL);
        image_loc_model = glGetUniformLocation(image_prog, "model"); GL_DEBUG
        image_loc_projection = glGetUniformLocation(image_prog, "projection"); GL_DEBUG
 
        // initialize font pipeline
-       font_prog = shader_program_create(RESSOURCE_PATH "shaders/gui/font", NULL);
+       font_prog = shader_program_create(ASSET_PATH "shaders/gui/font", NULL);
        font_loc_model = glGetUniformLocation(font_prog, "model"); GL_DEBUG
        font_loc_projection = glGetUniformLocation(font_prog, "projection"); GL_DEBUG
        font_loc_color = glGetUniformLocation(font_prog, "color"); GL_DEBUG
index b7c3087cdcaa0e384dc7e9ff064e87fc98a362eb..a3776eaa00f9d0b65e87bda14862f19d74860b11 100644 (file)
@@ -2,7 +2,7 @@
 #define _GUI_H_
 
 #include <dragonstd/array.h>
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include <stdbool.h>
 #include "client/font.h"
 #include "client/texture.h"
index 32c181b24b1e8726c4c5b5b78694547c489175f0..a5927ffc30c8c4918f12d02eb4a8f27368f3fd98 100644 (file)
@@ -1,4 +1,4 @@
-#include <asprintf/asprintf.h>
+#include <asprintf.h>
 #include <math.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -13,7 +13,7 @@
 #include "client/input.h"
 #include "client/screenshot.h"
 #include "client/window.h"
-#include "day.h"
+#include "common/day.h"
 
 #define SET_STATUS_MESSAGE(args...) { \
        char *msg; asprintf(&msg, args); \
index 25401d7e134f4cfc2b0b24e63a5c0ef2960337e4..1e2fb6ea69fb5be7908ad0cca92a099375726b9d 100644 (file)
@@ -1,4 +1,4 @@
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include <stdio.h>
 #include "client/camera.h"
 #include "client/client.h"
@@ -42,7 +42,7 @@ static Mesh selection_mesh = {
 
 void interact_init()
 {
-       shader_prog = shader_program_create(RESSOURCE_PATH "shaders/3d/selection", NULL);
+       shader_prog = shader_program_create(ASSET_PATH "shaders/3d/selection", NULL);
        loc_MVP = glGetUniformLocation(shader_prog, "MVP"); GL_DEBUG
        loc_color = glGetUniformLocation(shader_prog, "color"); GL_DEBUG
 
@@ -64,7 +64,7 @@ void interact_init()
                .scale_type = SCALE_IMAGE,
                .affect_parent_scale = false,
                .text = NULL,
-               .image = texture_load(RESSOURCE_PATH "textures/crosshair.png", false),
+               .image = texture_load(ASSET_PATH "textures/crosshair.png", false),
                .text_color = {0.0f, 0.0f, 0.0f, 0.0f},
                .bg_color = {0.0f, 0.0f, 0.0f, 0.0f},
        });
index 3c9a96d6dd6a85849a1b9e2e5629a15af61311fd..a80b905c4d19949353f9a25255b1bc5afd4b9899 100644 (file)
@@ -2,7 +2,7 @@
 #define _INTERACT_H_
 
 #include <stdbool.h>
-#include "node.h"
+#include "common/node.h"
 #include "types.h"
 
 extern struct InteractPointed {
index 9ba99d05006f5135cb3833b5c75875688ef7e7b5..a17c2d05e7aea2ef00d5486a41aa305849034c2a 100644 (file)
@@ -1,8 +1,8 @@
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include "client/camera.h"
 #include "client/gl_debug.h"
 #include "client/light.h"
-#include "day.h"
+#include "common/day.h"
 
 void light_shader_locate(LightShader *shader)
 {
index 1674da00b4db3bedbed407fb396c11d810718b8d..75b0b10fc26f2269de91c9c686fec51c3eec419c 100644 (file)
@@ -1,5 +1,5 @@
 #include <dragonstd/tree.h>
-#include <getline/getline.h>
+#include <getline.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
index 1755bd96c08e9147158aaa31b6f5af02e73378a0..93bc773895b88744e6f3222ae3a2c20f2d9046a7 100644 (file)
@@ -1,5 +1,5 @@
 #include <dragonstd/tree.h>
-#include <getline/getline.h>
+#include <getline.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <pthread.h>
index 7254d0da70315bc592749ad64af4307b64460e25..0d4d3fb14b47cc251997bd4060adc22fe47b26c0 100644 (file)
@@ -5,7 +5,7 @@
 #include <dragonstd/list.h>
 #include <GL/glew.h>
 #include <GL/gl.h>
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include "client/mesh.h"
index eac7e1746163bdc8fd73fc26ab483ab048151e14..6ba8ed91fc6f334d28311bc003fc0b5cf5e619b4 100644 (file)
@@ -2,7 +2,7 @@
 #define _RAYCAST_H_
 
 #include <stdbool.h>
-#include "node.h"
+#include "common/node.h"
 #include "types.h"
 
 bool raycast(v3f64 pos, v3f64 dir, f64 len, v3s32 *node_pos, NodeType *node);
index 0a388f2d18f22e4d3de5313229ebecf4755e4cd0..1569d1481ac902ce56dc9c6fc6e26370b9768571 100644 (file)
@@ -1,7 +1,7 @@
 #define STB_IMAGE_WRITE_IMPLEMENTATION
 #include <GL/glew.h>
 #include <GL/gl.h>
-#include <stb/stb_image_write.h>
+#include <stb_image_write.h>
 #include <string.h>
 #include <time.h>
 #include "client/game.h"
index 101782dd0fd538b76385dbf48d954f22e5f05484..d20b1495ba3b02481dc8deb93056224f5e4278ab 100644 (file)
@@ -10,7 +10,7 @@
 #include "client/sky.h"
 #include "client/texture.h"
 #include "client/window.h"
-#include "day.h"
+#include "common/day.h"
 
 static GLuint sun_prog;
 static GLint sun_loc_MVP;
@@ -86,24 +86,24 @@ void sky_init()
 
        // skybox
 
-       skybox_prog = shader_program_create(RESSOURCE_PATH "shaders/sky/skybox", NULL);
+       skybox_prog = shader_program_create(ASSET_PATH "shaders/sky/skybox", NULL);
        glProgramUniform1iv(skybox_prog, glGetUniformLocation(skybox_prog, "textures"), 2, (GLint[]) {0, 1}); GL_DEBUG
        skybox_loc_VP = glGetUniformLocation(skybox_prog, "VP"); GL_DEBUG
        skybox_loc_daylight = glGetUniformLocation(skybox_prog, "daylight"); GL_DEBUG
-       skybox_texture_day = texture_load_cubemap(RESSOURCE_PATH "textures/skybox/day", true)->txo;
-       skybox_texture_night = texture_load_cubemap(RESSOURCE_PATH "textures/skybox/night", true)->txo;
+       skybox_texture_day = texture_load_cubemap(ASSET_PATH "textures/skybox/day", true)->txo;
+       skybox_texture_night = texture_load_cubemap(ASSET_PATH "textures/skybox/night", true)->txo;
        skybox_mesh.data = skybox_vertices;
        mesh_upload(&skybox_mesh);
 
        // sun
 
-       sun_prog = shader_program_create(RESSOURCE_PATH "shaders/sky/sun", NULL);
+       sun_prog = shader_program_create(ASSET_PATH "shaders/sky/sun", NULL);
        sun_loc_MVP = glGetUniformLocation(sun_prog, "MVP"); GL_DEBUG
-       sun_texture = texture_load(RESSOURCE_PATH "textures/sun.png", false)->txo;
+       sun_texture = texture_load(ASSET_PATH "textures/sun.png", false)->txo;
 
        // clouds
 
-       clouds_prog = shader_program_create(RESSOURCE_PATH "shaders/sky/clouds", NULL);
+       clouds_prog = shader_program_create(ASSET_PATH "shaders/sky/clouds", NULL);
        clouds_loc_VP = glGetUniformLocation(clouds_prog, "VP"); GL_DEBUG
        clouds_loc_daylight = glGetUniformLocation(clouds_prog, "daylight"); GL_DEBUG
        clouds_mesh.data = clouds_vertices;
index 401b42e208d0be93a2125f5550a4837e5ef7f482..d8ce09fcd05e1854831bc2acbe6d063a34721f33 100644 (file)
@@ -1,6 +1,6 @@
 #include <assert.h>
-#include <asprintf/asprintf.h>
-#include <linmath.h/linmath.h>
+#include <asprintf.h>
+#include <linmath.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "client/client_config.h"
@@ -12,7 +12,7 @@
 #include "client/light.h"
 #include "client/shader.h"
 #include "client/terrain_gfx.h"
-#include "facedir.h"
+#include "common/facedir.h"
 
 typedef struct {
        TerrainChunk *chunk;     // input: chunk pointer
@@ -225,7 +225,7 @@ void terrain_gfx_init()
                texture_units,
                client_config.view_distance
        );
-       shader_prog = shader_program_create(RESSOURCE_PATH "shaders/3d/terrain", shader_def);
+       shader_prog = shader_program_create(ASSET_PATH "shaders/3d/terrain", shader_def);
        free(shader_def);
 
        loc_VP = glGetUniformLocation(shader_prog, "VP"); GL_DEBUG
index d2a0cc93854f8d969a0ea78ef55c41483097c2e6..f9675055aa06e83f3cf28692d2a580ff3dcbfeaf 100644 (file)
@@ -2,7 +2,7 @@
 #define _TERRAIN_GFX_H_
 
 #include "client/cube.h"
-#include "terrain.h"
+#include "common/terrain.h"
 
 typedef struct {
        CubeVertex cube;
index 54063fe3995370ee02cb92da96c29cff9a9ed199..fb489ca6ac5dfaad5e844faca7a3d2699b7f5d28 100644 (file)
@@ -1,7 +1,7 @@
 #define STB_IMAGE_IMPLEMENTATION
 #define STB_IMAGE_RESIZE_IMPLEMENTATION
-#include <stb/stb_image.h>
-#include <stb/stb_image_resize.h>
+#include <stb_image.h>
+#include <stb_image_resize.h>
 #include <stdbool.h>
 #include <dragonstd/tree.h>
 #include "client/client_config.h"
index aae5ed617535654c74ea02d53ec223ab380d3311..e33fa3e40e74e3521935e34fb03722c7033685a5 100644 (file)
@@ -2,7 +2,7 @@
 #define _WINDOW_H_
 
 #include <GLFW/glfw3.h>
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include <stdbool.h>
 #include "types.h"
 
diff --git a/src/color.c b/src/color.c
deleted file mode 100644 (file)
index 66c5d84..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "color.h"
-
-static f32 hue_to_rgb(f32 p, f32 q, f32 t)
-{
-    if (t < 0.0f)
-        t += 1.0f;
-
-    if (t > 1.0f)
-        t -= 1.0f;
-
-    if (t < 1.0f / 6.0f)
-        return p + (q - p) * 6.0f * t;
-
-    if (t < 1.0f / 2.0f)
-        return q;
-
-    if (t < 2.0f / 3.0f)
-        return p + (q - p) * (2.0f / 3.0f - t) * 6.0f;
-
-    return p;
-}
-
-v3f32 hsl_to_rgb(v3f32 hsl)
-{
-       v3f32 rgb;
-
-    if (hsl.y == 0.0f) {
-               rgb = (v3f32) {hsl.z, hsl.z, hsl.z};
-    } else {
-        f32 q = hsl.z < 0.5f ? hsl.z * (1.0f + hsl.y) : hsl.z + hsl.y - hsl.z * hsl.y;
-        f32 p = 2.0f * hsl.z - q;
-
-        rgb.x = hue_to_rgb(p, q, hsl.x + 1.0f / 3.0f);
-        rgb.y = hue_to_rgb(p, q, hsl.x);
-        rgb.z = hue_to_rgb(p, q, hsl.x - 1.0f / 3.0f);
-    }
-
-    return rgb;
-}
-
diff --git a/src/color.h b/src/color.h
deleted file mode 100644 (file)
index ebf8d73..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _COLOR_H_
-#define _COLOR_H_
-
-#include "types.h"
-
-v3f32 hsl_to_rgb(v3f32 hsl);
-
-#endif // _COLOR_H_
diff --git a/src/common/color.c b/src/common/color.c
new file mode 100644 (file)
index 0000000..e1689c7
--- /dev/null
@@ -0,0 +1,40 @@
+#include "common/color.h"
+
+static f32 hue_to_rgb(f32 p, f32 q, f32 t)
+{
+    if (t < 0.0f)
+        t += 1.0f;
+
+    if (t > 1.0f)
+        t -= 1.0f;
+
+    if (t < 1.0f / 6.0f)
+        return p + (q - p) * 6.0f * t;
+
+    if (t < 1.0f / 2.0f)
+        return q;
+
+    if (t < 2.0f / 3.0f)
+        return p + (q - p) * (2.0f / 3.0f - t) * 6.0f;
+
+    return p;
+}
+
+v3f32 hsl_to_rgb(v3f32 hsl)
+{
+       v3f32 rgb;
+
+    if (hsl.y == 0.0f) {
+               rgb = (v3f32) {hsl.z, hsl.z, hsl.z};
+    } else {
+        f32 q = hsl.z < 0.5f ? hsl.z * (1.0f + hsl.y) : hsl.z + hsl.y - hsl.z * hsl.y;
+        f32 p = 2.0f * hsl.z - q;
+
+        rgb.x = hue_to_rgb(p, q, hsl.x + 1.0f / 3.0f);
+        rgb.y = hue_to_rgb(p, q, hsl.x);
+        rgb.z = hue_to_rgb(p, q, hsl.x - 1.0f / 3.0f);
+    }
+
+    return rgb;
+}
+
diff --git a/src/common/color.h b/src/common/color.h
new file mode 100644 (file)
index 0000000..ebf8d73
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _COLOR_H_
+#define _COLOR_H_
+
+#include "types.h"
+
+v3f32 hsl_to_rgb(v3f32 hsl);
+
+#endif // _COLOR_H_
diff --git a/src/common/config.c b/src/common/config.c
new file mode 100644 (file)
index 0000000..da9959e
--- /dev/null
@@ -0,0 +1,109 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdbool.h>
+#include "common/config.h"
+
+void config_read(char *path, ConfigEntry *entries, size_t num_entries)
+{
+       FILE *f = fopen(path, "r");
+
+       if (!f)
+               return;
+
+       printf("[info] reading config from %s\n", path);
+
+       while (!feof(f)) {
+               char key[BUFSIZ];
+               if (!fscanf(f, "%s", key))
+                       break;
+
+               bool found = false;
+               for (size_t i = 0; i < num_entries; i++) {
+                       ConfigEntry *entry = &entries[i];
+                       if (strcmp(key, entry->key) == 0) {
+                               bool valid = false;
+
+                               switch (entry->type) {
+                                       case CONFIG_STRING: {
+                                               char value[BUFSIZ];
+
+                                               if (!fscanf(f, "%s", value))
+                                                       break;
+
+                                               valid = true;
+
+                                               char **entry_value = entry->value;
+
+                                               if (*entry_value)
+                                                       free(*entry_value);
+                                               *entry_value = strdup(value);
+
+                                               break;
+                                       }
+
+                                       case CONFIG_INT:
+                                               if (fscanf(f, "%d", (int *) entry->value))
+                                                       valid = true;
+
+                                               break;
+
+                                       case CONFIG_UINT:
+                                               if (fscanf(f, "%u", (unsigned int *) entry->value))
+                                                       valid = true;
+
+                                               break;
+
+                                       case CONFIG_FLOAT:
+                                               if (fscanf(f, "%lf", (double *) entry->value))
+                                                       valid = true;
+
+                                               break;
+
+                                       case CONFIG_BOOL: {
+                                               char value[BUFSIZ];
+
+                                               if (!fscanf(f, "%s", value))
+                                                       break;
+
+                                               valid = true;
+
+                                               if (strcmp(value, "on") == 0 || strcmp(value, "yes") == 0 || strcmp(value, "true") == 0)
+                                                       *(bool *) entry->value = true;
+                                               else if (strcmp(value, "off") == 0 || strcmp(value, "no") == 0 || strcmp(value, "false") == 0)
+                                                       *(bool *) entry->value = false;
+                                               else
+                                                       valid = false;
+
+                                               break;
+                                       }
+                               }
+
+                               if (!valid)
+                                       fprintf(stderr, "[warning] invalid value for setting %s in %s\n", key, path);
+
+                               found = true;
+                               break;
+                       }
+               }
+
+               if (!found)
+                       fprintf(stderr, "[warning] unknown setting %s in %s\n", key, path);
+       }
+
+       fclose(f);
+}
+
+void config_free(ConfigEntry *entries, size_t num_entries)
+{
+       for (size_t i = 0; i < num_entries; i++) {
+               ConfigEntry *entry = &entries[i];
+
+               if (entry->type == CONFIG_STRING) {
+                       char **entry_value = entry->value;
+
+                       if (*entry_value)
+                               free(*entry_value);
+               }
+       }
+}
diff --git a/src/common/config.h b/src/common/config.h
new file mode 100644 (file)
index 0000000..c7eeab3
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef _CONFIG_H_
+#define _CONFIG_H_
+
+#include <stddef.h>
+
+typedef enum {
+       CONFIG_STRING,
+       CONFIG_INT,
+       CONFIG_UINT,
+       CONFIG_FLOAT,
+       CONFIG_BOOL,
+} ConfigType;
+
+typedef struct {
+       ConfigType type;
+       char *key;
+       void *value;
+} ConfigEntry;
+
+void config_read(char *path, ConfigEntry *entries, size_t num_entries);
+void config_free(ConfigEntry *entries, size_t num_entires);
+
+#endif // _CONFIG_H_
diff --git a/src/common/day.c b/src/common/day.c
new file mode 100644 (file)
index 0000000..cbb9623
--- /dev/null
@@ -0,0 +1,41 @@
+#include <math.h>
+#include <time.h>
+#include "common/day.h"
+
+bool timelapse = false;
+static f64 time_of_day_offset;
+
+f64 get_unix_time()
+{
+       struct timespec ts;
+       clock_gettime(CLOCK_REALTIME, &ts);
+       return ((f64) ts.tv_sec + ts.tv_nsec / 1.0e9) * (timelapse ? 100.0 : 1.0);
+}
+
+f64 get_time_of_day()
+{
+       return fmod(get_unix_time() - time_of_day_offset, MINUTES_PER_DAY);
+}
+
+void set_time_of_day(f64 new_time)
+{
+       time_of_day_offset = get_unix_time() - new_time;
+}
+
+f64 get_sun_angle()
+{
+       return 2.0 * M_PI * (f64) get_time_of_day() / MINUTES_PER_DAY + M_PI;
+}
+
+f64 get_daylight()
+{
+       return f64_clamp(cos(get_sun_angle()) * 2.0 + 0.5, 0.0, 1.0);
+}
+
+void split_time_of_day(int *hours, int *minutes)
+{
+       int time_of_day = get_time_of_day();
+
+       *minutes = time_of_day % MINUTES_PER_HOUR;
+       *hours = time_of_day / MINUTES_PER_HOUR;
+}
diff --git a/src/common/day.h b/src/common/day.h
new file mode 100644 (file)
index 0000000..75cf3e9
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef _DAY_H_
+#define _DAY_H_
+
+#include <stdbool.h>
+#include "types.h"
+
+#define MINUTES_PER_HOUR 60
+#define HOURS_PER_DAY 24
+#define MINUTES_PER_DAY (HOURS_PER_DAY * MINUTES_PER_HOUR)
+
+// 1 second in real life = 1 minute ingame
+
+f64 get_time_of_day();
+void set_time_of_day(f64 new_time);
+f64 get_sun_angle();
+f64 get_daylight();
+void split_time_of_day(int *hours, int *minutes);
+
+extern bool timelapse;
+
+#endif // _DAY_H_
diff --git a/src/common/dig.h b/src/common/dig.h
new file mode 100644 (file)
index 0000000..3885ae4
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef _DIG_H_
+#define _DIG_H_
+
+typedef enum {
+       DIG_NONE = 0x0,
+       DIG_STONE = 0x01,
+       DIG_WOOD = 0x02,
+       DIG_DIRT = 0x04,
+       DIG_LEAVES = 0x08,
+} DigClass;
+
+#endif // _DIG_H_
diff --git a/src/common/entity.h b/src/common/entity.h
new file mode 100644 (file)
index 0000000..f564cee
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _ENTITY_H_
+#define _ENTITY_H_
+
+// ET phone home
+typedef enum {
+       ENTITY_LOCALPLAYER,
+       ENTITY_PLAYER,
+       COUNT_ENTITY,
+} EntityType;
+
+#endif // _ENTITY_H_
diff --git a/src/common/environment.c b/src/common/environment.c
new file mode 100644 (file)
index 0000000..862fdef
--- /dev/null
@@ -0,0 +1,12 @@
+#include "common/environment.h"
+#include "common/perlin.h"
+
+f64 get_humidity(v3s32 pos)
+{
+       return smooth2d(U32(pos.x) / 128.0, U32(pos.z) / 128.0, 0, seed + OFFSET_WETNESS) * 0.5 + 0.5;
+}
+
+f64 get_temperature(v3s32 pos)
+{
+       return smooth2d(U32(pos.x) / 128.0, U32(pos.z) / 128.0, 0, seed + OFFSET_TEMPERATURE) * 0.5 + 0.5 - (pos.y - 32.0) / 64.0;
+}
diff --git a/src/common/environment.h b/src/common/environment.h
new file mode 100644 (file)
index 0000000..f9a3ef7
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _ENVIRONMENT_H_
+#define _ENVIRONMENT_H_
+
+#include "types.h"
+
+f64 get_humidity(v3s32 pos);
+f64 get_temperature(v3s32 pos);
+
+#endif // _ENVIRONMENT_H_
diff --git a/src/common/facedir.c b/src/common/facedir.c
new file mode 100644 (file)
index 0000000..94c14c7
--- /dev/null
@@ -0,0 +1,10 @@
+#include "common/facedir.h"
+
+v3s32 facedir[6] = {
+       {+0, +0, -1},
+       {+0, +0, +1},
+       {-1, +0, +0},
+       {+1, +0, +0},
+       {+0, -1, +0},
+       {+0, +1, +0},
+};
diff --git a/src/common/facedir.h b/src/common/facedir.h
new file mode 100644 (file)
index 0000000..b676f0e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _FACEDIR_H_
+#define _FACEDIR_H_
+
+#include "types.h"
+
+extern v3s32 facedir[];
+
+#endif // _FACEDIR_H_
diff --git a/src/common/interrupt.c b/src/common/interrupt.c
new file mode 100644 (file)
index 0000000..590b16f
--- /dev/null
@@ -0,0 +1,51 @@
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include "common/interrupt.h"
+
+Flag interrupt;
+
+#ifdef _WIN32
+
+// just the signals we need, for Win32
+static const char *strsignal(int sig)
+{
+       switch (sig) {
+               case SIGINT:
+                       return "Interrupted";
+
+               case SIGTERM:
+                       return "Terminated";
+
+               default:
+                       return "Unknown signal";
+       }
+}
+
+#endif // _WIN32
+
+static void interrupt_handler(int sig)
+{
+       fprintf(stderr, "%s\n", strsignal(sig));
+       flag_set(&interrupt);
+}
+
+void interrupt_init()
+{
+       flag_ini(&interrupt);
+
+#ifdef _WIN32
+       signal(SIGINT, interrupt_handler);
+       signal(SIGTERM, interrupt_handler);
+#else // _WIN32
+       struct sigaction sa = {0};
+       sa.sa_handler = &interrupt_handler;
+       sigaction(SIGINT, &sa, NULL);
+       sigaction(SIGTERM, &sa, NULL);
+#endif // _WIN32
+}
+
+void interrupt_deinit()
+{
+       flag_dst(&interrupt);
+}
diff --git a/src/common/interrupt.h b/src/common/interrupt.h
new file mode 100644 (file)
index 0000000..9cf840b
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _INTERRUPT_H_
+#define _INTERRUPT_H_
+
+#include <dragonstd/flag.h>
+
+void interrupt_init();
+void interrupt_deinit();
+
+extern Flag interrupt;
+
+#endif // _INTERRUPT_H_
diff --git a/src/common/item.c b/src/common/item.c
new file mode 100644 (file)
index 0000000..f589ce0
--- /dev/null
@@ -0,0 +1,97 @@
+#include <stdlib.h>
+#include "common/item.h"
+
+void item_stack_initialize(ItemStack *stack)
+{
+       stack->type = ITEM_NONE;
+       stack->count = 1;
+       stack->data = NULL;
+
+       if (item_def[stack->type].callbacks.create)
+               item_def[stack->type].callbacks.create(stack);
+}
+
+void item_stack_destroy(ItemStack *stack)
+{
+       if (item_def[stack->type].callbacks.delete)
+               item_def[stack->type].callbacks.delete(stack);
+
+       if (stack->data) {
+               free(stack->data);
+               stack->data = NULL;
+       }
+}
+
+void item_stack_set(ItemStack *stack, ItemType type, u32 count, Blob buffer)
+{
+       item_stack_destroy(stack);
+
+       stack->type = type;
+       stack->count = count;
+       stack->data = item_def[stack->type].data_size > 0 ?
+               malloc(item_def[stack->type].data_size) : NULL;
+
+       if (item_def[stack->type].callbacks.create)
+               item_def[stack->type].callbacks.create(stack);
+
+       if (item_def[stack->type].callbacks.deserialize)
+               item_def[stack->type].callbacks.deserialize(&buffer, stack->data);
+}
+
+void item_stack_serialize(ItemStack *stack, SerializedItemStack *serialized)
+{
+       serialized->type = stack->type;
+       serialized->count = stack->count;
+       serialized->data = (Blob) {0, NULL};
+
+       if (item_def[stack->type].callbacks.serialize)
+               item_def[stack->type].callbacks.serialize(&serialized->data, stack->data);
+}
+
+void item_stack_deserialize(ItemStack *stack, SerializedItemStack *serialized)
+{
+       ItemType type = serialized->type;
+
+       if (type >= COUNT_ITEM)
+               type = ITEM_UNKNOWN;
+
+       item_stack_set(stack, type, serialized->count, serialized->data);
+}
+
+ItemDef item_def[COUNT_ITEM] = {
+       // unknown
+       {
+               .stackable = false,
+               .data_size = 0,
+               .dig_class = DIG_NONE,
+               .callbacks = {NULL},
+       },
+       // none
+       {
+               .stackable = false,
+               .data_size = 0,
+               .dig_class = DIG_NONE,
+               .callbacks = {NULL},
+       },
+       // pickaxe
+       {
+               .stackable = false,
+               .data_size = 0,
+               .dig_class = DIG_STONE,
+               .callbacks = {NULL},
+       },
+       // axe
+       {
+               .stackable = false,
+               .data_size = 0,
+               .dig_class = DIG_WOOD,
+               .callbacks = {NULL},
+       },
+       // shovel
+       {
+               .stackable = false,
+               .data_size = 0,
+               .dig_class = DIG_DIRT,
+               .callbacks = {NULL},
+       },
+};
diff --git a/src/common/item.h b/src/common/item.h
new file mode 100644 (file)
index 0000000..ffefd61
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef _ITEM_H_
+#define _ITEM_H_
+
+#include <stdbool.h>
+#include <stddef.h>
+#include "common/dig.h"
+#include "types.h"
+
+typedef enum {
+       ITEM_UNKNOWN,
+       ITEM_NONE,
+       ITEM_PICKAXE,
+       ITEM_AXE,
+       ITEM_SHOVEL,
+       COUNT_ITEM,
+} ItemType;
+
+typedef struct {
+       ItemType type;
+       u32 count; // i know future me is going to thank me for making it big
+       void *data;
+} ItemStack;
+
+typedef struct {
+       bool stackable;
+       size_t data_size;
+       DigClass dig_class;
+       struct {
+               void (*create)(ItemStack *stack);
+               void (*delete)(ItemStack *stack);
+               void (*serialize)(Blob *buffer, void *data);
+               void (*deserialize)(Blob *buffer, void *data);
+       } callbacks;
+} ItemDef;
+
+void item_stack_initialize(ItemStack *stack);
+void item_stack_destroy(ItemStack *stack);
+
+void item_stack_set(ItemStack *stack, ItemType type, u32 count, Blob buffer);
+void item_stack_serialize(ItemStack *stack, SerializedItemStack *serialized);
+void item_stack_deserialize(ItemStack *stack, SerializedItemStack *serialized);
+
+extern ItemDef item_def[];
+
+#endif // _ITEM_H_
diff --git a/src/common/node.c b/src/common/node.c
new file mode 100644 (file)
index 0000000..b2422b8
--- /dev/null
@@ -0,0 +1,87 @@
+#include "common/dig.h"
+#include "common/node.h"
+#include "common/terrain.h"
+#include "types.h"
+
+NodeDef node_def[COUNT_NODE] = {
+       // unknown
+       {
+               .solid = true,
+               .dig_class = DIG_NONE,
+       },
+       // air
+       {
+               .solid = false,
+               .dig_class = DIG_NONE,
+       },
+       // grass
+       {
+               .solid = true,
+               .dig_class = DIG_DIRT,
+       },
+       // dirt
+       {
+               .solid = true,
+               .dig_class = DIG_DIRT,
+       },
+       // stone
+       {
+               .solid = true,
+               .dig_class = DIG_STONE,
+       },
+       // snow
+       {
+               .solid = true,
+               .dig_class = DIG_DIRT,
+       },
+       // oak wood
+       {
+               .solid = true,
+               .dig_class = DIG_WOOD,
+       },
+       // oak leaves
+       {
+               .solid = true,
+               .dig_class = DIG_LEAVES,
+       },
+       // pine wood
+       {
+               .solid = true,
+               .dig_class = DIG_WOOD,
+       },
+       // pine leaves
+       {
+               .solid = true,
+               .dig_class = DIG_LEAVES,
+       },
+       // palm wood
+       {
+               .solid = true,
+               .dig_class = DIG_WOOD,
+       },
+       // palm leaves
+       {
+               .solid = true,
+               .dig_class = DIG_LEAVES,
+       },
+       // sand
+       {
+               .solid = true,
+               .dig_class = DIG_DIRT,
+       },
+       // water
+       {
+               .solid = false,
+               .dig_class = DIG_NONE,
+       },
+       // lava
+       {
+               .solid = false,
+               .dig_class = DIG_NONE,
+       },
+       // vulcanostone
+       {
+               .solid = true,
+               .dig_class = DIG_STONE,
+       },
+};
diff --git a/src/common/node.h b/src/common/node.h
new file mode 100644 (file)
index 0000000..ef21713
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef _NODE_H_
+#define _NODE_H_
+
+#include <stdbool.h>
+#include <stddef.h>
+#include "types.h"
+
+#define NODES_TREE case NODE_OAK_WOOD: case NODE_OAK_LEAVES: case NODE_PINE_WOOD: case NODE_PINE_LEAVES: case NODE_PALM_WOOD: case NODE_PALM_LEAVES:
+
+typedef enum {
+       NODE_UNKNOWN,       // Used for unknown nodes received from server (caused by outdated clients)
+       NODE_AIR,
+       NODE_GRASS,
+       NODE_DIRT,
+       NODE_STONE,
+       NODE_SNOW,
+       NODE_OAK_WOOD,
+       NODE_OAK_LEAVES,
+       NODE_PINE_WOOD,
+       NODE_PINE_LEAVES,
+       NODE_PALM_WOOD,
+       NODE_PALM_LEAVES,
+       NODE_SAND,
+       NODE_WATER,
+       NODE_LAVA,
+       NODE_VULCANO_STONE,
+       COUNT_NODE,      // Used for nodes in unloaded chunks
+} NodeType;
+
+struct TerrainNode;
+
+typedef struct {
+       bool solid;
+       unsigned long dig_class;
+} NodeDef;
+
+extern NodeDef node_def[];
+
+#endif
diff --git a/src/common/perlin.c b/src/common/perlin.c
new file mode 100644 (file)
index 0000000..687e778
--- /dev/null
@@ -0,0 +1,3 @@
+#include "common/perlin.h"
+
+s32 seed = 0;
diff --git a/src/common/perlin.h b/src/common/perlin.h
new file mode 100644 (file)
index 0000000..4bc27a7
--- /dev/null
@@ -0,0 +1,39 @@
+#ifndef _PERLIN_H_
+#define _PERLIN_H_
+
+#include_next <perlin.h>
+#include "types.h"
+
+#define U32(x) (((u32) 1 << 31) + (x))
+
+typedef enum {
+       OFFSET_NONE,
+       OFFSET_HEIGHT,
+       OFFSET_MOUNTAIN,
+       OFFSET_OCEAN,
+       OFFSET_MOUNTAIN_HEIGHT,
+       OFFSET_BOULDER,
+       OFFSET_WETNESS,
+       OFFSET_TEXTURE_OFFSET_S,
+       OFFSET_TEXTURE_OFFSET_T,
+       OFFSET_TEMPERATURE,
+       OFFSET_VULCANO,
+       OFFSET_VULCANO_HEIGHT,
+       OFFSET_VULCANO_STONE,
+       OFFSET_VULCANO_CRATER_TOP,
+       OFFSET_HILLYNESS,
+       OFFSET_VOXEL_PROCEDURAL,
+       OFFSET_OAKTREE,
+       OFFSET_OAKTREE_AREA,
+       OFFSET_PINETREE,
+       OFFSET_PINETREE_AREA,
+       OFFSET_PINETREE_HEIGHT,
+       OFFSET_PINETREE_BRANCH,
+       OFFSET_PINETREE_BRANCH_DIR,
+       OFFSET_PALMTREE,
+       OFFSET_PALMTREE_AREA,
+} SeedOffset;
+
+extern s32 seed;
+
+#endif // _PERLIN_H_
diff --git a/src/common/physics.c b/src/common/physics.c
new file mode 100644 (file)
index 0000000..9209790
--- /dev/null
@@ -0,0 +1,125 @@
+#include <math.h>
+#include "common/physics.h"
+
+static aabb3f64 move_box(aabb3f32 box, v3f64 pos)
+{
+       return (aabb3f64) {
+               {pos.x + box.min.x, pos.y + box.min.y, pos.z + box.min.z},
+               {pos.x + box.max.x, pos.y + box.max.y, pos.z + box.max.z},
+       };
+}
+
+static aabb3s32 round_box(aabb3f64 box)
+{
+       return (aabb3s32) {
+               {floor(box.min.x + 0.5), floor(box.min.y + 0.5), floor(box.min.z + 0.5)},
+               { ceil(box.max.x - 0.5),  ceil(box.max.y - 0.5),  ceil(box.max.z - 0.5)},
+       };
+}
+
+static bool is_solid(Terrain *terrain, s32 x, s32 y, s32 z)
+{
+       NodeType node = terrain_get_node(terrain, (v3s32) {x, y, z}).type;
+       return node == COUNT_NODE || node_def[node].solid;
+}
+
+bool physics_ground(Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel)
+{
+       if (!collide)
+               return false;
+
+       if (vel->y != 0.0)
+               return false;
+
+       aabb3f64 mbox = move_box(box, *pos);
+       mbox.min.y -= 0.5;
+
+       aabb3s32 rbox = round_box(mbox);
+
+       if (mbox.min.y - (f64) rbox.min.y > 0.01)
+               return false;
+
+       for (s32 x = rbox.min.x; x <= rbox.max.x; x++)
+               for (s32 z = rbox.min.z; z <= rbox.max.z; z++)
+                       if (is_solid(terrain, x, rbox.min.y, z))
+                               return true;
+
+       return false;
+}
+
+bool physics_step(Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel, v3f64 *acc, f64 t)
+{
+       v3f64 old_pos = *pos;
+
+       f64 *x = &pos->x;
+       f64 *v = &vel->x;
+       f64 *a = &acc->x;
+
+       f32 *min = &box.min.x;
+       f32 *max = &box.max.x;
+
+       static u8 idx[3][3] = {
+               {0, 1, 2},
+               {1, 0, 2},
+               {2, 0, 1},
+       };
+
+       for (u8 i = 0; i < 3; i++) {
+               f64 v_old = v[i];
+               v[i] += a[i] * t;
+               f64 v_cur = (v[i] + v_old) / 2.0;
+               if (v_cur == 0.0)
+                       continue;
+
+               f64 x_old = x[i];
+               x[i] += v_cur * t;
+               if (!collide)
+                       continue;
+
+               aabb3s32 box_rnd = round_box(move_box(box, *pos));
+
+               s32 dir;
+               f32 off;
+               s32 *min_rnd = &box_rnd.min.x;
+               s32 *max_rnd = &box_rnd.max.x;
+
+               if (v[i] > 0.0) {
+                       dir = +1;
+                       off = max[i];
+
+                       min_rnd[i] = ceil(x_old + off + 0.5);
+                       max_rnd[i] = floor(x[i] + off + 0.5);
+               } else {
+                       dir = -1;
+                       off = min[i];
+
+                       min_rnd[i] = floor(x_old + off - 0.5);
+                       max_rnd[i] =   ceil(x[i] + off - 0.5);
+               }
+
+               max_rnd[i] += dir;
+
+               u8 i_a = idx[i][0]; // = i
+               u8 i_b = idx[i][1];
+               u8 i_c = idx[i][2];
+
+               for (s32 a = min_rnd[i_a]; a != max_rnd[i_a]; a += dir)
+               for (s32 b = min_rnd[i_b]; b <= max_rnd[i_b]; b++)
+               for (s32 c = min_rnd[i_c]; c <= max_rnd[i_c]; c++)      {
+                       s32 p[3];
+                       p[i_a] = a;
+                       p[i_b] = b;
+                       p[i_c] = c;
+
+                       if (is_solid(terrain, p[0], p[1], p[2])) {
+                               x[i] = (f64) a - off - 0.5 * (f64) dir;
+                               v[i] = 0.0;
+                               goto done;
+                       }
+               }
+
+               done: continue;
+       }
+
+       return !v3f64_equals(*pos, old_pos);
+}
diff --git a/src/common/physics.h b/src/common/physics.h
new file mode 100644 (file)
index 0000000..66d00dd
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef _PHYSICS_H_
+#define _PHYSICS_H_
+
+#include <stdbool.h>
+#include "common/terrain.h"
+#include "types.h"
+
+bool physics_ground(Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel);
+bool physics_step  (Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel, v3f64 *acc, f64 t);
+
+#endif // _PHYSICS_H_
diff --git a/src/common/terrain.c b/src/common/terrain.c
new file mode 100644 (file)
index 0000000..907cc5a
--- /dev/null
@@ -0,0 +1,249 @@
+#include <assert.h>
+#include <math.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include "common/terrain.h"
+
+typedef struct {
+       v2s32 pos;
+       Tree chunks;
+       pthread_rwlock_t lock;
+} TerrainSector;
+
+static TerrainChunk *allocate_chunk(v3s32 pos)
+{
+       TerrainChunk *chunk = malloc(sizeof * chunk);
+       chunk->level = pos.y;
+       chunk->pos = pos;
+       chunk->extra = NULL;
+       pthread_rwlock_init(&chunk->lock, NULL);
+
+       CHUNK_ITERATE
+               chunk->data[x][y][z] = (TerrainNode) {NODE_UNKNOWN, NULL};
+
+       return chunk;
+}
+
+static void free_chunk(Terrain *terrain, TerrainChunk *chunk)
+{
+       if (terrain->callbacks.delete_node) CHUNK_ITERATE
+               terrain->callbacks.delete_node(&chunk->data[x][y][z]);
+
+       pthread_rwlock_destroy(&chunk->lock);
+       free(chunk);
+}
+
+static void delete_chunk(TerrainChunk *chunk, Terrain *terrain)
+{
+       if (terrain->callbacks.delete_chunk)
+               terrain->callbacks.delete_chunk(chunk);
+
+       free_chunk(terrain, chunk);
+}
+
+static void delete_sector(TerrainSector *sector, Terrain *terrain)
+{
+       tree_clr(&sector->chunks, &delete_chunk, terrain, NULL, 0);
+       pthread_rwlock_destroy(&sector->lock);
+       free(sector);
+}
+
+static TerrainSector *get_sector(Terrain *terrain, v2s32 pos, int mode)
+{
+       if (mode == CHUNK_MODE_CREATE)
+               pthread_rwlock_wrlock(&terrain->lock);
+       else
+               pthread_rwlock_rdlock(&terrain->lock);
+
+       TreeNode **loc = tree_nfd(&terrain->sectors, &pos, &v2s32_cmp);
+       TerrainSector *sector = NULL;
+
+       if (*loc) {
+               sector = (*loc)->dat;
+       } else if (mode == CHUNK_MODE_CREATE) {
+               sector = malloc(sizeof *sector);
+               sector->pos = pos;
+               tree_ini(&sector->chunks);
+               pthread_rwlock_init(&sector->lock, NULL);
+
+               tree_nmk(&terrain->sectors, loc, sector);
+       }
+
+       pthread_rwlock_unlock(&terrain->lock);
+
+       return sector;
+}
+
+Terrain *terrain_create()
+{
+       Terrain *terrain = malloc(sizeof *terrain);
+       tree_ini(&terrain->sectors);
+       pthread_rwlock_init(&terrain->lock, NULL);
+       terrain->cache = NULL;
+       pthread_rwlock_init(&terrain->cache_lock, NULL);
+       return terrain;
+}
+
+void terrain_delete(Terrain *terrain)
+{
+       tree_clr(&terrain->sectors, &delete_sector, terrain, NULL, 0);
+       pthread_rwlock_destroy(&terrain->lock);
+       pthread_rwlock_destroy(&terrain->cache_lock);
+       free(terrain);
+}
+
+TerrainChunk *terrain_get_chunk(Terrain *terrain, v3s32 pos, int mode)
+{
+       TerrainChunk *cache = NULL;
+
+       pthread_rwlock_rdlock(&terrain->cache_lock);
+       cache = terrain->cache;
+       pthread_rwlock_unlock(&terrain->cache_lock);
+
+       if (cache && v3s32_equals(cache->pos, pos))
+               return cache;
+
+       TerrainSector *sector = get_sector(terrain, (v2s32) {pos.x, pos.z}, mode);
+       if (!sector)
+               return NULL;
+
+       if (mode == CHUNK_MODE_CREATE)
+               pthread_rwlock_wrlock(&sector->lock);
+       else
+               pthread_rwlock_rdlock(&sector->lock);
+
+       TreeNode **loc = tree_nfd(&sector->chunks, &pos.y, &s32_cmp);
+       TerrainChunk *chunk = NULL;
+
+       if (*loc) {
+               chunk = (*loc)->dat;
+
+               if (terrain->callbacks.get_chunk && !terrain->callbacks.get_chunk(chunk, mode)) {
+                       chunk = NULL;
+               } else {
+                       pthread_rwlock_wrlock(&terrain->cache_lock);
+                       terrain->cache = chunk;
+                       pthread_rwlock_unlock(&terrain->cache_lock);
+               }
+       } else if (mode == CHUNK_MODE_CREATE) {
+               tree_nmk(&sector->chunks, loc, chunk = allocate_chunk(pos));
+
+               if (terrain->callbacks.create_chunk)
+                       terrain->callbacks.create_chunk(chunk);
+       }
+
+       pthread_rwlock_unlock(&sector->lock);
+
+       return chunk;
+}
+
+TerrainChunk *terrain_get_chunk_nodep(Terrain *terrain, v3s32 nodep, v3s32 *offset, int mode)
+{
+       TerrainChunk *chunk = terrain_get_chunk(terrain, terrain_chunkp(nodep), mode);
+       if (!chunk)
+               return NULL;
+       *offset = terrain_offset(nodep);
+       return chunk;
+}
+
+Blob terrain_serialize_chunk(__attribute__((unused)) Terrain *terrain, TerrainChunk *chunk, void (*callback)(TerrainNode *node, Blob *buffer))
+{
+       bool empty = true;
+
+       CHUNK_ITERATE {
+               if (chunk->data[x][y][z].type != NODE_AIR) {
+                       empty = false;
+                       break;
+               }
+       }
+
+       if (empty)
+               return (Blob) {0, NULL};
+
+       SerializedTerrainChunk serialized_chunk;
+
+       CHUNK_ITERATE {
+               TerrainNode *node = &chunk->data[x][y][z];
+               SerializedTerrainNode *serialized = &serialized_chunk.raw.nodes[x][y][z];
+
+               serialized->type = node->type;
+               serialized->data = (Blob) {0, NULL};
+
+               if (callback)
+                       callback(node, &serialized->data);
+       }
+
+       Blob buffer = {0, NULL};
+       SerializedTerrainChunk_write(&buffer, &serialized_chunk);
+       SerializedTerrainChunk_free(&serialized_chunk);
+       return buffer;
+}
+
+bool terrain_deserialize_chunk(Terrain *terrain, TerrainChunk *chunk, Blob buffer, void (*callback)(TerrainNode *node, Blob buffer))
+{
+       if (buffer.siz == 0) {
+               CHUNK_ITERATE {
+                       if (terrain->callbacks.delete_node)
+                               terrain->callbacks.delete_node(&chunk->data[x][y][z]);
+
+                       chunk->data[x][y][z] = (TerrainNode) {NODE_AIR, NULL};
+               }
+
+               return true;
+       }
+
+       // it's important to copy Blobs that have been malloc'd before reading from them
+       // because reading from a Blob modifies its data and size pointer,
+       // but does not free anything
+       SerializedTerrainChunk serialized_chunk = {0};
+       bool success = SerializedTerrainChunk_read(&buffer, &serialized_chunk);
+
+       if (success) CHUNK_ITERATE {
+               if (terrain->callbacks.delete_node)
+                       terrain->callbacks.delete_node(&chunk->data[x][y][z]);
+
+               TerrainNode *node = &chunk->data[x][y][z];
+               SerializedTerrainNode *serialized = &serialized_chunk.raw.nodes[x][y][z];
+
+               node->type = serialized->type;
+
+               if (callback)
+                       callback(node, serialized->data);
+       }
+
+       SerializedTerrainChunk_free(&serialized_chunk);
+       return success;
+}
+
+TerrainNode terrain_get_node(Terrain *terrain, v3s32 pos)
+{
+       v3s32 offset;
+       TerrainChunk *chunk = terrain_get_chunk_nodep(terrain, pos, &offset, CHUNK_MODE_PASSIVE);
+       if (!chunk)
+               return (TerrainNode) {COUNT_NODE, NULL};
+
+       assert(pthread_rwlock_rdlock(&chunk->lock) == 0);
+       TerrainNode node = chunk->data[offset.x][offset.y][offset.z];
+       pthread_rwlock_unlock(&chunk->lock);
+
+       return node;
+}
+
+v3s32 terrain_chunkp(v3s32 pos)
+{
+       return (v3s32) {
+               floor((double) pos.x / (double) CHUNK_SIZE),
+               floor((double) pos.y / (double) CHUNK_SIZE),
+               floor((double) pos.z / (double) CHUNK_SIZE)};
+}
+
+v3s32 terrain_offset(v3s32 pos)
+{
+       return (v3s32) {
+               (u32) pos.x % CHUNK_SIZE,
+               (u32) pos.y % CHUNK_SIZE,
+               (u32) pos.z % CHUNK_SIZE};
+}
diff --git a/src/common/terrain.h b/src/common/terrain.h
new file mode 100644 (file)
index 0000000..46da156
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef _TERRAIN_H_
+#define _TERRAIN_H_
+
+#include <dragonstd/list.h>
+#include <dragonstd/tree.h>
+#include <stdbool.h>
+#include <pthread.h>
+#include "common/node.h"
+#include "types.h"
+
+#define CHUNK_ITERATE \
+       for (s32 x = 0; x < CHUNK_SIZE; x++) \
+       for (s32 y = 0; y < CHUNK_SIZE; y++) \
+       for (s32 z = 0; z < CHUNK_SIZE; z++)
+
+#define CHUNK_MODE_PASSIVE 0
+#define CHUNK_MODE_CREATE 1
+
+typedef struct TerrainNode {
+       NodeType type;
+       void *data;
+} TerrainNode;
+
+typedef TerrainNode TerrainChunkData[CHUNK_SIZE][CHUNK_SIZE][CHUNK_SIZE];
+
+typedef struct {
+       s32 level;
+       v3s32 pos;
+       TerrainChunkData data;
+       void *extra;
+       pthread_rwlock_t lock;
+} TerrainChunk;
+
+typedef struct {
+       Tree sectors;
+       pthread_rwlock_t lock;
+       TerrainChunk *cache;
+       pthread_rwlock_t cache_lock;
+       struct {
+               void (*create_chunk)(TerrainChunk *chunk);
+               void (*delete_chunk)(TerrainChunk *chunk);
+               bool (*get_chunk)(TerrainChunk *chunk, int mode);
+               void (*delete_node)(TerrainNode *node);
+       } callbacks;
+} Terrain;
+
+Terrain *terrain_create();
+void terrain_delete(Terrain *terrain);
+
+TerrainChunk *terrain_get_chunk(Terrain *terrain, v3s32 pos, int mode);
+TerrainChunk *terrain_get_chunk_nodep(Terrain *terrain, v3s32 node_pos, v3s32 *offset, int mode);
+
+Blob terrain_serialize_chunk(Terrain *terrain, TerrainChunk *chunk, void (*callback)(TerrainNode *node, Blob *buffer));
+bool terrain_deserialize_chunk(Terrain *terrain, TerrainChunk *chunk, Blob buffer, void (*callback)(TerrainNode *node, Blob buffer));
+
+TerrainNode terrain_get_node(Terrain *terrain, v3s32 pos);
+
+v3s32 terrain_chunkp(v3s32 pos);
+v3s32 terrain_offset(v3s32 pos);
+
+#endif
diff --git a/src/config.c b/src/config.c
deleted file mode 100644 (file)
index 8f200c8..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
-#include "config.h"
-
-void config_read(char *path, ConfigEntry *entries, size_t num_entries)
-{
-       FILE *f = fopen(path, "r");
-
-       if (!f)
-               return;
-
-       printf("[info] reading config from %s\n", path);
-
-       while (!feof(f)) {
-               char key[BUFSIZ];
-               if (!fscanf(f, "%s", key))
-                       break;
-
-               bool found = false;
-               for (size_t i = 0; i < num_entries; i++) {
-                       ConfigEntry *entry = &entries[i];
-                       if (strcmp(key, entry->key) == 0) {
-                               bool valid = false;
-
-                               switch (entry->type) {
-                                       case CONFIG_STRING: {
-                                               char value[BUFSIZ];
-
-                                               if (!fscanf(f, "%s", value))
-                                                       break;
-
-                                               valid = true;
-
-                                               char **entry_value = entry->value;
-
-                                               if (*entry_value)
-                                                       free(*entry_value);
-                                               *entry_value = strdup(value);
-
-                                               break;
-                                       }
-
-                                       case CONFIG_INT:
-                                               if (fscanf(f, "%d", (int *) entry->value))
-                                                       valid = true;
-
-                                               break;
-
-                                       case CONFIG_UINT:
-                                               if (fscanf(f, "%u", (unsigned int *) entry->value))
-                                                       valid = true;
-
-                                               break;
-
-                                       case CONFIG_FLOAT:
-                                               if (fscanf(f, "%lf", (double *) entry->value))
-                                                       valid = true;
-
-                                               break;
-
-                                       case CONFIG_BOOL: {
-                                               char value[BUFSIZ];
-
-                                               if (!fscanf(f, "%s", value))
-                                                       break;
-
-                                               valid = true;
-
-                                               if (strcmp(value, "on") == 0 || strcmp(value, "yes") == 0 || strcmp(value, "true") == 0)
-                                                       *(bool *) entry->value = true;
-                                               else if (strcmp(value, "off") == 0 || strcmp(value, "no") == 0 || strcmp(value, "false") == 0)
-                                                       *(bool *) entry->value = false;
-                                               else
-                                                       valid = false;
-
-                                               break;
-                                       }
-                               }
-
-                               if (!valid)
-                                       fprintf(stderr, "[warning] invalid value for setting %s in %s\n", key, path);
-
-                               found = true;
-                               break;
-                       }
-               }
-
-               if (!found)
-                       fprintf(stderr, "[warning] unknown setting %s in %s\n", key, path);
-       }
-
-       fclose(f);
-}
-
-void config_free(ConfigEntry *entries, size_t num_entries)
-{
-       for (size_t i = 0; i < num_entries; i++) {
-               ConfigEntry *entry = &entries[i];
-
-               if (entry->type == CONFIG_STRING) {
-                       char **entry_value = entry->value;
-
-                       if (*entry_value)
-                               free(*entry_value);
-               }
-       }
-}
diff --git a/src/config.h b/src/config.h
deleted file mode 100644 (file)
index c7eeab3..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef _CONFIG_H_
-#define _CONFIG_H_
-
-#include <stddef.h>
-
-typedef enum {
-       CONFIG_STRING,
-       CONFIG_INT,
-       CONFIG_UINT,
-       CONFIG_FLOAT,
-       CONFIG_BOOL,
-} ConfigType;
-
-typedef struct {
-       ConfigType type;
-       char *key;
-       void *value;
-} ConfigEntry;
-
-void config_read(char *path, ConfigEntry *entries, size_t num_entries);
-void config_free(ConfigEntry *entries, size_t num_entires);
-
-#endif // _CONFIG_H_
diff --git a/src/day.c b/src/day.c
deleted file mode 100644 (file)
index e28e21b..0000000
--- a/src/day.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <math.h>
-#include <time.h>
-#include "day.h"
-
-bool timelapse = false;
-static f64 time_of_day_offset;
-
-f64 get_unix_time()
-{
-       struct timespec ts;
-       clock_gettime(CLOCK_REALTIME, &ts);
-       return ((f64) ts.tv_sec + ts.tv_nsec / 1.0e9) * (timelapse ? 100.0 : 1.0);
-}
-
-f64 get_time_of_day()
-{
-       return fmod(get_unix_time() - time_of_day_offset, MINUTES_PER_DAY);
-}
-
-void set_time_of_day(f64 new_time)
-{
-       time_of_day_offset = get_unix_time() - new_time;
-}
-
-f64 get_sun_angle()
-{
-       return 2.0 * M_PI * (f64) get_time_of_day() / MINUTES_PER_DAY + M_PI;
-}
-
-f64 get_daylight()
-{
-       return f64_clamp(cos(get_sun_angle()) * 2.0 + 0.5, 0.0, 1.0);
-}
-
-void split_time_of_day(int *hours, int *minutes)
-{
-       int time_of_day = get_time_of_day();
-
-       *minutes = time_of_day % MINUTES_PER_HOUR;
-       *hours = time_of_day / MINUTES_PER_HOUR;
-}
diff --git a/src/day.h b/src/day.h
deleted file mode 100644 (file)
index 75cf3e9..0000000
--- a/src/day.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef _DAY_H_
-#define _DAY_H_
-
-#include <stdbool.h>
-#include "types.h"
-
-#define MINUTES_PER_HOUR 60
-#define HOURS_PER_DAY 24
-#define MINUTES_PER_DAY (HOURS_PER_DAY * MINUTES_PER_HOUR)
-
-// 1 second in real life = 1 minute ingame
-
-f64 get_time_of_day();
-void set_time_of_day(f64 new_time);
-f64 get_sun_angle();
-f64 get_daylight();
-void split_time_of_day(int *hours, int *minutes);
-
-extern bool timelapse;
-
-#endif // _DAY_H_
diff --git a/src/debug.sh b/src/debug.sh
deleted file mode 100755 (executable)
index cc4cd54..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-
-if ! make -j$(nproc); then
-       exit 1
-fi
-
-DEBUG_DIR=/tmp/dragonblocks_alpha_debug_$$/
-mkdir $DEBUG_DIR
-
-echo "singleplayer" > $DEBUG_DIR/name
-
-COMMON="set confirm off
-handle SIGTERM nostop print pass
-handle SIGPIPE nostop noprint pass
-set height 0
-set \$_exitcode=1
-define hook-stop
-    if \$_exitcode == 0
-        quit
-    end
-end
-"
-
-echo "$COMMON
-break gl_error
-run \"[::1]:4000\" < $DEBUG_DIR/name
-" > $DEBUG_DIR/client_script
-
-echo "$COMMON
-set print thread-events off
-run \"[::1]:4000\"
-" > $DEBUG_DIR/server_script
-
-alacritty -e bash -c "
-       echo \$\$ > $DEBUG_DIR/server_pid
-       exec gdb --command $DEBUG_DIR/server_script ./dragonblocks_server
-" &
-sleep 0.5
-
-gdb --command $DEBUG_DIR/client_script ./dragonblocks
-
-kill `cat $DEBUG_DIR/server_pid`
-
-rm -rf $DEBUG_DIR
diff --git a/src/debug_loop.sh b/src/debug_loop.sh
deleted file mode 100755 (executable)
index 3c6c460..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-COMMAND="./debug.sh"
-
-if [[ $1 == "terrain" ]]; then
-       COMMAND="./debug_terrain.sh"
-fi
-
-while true; do
-       if ! $COMMAND; then
-               read
-       fi
-done
diff --git a/src/debug_terrain.sh b/src/debug_terrain.sh
deleted file mode 100755 (executable)
index 7da1b80..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-rm -f *.sqlite
-./debug.sh
diff --git a/src/dig.h b/src/dig.h
deleted file mode 100644 (file)
index 3885ae4..0000000
--- a/src/dig.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef _DIG_H_
-#define _DIG_H_
-
-typedef enum {
-       DIG_NONE = 0x0,
-       DIG_STONE = 0x01,
-       DIG_WOOD = 0x02,
-       DIG_DIRT = 0x04,
-       DIG_LEAVES = 0x08,
-} DigClass;
-
-#endif // _DIG_H_
diff --git a/src/entity.h b/src/entity.h
deleted file mode 100644 (file)
index f564cee..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _ENTITY_H_
-#define _ENTITY_H_
-
-// ET phone home
-typedef enum {
-       ENTITY_LOCALPLAYER,
-       ENTITY_PLAYER,
-       COUNT_ENTITY,
-} EntityType;
-
-#endif // _ENTITY_H_
diff --git a/src/environment.c b/src/environment.c
deleted file mode 100644 (file)
index 200eee7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "environment.h"
-#include "perlin.h"
-
-f64 get_humidity(v3s32 pos)
-{
-       return smooth2d(U32(pos.x) / 128.0, U32(pos.z) / 128.0, 0, seed + OFFSET_WETNESS) * 0.5 + 0.5;
-}
-
-f64 get_temperature(v3s32 pos)
-{
-       return smooth2d(U32(pos.x) / 128.0, U32(pos.z) / 128.0, 0, seed + OFFSET_TEMPERATURE) * 0.5 + 0.5 - (pos.y - 32.0) / 64.0;
-}
diff --git a/src/environment.h b/src/environment.h
deleted file mode 100644 (file)
index f9a3ef7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _ENVIRONMENT_H_
-#define _ENVIRONMENT_H_
-
-#include "types.h"
-
-f64 get_humidity(v3s32 pos);
-f64 get_temperature(v3s32 pos);
-
-#endif // _ENVIRONMENT_H_
diff --git a/src/facedir.c b/src/facedir.c
deleted file mode 100644 (file)
index e1125a9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#include "facedir.h"
-
-v3s32 facedir[6] = {
-       {+0, +0, -1},
-       {+0, +0, +1},
-       {-1, +0, +0},
-       {+1, +0, +0},
-       {+0, -1, +0},
-       {+0, +1, +0},
-};
diff --git a/src/facedir.h b/src/facedir.h
deleted file mode 100644 (file)
index b676f0e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _FACEDIR_H_
-#define _FACEDIR_H_
-
-#include "types.h"
-
-extern v3s32 facedir[];
-
-#endif // _FACEDIR_H_
diff --git a/src/interrupt.c b/src/interrupt.c
deleted file mode 100644 (file)
index 2b9052c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#include <signal.h>
-#include <stdio.h>
-#include <string.h>
-#include "interrupt.h"
-
-Flag interrupt;
-
-#ifdef _WIN32
-
-// just the signals we need, for Win32
-static const char *strsignal(int sig)
-{
-       switch (sig) {
-               case SIGINT:
-                       return "Interrupted";
-
-               case SIGTERM:
-                       return "Terminated";
-
-               default:
-                       return "Unknown signal";
-       }
-}
-
-#endif // _WIN32
-
-static void interrupt_handler(int sig)
-{
-       fprintf(stderr, "%s\n", strsignal(sig));
-       flag_set(&interrupt);
-}
-
-void interrupt_init()
-{
-       flag_ini(&interrupt);
-
-#ifdef _WIN32
-       signal(SIGINT, interrupt_handler);
-       signal(SIGTERM, interrupt_handler);
-#else // _WIN32
-       struct sigaction sa = {0};
-       sa.sa_handler = &interrupt_handler;
-       sigaction(SIGINT, &sa, NULL);
-       sigaction(SIGTERM, &sa, NULL);
-#endif // _WIN32
-}
-
-void interrupt_deinit()
-{
-       flag_dst(&interrupt);
-}
diff --git a/src/interrupt.h b/src/interrupt.h
deleted file mode 100644 (file)
index 9cf840b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _INTERRUPT_H_
-#define _INTERRUPT_H_
-
-#include <dragonstd/flag.h>
-
-void interrupt_init();
-void interrupt_deinit();
-
-extern Flag interrupt;
-
-#endif // _INTERRUPT_H_
diff --git a/src/item.c b/src/item.c
deleted file mode 100644 (file)
index b492aa9..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <stdlib.h>
-#include "item.h"
-
-void item_stack_initialize(ItemStack *stack)
-{
-       stack->type = ITEM_NONE;
-       stack->count = 1;
-       stack->data = NULL;
-
-       if (item_def[stack->type].callbacks.create)
-               item_def[stack->type].callbacks.create(stack);
-}
-
-void item_stack_destroy(ItemStack *stack)
-{
-       if (item_def[stack->type].callbacks.delete)
-               item_def[stack->type].callbacks.delete(stack);
-
-       if (stack->data) {
-               free(stack->data);
-               stack->data = NULL;
-       }
-}
-
-void item_stack_set(ItemStack *stack, ItemType type, u32 count, Blob buffer)
-{
-       item_stack_destroy(stack);
-
-       stack->type = type;
-       stack->count = count;
-       stack->data = item_def[stack->type].data_size > 0 ?
-               malloc(item_def[stack->type].data_size) : NULL;
-
-       if (item_def[stack->type].callbacks.create)
-               item_def[stack->type].callbacks.create(stack);
-
-       if (item_def[stack->type].callbacks.deserialize)
-               item_def[stack->type].callbacks.deserialize(&buffer, stack->data);
-}
-
-void item_stack_serialize(ItemStack *stack, SerializedItemStack *serialized)
-{
-       serialized->type = stack->type;
-       serialized->count = stack->count;
-       serialized->data = (Blob) {0, NULL};
-
-       if (item_def[stack->type].callbacks.serialize)
-               item_def[stack->type].callbacks.serialize(&serialized->data, stack->data);
-}
-
-void item_stack_deserialize(ItemStack *stack, SerializedItemStack *serialized)
-{
-       ItemType type = serialized->type;
-
-       if (type >= COUNT_ITEM)
-               type = ITEM_UNKNOWN;
-
-       item_stack_set(stack, type, serialized->count, serialized->data);
-}
-
-ItemDef item_def[COUNT_ITEM] = {
-       // unknown
-       {
-               .stackable = false,
-               .data_size = 0,
-               .dig_class = DIG_NONE,
-               .callbacks = {NULL},
-       },
-       // none
-       {
-               .stackable = false,
-               .data_size = 0,
-               .dig_class = DIG_NONE,
-               .callbacks = {NULL},
-       },
-       // pickaxe
-       {
-               .stackable = false,
-               .data_size = 0,
-               .dig_class = DIG_STONE,
-               .callbacks = {NULL},
-       },
-       // axe
-       {
-               .stackable = false,
-               .data_size = 0,
-               .dig_class = DIG_WOOD,
-               .callbacks = {NULL},
-       },
-       // shovel
-       {
-               .stackable = false,
-               .data_size = 0,
-               .dig_class = DIG_DIRT,
-               .callbacks = {NULL},
-       },
-};
diff --git a/src/item.h b/src/item.h
deleted file mode 100644 (file)
index c794006..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _ITEM_H_
-#define _ITEM_H_
-
-#include <stdbool.h>
-#include <stddef.h>
-#include "dig.h"
-#include "types.h"
-
-typedef enum {
-       ITEM_UNKNOWN,
-       ITEM_NONE,
-       ITEM_PICKAXE,
-       ITEM_AXE,
-       ITEM_SHOVEL,
-       COUNT_ITEM,
-} ItemType;
-
-typedef struct {
-       ItemType type;
-       u32 count; // i know future me is going to thank me for making it big
-       void *data;
-} ItemStack;
-
-typedef struct {
-       bool stackable;
-       size_t data_size;
-       DigClass dig_class;
-       struct {
-               void (*create)(ItemStack *stack);
-               void (*delete)(ItemStack *stack);
-               void (*serialize)(Blob *buffer, void *data);
-               void (*deserialize)(Blob *buffer, void *data);
-       } callbacks;
-} ItemDef;
-
-void item_stack_initialize(ItemStack *stack);
-void item_stack_destroy(ItemStack *stack);
-
-void item_stack_set(ItemStack *stack, ItemType type, u32 count, Blob buffer);
-void item_stack_serialize(ItemStack *stack, SerializedItemStack *serialized);
-void item_stack_deserialize(ItemStack *stack, SerializedItemStack *serialized);
-
-extern ItemDef item_def[];
-
-#endif // _ITEM_H_
diff --git a/src/mingw.cmake b/src/mingw.cmake
new file mode 100644 (file)
index 0000000..2a51e36
--- /dev/null
@@ -0,0 +1,4 @@
+set(CMAKE_SYSTEM_NAME Windows)
+
+set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix)
+set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix)
diff --git a/src/node.c b/src/node.c
deleted file mode 100644 (file)
index e79352b..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#include "dig.h"
-#include "node.h"
-#include "terrain.h"
-#include "types.h"
-
-NodeDef node_def[COUNT_NODE] = {
-       // unknown
-       {
-               .solid = true,
-               .dig_class = DIG_NONE,
-       },
-       // air
-       {
-               .solid = false,
-               .dig_class = DIG_NONE,
-       },
-       // grass
-       {
-               .solid = true,
-               .dig_class = DIG_DIRT,
-       },
-       // dirt
-       {
-               .solid = true,
-               .dig_class = DIG_DIRT,
-       },
-       // stone
-       {
-               .solid = true,
-               .dig_class = DIG_STONE,
-       },
-       // snow
-       {
-               .solid = true,
-               .dig_class = DIG_DIRT,
-       },
-       // oak wood
-       {
-               .solid = true,
-               .dig_class = DIG_WOOD,
-       },
-       // oak leaves
-       {
-               .solid = true,
-               .dig_class = DIG_LEAVES,
-       },
-       // pine wood
-       {
-               .solid = true,
-               .dig_class = DIG_WOOD,
-       },
-       // pine leaves
-       {
-               .solid = true,
-               .dig_class = DIG_LEAVES,
-       },
-       // palm wood
-       {
-               .solid = true,
-               .dig_class = DIG_WOOD,
-       },
-       // palm leaves
-       {
-               .solid = true,
-               .dig_class = DIG_LEAVES,
-       },
-       // sand
-       {
-               .solid = true,
-               .dig_class = DIG_DIRT,
-       },
-       // water
-       {
-               .solid = false,
-               .dig_class = DIG_NONE,
-       },
-       // lava
-       {
-               .solid = false,
-               .dig_class = DIG_NONE,
-       },
-       // vulcanostone
-       {
-               .solid = true,
-               .dig_class = DIG_STONE,
-       },
-};
diff --git a/src/node.h b/src/node.h
deleted file mode 100644 (file)
index ef21713..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef _NODE_H_
-#define _NODE_H_
-
-#include <stdbool.h>
-#include <stddef.h>
-#include "types.h"
-
-#define NODES_TREE case NODE_OAK_WOOD: case NODE_OAK_LEAVES: case NODE_PINE_WOOD: case NODE_PINE_LEAVES: case NODE_PALM_WOOD: case NODE_PALM_LEAVES:
-
-typedef enum {
-       NODE_UNKNOWN,       // Used for unknown nodes received from server (caused by outdated clients)
-       NODE_AIR,
-       NODE_GRASS,
-       NODE_DIRT,
-       NODE_STONE,
-       NODE_SNOW,
-       NODE_OAK_WOOD,
-       NODE_OAK_LEAVES,
-       NODE_PINE_WOOD,
-       NODE_PINE_LEAVES,
-       NODE_PALM_WOOD,
-       NODE_PALM_LEAVES,
-       NODE_SAND,
-       NODE_WATER,
-       NODE_LAVA,
-       NODE_VULCANO_STONE,
-       COUNT_NODE,      // Used for nodes in unloaded chunks
-} NodeType;
-
-struct TerrainNode;
-
-typedef struct {
-       bool solid;
-       unsigned long dig_class;
-} NodeDef;
-
-extern NodeDef node_def[];
-
-#endif
diff --git a/src/perlin.c b/src/perlin.c
deleted file mode 100644 (file)
index d204e48..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "perlin.h"
-
-s32 seed = 0;
diff --git a/src/perlin.h b/src/perlin.h
deleted file mode 100644 (file)
index 2aab5e1..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef _PERLIN_H_
-#define _PERLIN_H_
-
-#include <perlin/perlin.h>
-#include "types.h"
-
-#define U32(x) (((u32) 1 << 31) + (x))
-
-typedef enum {
-       OFFSET_NONE,
-       OFFSET_HEIGHT,
-       OFFSET_MOUNTAIN,
-       OFFSET_OCEAN,
-       OFFSET_MOUNTAIN_HEIGHT,
-       OFFSET_BOULDER,
-       OFFSET_WETNESS,
-       OFFSET_TEXTURE_OFFSET_S,
-       OFFSET_TEXTURE_OFFSET_T,
-       OFFSET_TEMPERATURE,
-       OFFSET_VULCANO,
-       OFFSET_VULCANO_HEIGHT,
-       OFFSET_VULCANO_STONE,
-       OFFSET_VULCANO_CRATER_TOP,
-       OFFSET_HILLYNESS,
-       OFFSET_VOXEL_PROCEDURAL,
-       OFFSET_OAKTREE,
-       OFFSET_OAKTREE_AREA,
-       OFFSET_PINETREE,
-       OFFSET_PINETREE_AREA,
-       OFFSET_PINETREE_HEIGHT,
-       OFFSET_PINETREE_BRANCH,
-       OFFSET_PINETREE_BRANCH_DIR,
-       OFFSET_PALMTREE,
-       OFFSET_PALMTREE_AREA,
-} SeedOffset;
-
-extern s32 seed;
-
-#endif // _PERLIN_H_
diff --git a/src/physics.c b/src/physics.c
deleted file mode 100644 (file)
index 5fab114..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-#include <math.h>
-#include "physics.h"
-
-static aabb3f64 move_box(aabb3f32 box, v3f64 pos)
-{
-       return (aabb3f64) {
-               {pos.x + box.min.x, pos.y + box.min.y, pos.z + box.min.z},
-               {pos.x + box.max.x, pos.y + box.max.y, pos.z + box.max.z},
-       };
-}
-
-static aabb3s32 round_box(aabb3f64 box)
-{
-       return (aabb3s32) {
-               {floor(box.min.x + 0.5), floor(box.min.y + 0.5), floor(box.min.z + 0.5)},
-               { ceil(box.max.x - 0.5),  ceil(box.max.y - 0.5),  ceil(box.max.z - 0.5)},
-       };
-}
-
-static bool is_solid(Terrain *terrain, s32 x, s32 y, s32 z)
-{
-       NodeType node = terrain_get_node(terrain, (v3s32) {x, y, z}).type;
-       return node == COUNT_NODE || node_def[node].solid;
-}
-
-bool physics_ground(Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel)
-{
-       if (!collide)
-               return false;
-
-       if (vel->y != 0.0)
-               return false;
-
-       aabb3f64 mbox = move_box(box, *pos);
-       mbox.min.y -= 0.5;
-
-       aabb3s32 rbox = round_box(mbox);
-
-       if (mbox.min.y - (f64) rbox.min.y > 0.01)
-               return false;
-
-       for (s32 x = rbox.min.x; x <= rbox.max.x; x++)
-               for (s32 z = rbox.min.z; z <= rbox.max.z; z++)
-                       if (is_solid(terrain, x, rbox.min.y, z))
-                               return true;
-
-       return false;
-}
-
-bool physics_step(Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel, v3f64 *acc, f64 t)
-{
-       v3f64 old_pos = *pos;
-
-       f64 *x = &pos->x;
-       f64 *v = &vel->x;
-       f64 *a = &acc->x;
-
-       f32 *min = &box.min.x;
-       f32 *max = &box.max.x;
-
-       static u8 idx[3][3] = {
-               {0, 1, 2},
-               {1, 0, 2},
-               {2, 0, 1},
-       };
-
-       for (u8 i = 0; i < 3; i++) {
-               f64 v_old = v[i];
-               v[i] += a[i] * t;
-               f64 v_cur = (v[i] + v_old) / 2.0;
-               if (v_cur == 0.0)
-                       continue;
-
-               f64 x_old = x[i];
-               x[i] += v_cur * t;
-               if (!collide)
-                       continue;
-
-               aabb3s32 box_rnd = round_box(move_box(box, *pos));
-
-               s32 dir;
-               f32 off;
-               s32 *min_rnd = &box_rnd.min.x;
-               s32 *max_rnd = &box_rnd.max.x;
-
-               if (v[i] > 0.0) {
-                       dir = +1;
-                       off = max[i];
-
-                       min_rnd[i] = ceil(x_old + off + 0.5);
-                       max_rnd[i] = floor(x[i] + off + 0.5);
-               } else {
-                       dir = -1;
-                       off = min[i];
-
-                       min_rnd[i] = floor(x_old + off - 0.5);
-                       max_rnd[i] =   ceil(x[i] + off - 0.5);
-               }
-
-               max_rnd[i] += dir;
-
-               u8 i_a = idx[i][0]; // = i
-               u8 i_b = idx[i][1];
-               u8 i_c = idx[i][2];
-
-               for (s32 a = min_rnd[i_a]; a != max_rnd[i_a]; a += dir)
-               for (s32 b = min_rnd[i_b]; b <= max_rnd[i_b]; b++)
-               for (s32 c = min_rnd[i_c]; c <= max_rnd[i_c]; c++)      {
-                       s32 p[3];
-                       p[i_a] = a;
-                       p[i_b] = b;
-                       p[i_c] = c;
-
-                       if (is_solid(terrain, p[0], p[1], p[2])) {
-                               x[i] = (f64) a - off - 0.5 * (f64) dir;
-                               v[i] = 0.0;
-                               goto done;
-                       }
-               }
-
-               done: continue;
-       }
-
-       return !v3f64_equals(*pos, old_pos);
-}
diff --git a/src/physics.h b/src/physics.h
deleted file mode 100644 (file)
index 083cc09..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef _PHYSICS_H_
-#define _PHYSICS_H_
-
-#include <stdbool.h>
-#include "terrain.h"
-#include "types.h"
-
-bool physics_ground(Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel);
-bool physics_step  (Terrain *terrain, bool collide, aabb3f32 box, v3f64 *pos, v3f64 *vel, v3f64 *acc, f64 t);
-
-#endif // _PHYSICS_H_
index dce835dd4d46479e7e47f70c7cd5a4a4bb8c609d..ffdfb3130628c383153b2dde1cf36a1823bf6f40 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _BIOMES_H_
 #define _BIOMES_H_
 
-#include "perlin.h"
-#include "terrain.h"
+#include "common/perlin.h"
+#include "common/terrain.h"
 #include "types.h"
 
 typedef enum {
index 79d1e59e1e43cf0d19f1423f203c52c7ec8e09cd..d6cdbca820b6e449777b90f22c4a40bb2ed992d8 100644 (file)
@@ -1,14 +1,14 @@
-#include <endian.h/endian.h>
+#include <endian.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sqlite3.h>
 #include <time.h>
-#include "day.h"
+#include "common/day.h"
+#include "common/perlin.h"
 #include "server/database.h"
 #include "server/server_node.h"
 #include "server/server_terrain.h"
-#include "perlin.h"
 
 static sqlite3 *terrain_database;
 static sqlite3 *meta_database;
index 754b6b9fce726373cd2ae9eef405623c9587b746..98c5c0e2c802e5aff2a0000e4ad7f38f6cb5f19e 100644 (file)
@@ -2,7 +2,7 @@
 #define _DATABASE_H_
 
 #include <stdbool.h>
-#include "terrain.h"
+#include "common/terrain.h"
 #include "types.h"
 
 bool database_init();                                                  // open and initialize SQLite3 databases
index af92cfa9d4b161b82590c0bac42e299e86b349ff..8e105d2c7b1fbcb362a309c5b7f696f5a4fd6e92 100644 (file)
@@ -1,9 +1,9 @@
-#include <getline/getline.h>
+#include <getline.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include "common/terrain.h"
 #include "server/schematic.h"
 #include "server/server_node.h"
-#include "terrain.h"
 
 void schematic_load(List *schematic, const char *path, SchematicMapping *mappings, size_t num_mappings)
 {
index 213645ee4294fb67104858fb4a2e65b7d3856662..06631bf5087d9deaad032bcf257603618a33443f 100644 (file)
@@ -4,7 +4,7 @@
 #include <dragonstd/list.h>
 #include <stdbool.h>
 #include <stddef.h>
-#include "node.h"
+#include "common/node.h"
 #include "server/server_terrain.h"
 #include "types.h"
 
index d856512a00e7c0fa4771d6e0b497d4d10825ef4b..be3605e7ef7130440bd22363286441b6a9a2335f 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include "interrupt.h"
+#include "common/interrupt.h"
 #include "server/database.h"
 #include "server/server.h"
 #include "server/server_item.h"
index 242a10081f707b1170f9278e4c61f79e8ed6035b..2911f7a44a075c9161d367c8f49ef03cf455b91e 100644 (file)
@@ -1,4 +1,4 @@
-#include "config.h"
+#include "common/config.h"
 #include "server/server_config.h"
 
 struct ServerConfig server_config = {
index 70c4c67628f76610384431320499f98d05f0a667..18fb36c675bf3d9b75e3bd7192e73b38571466a4 100644 (file)
@@ -1,5 +1,5 @@
 #include <assert.h>
-#include "node.h"
+#include "common/node.h"
 #include "server/server_item.h"
 #include "server/server_node.h"
 #include "server/server_terrain.h"
index 9fe5f2dc6ba02e2dde95b2f00320204577a73207..4163078777934e7672a2e12e6848ba31dca5c2d9 100644 (file)
@@ -2,7 +2,7 @@
 #define _SERVER_ITEM_H_
 
 #include <stdbool.h>
-#include "item.h"
+#include "common/item.h"
 #include "server/server_player.h"
 #include "types.h"
 
index 045ffcc112935aefba569c237e7caf1bf28159ac..fadb8ee2fd0e09a2bb8a34dd5dcdd171785cb171 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _SERVER_NODE_H_
 #define _SERVER_NODE_H_
 
-#include "terrain.h"
+#include "common/terrain.h"
 #include "types.h"
 
 TerrainNode server_node_create(NodeType type);
index c024915aefdabdb5ad5683b1568d94b8a157fea3..5d0eb10317f2beca31c080102c7eda5e24bcfaa6 100644 (file)
@@ -3,9 +3,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <pthread.h>
-#include "day.h"
-#include "entity.h"
-#include "perlin.h"
+#include "common/day.h"
+#include "common/entity.h"
+#include "common/perlin.h"
 #include "server/database.h"
 #include "server/server_config.h"
 #include "server/server_player.h"
index afd7119679066d13177f1ba001836be15e74ca6a..956258bcab584666bc9aae706a617a1bd5bbfdd2 100644 (file)
@@ -5,7 +5,7 @@
 #include <dragonstd/refcount.h>
 #include <pthread.h>
 #include <stdbool.h>
-#include "item.h"
+#include "common/item.h"
 #include "types.h"
 
 typedef struct {
index 6078216ee8fa7a66c297674de3da9ad5fa34b274..4f2ede3480f826688cc58de09380f9fbb2107a1b 100644 (file)
@@ -8,14 +8,14 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include "interrupt.h"
+#include "common/interrupt.h"
+#include "common/terrain.h"
 #include "server/database.h"
 #include "server/schematic.h"
 #include "server/server_config.h"
 #include "server/server_node.h"
 #include "server/server_terrain.h"
 #include "server/terrain_gen.h"
-#include "terrain.h"
 
 // this file is too long
 Terrain *server_terrain;
@@ -168,7 +168,7 @@ static void generate_spawn_hut()
        list_ini(&changed_chunks);
 
        List spawn_hut;
-       schematic_load(&spawn_hut, RESSOURCE_PATH "schematics/spawn_hut.txt", (SchematicMapping[]) {
+       schematic_load(&spawn_hut, ASSET_PATH "schematics/spawn_hut.txt", (SchematicMapping[]) {
                {
                        .color = {0x7d, 0x54, 0x35},
                        .type = NODE_OAK_WOOD,
index 4cd2ce36eb4b3fb55c7639645c0c3baaec8726d7..8c0104e4e995cc5897ee1c31e1f81742c8b88137 100644 (file)
@@ -3,8 +3,8 @@
 
 #include <dragonstd/list.h>
 #include <pthread.h>
+#include "common/terrain.h"
 #include "server/server_player.h"
-#include "terrain.h"
 #include "types.h"
 
 typedef enum {
index b9131674ca56aefe15983e20f334344a652100aa..74d1403ad064bb5515d446199f8da920ce412681 100644 (file)
@@ -1,8 +1,8 @@
 #include <assert.h>
 #include <math.h>
 #include <stdlib.h>
-#include "environment.h"
-#include "perlin.h"
+#include "common/environment.h"
+#include "common/perlin.h"
 #include "server/biomes.h"
 #include "server/server_node.h"
 #include "server/server_terrain.h"
index ce07148538571fd7889c50c2ca2b4096497f60cd..ca7d8cecad04b24819aecc674a8895f420c63b7f 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef _TERRAIN_GEN_H_
 #define _TERRAIN_GEN_H_
 
+#include "common/terrain.h"
 #include "server/server_terrain.h"
-#include "terrain.h"
 
 s32 terrain_gen_get_base_height(v2s32 pos);
 void terrain_gen_chunk(TerrainChunk *chunk, List *changed_chunks); // generate a chunk (does not manage chunk state or threading)
index 2eb08aab9872c500c9e4f448ddb231e4b939c794..fbce233c6896b5618d61535d032bf4c6961854a0 100644 (file)
@@ -3,8 +3,8 @@
 
 #include <dragonstd/list.h>
 #include <stdbool.h>
-#include "perlin.h"
-#include "terrain.h"
+#include "common/perlin.h"
+#include "common/terrain.h"
 #include "types.h"
 
 #define NUM_TREES 3
index 7db6a107c701ad05307abbe165e90fe565b44980..b1da431c1496e3b215aecd2e0d34a450087ea04a 100644 (file)
@@ -7,7 +7,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include "facedir.h"
+#include "common/facedir.h"
 #include "server/server_node.h"
 #include "server/server_terrain.h"
 #include "server/tree_physics.h"
index edf9fb5128d9236049bd42a8f7023a3c0164450b..b775025cb0c5f1d85c2f9bb6a86aefab032656e8 100644 (file)
@@ -1,5 +1,5 @@
 #include <stdlib.h>
-#include "voxel_depth_search.h"
+#include "server/voxel_depth_search.h"
 
 v3s32 dirs[6] = {
        {+0, -1, +0}, // this is commonly used to find ground, search downwards first
index 2eb9bf8e2a6d2319c779a44f6a6ad44cb604f2ae..4adce68b1218ccf09e2abd37687b214a70a33b53 100644 (file)
@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <pthread.h>
-#include "color.h"
-#include "perlin.h"
+#include "common/color.h"
+#include "common/perlin.h"
 #include "server/terrain_gen.h"
 #include "server/voxel_procedural.h"
 
index 6de0f1e8f6d88e61d2adc957304ceb4b2f33d834..6d753f0c43965258a2af3cbbc2b3f6ae1ec10b54 100644 (file)
@@ -2,7 +2,7 @@
 #define _VOXEL_PROCEDURAL_H_
 
 #include <dragonstd/list.h>
-#include <linmath.h/linmath.h>
+#include <linmath.h>
 #include "server/server_terrain.h"
 #include "types.h"
 
diff --git a/src/terrain.c b/src/terrain.c
deleted file mode 100644 (file)
index 5f7b928..0000000
+++ /dev/null
@@ -1,249 +0,0 @@
-#include <assert.h>
-#include <math.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "terrain.h"
-
-typedef struct {
-       v2s32 pos;
-       Tree chunks;
-       pthread_rwlock_t lock;
-} TerrainSector;
-
-static TerrainChunk *allocate_chunk(v3s32 pos)
-{
-       TerrainChunk *chunk = malloc(sizeof * chunk);
-       chunk->level = pos.y;
-       chunk->pos = pos;
-       chunk->extra = NULL;
-       pthread_rwlock_init(&chunk->lock, NULL);
-
-       CHUNK_ITERATE
-               chunk->data[x][y][z] = (TerrainNode) {NODE_UNKNOWN, NULL};
-
-       return chunk;
-}
-
-static void free_chunk(Terrain *terrain, TerrainChunk *chunk)
-{
-       if (terrain->callbacks.delete_node) CHUNK_ITERATE
-               terrain->callbacks.delete_node(&chunk->data[x][y][z]);
-
-       pthread_rwlock_destroy(&chunk->lock);
-       free(chunk);
-}
-
-static void delete_chunk(TerrainChunk *chunk, Terrain *terrain)
-{
-       if (terrain->callbacks.delete_chunk)
-               terrain->callbacks.delete_chunk(chunk);
-
-       free_chunk(terrain, chunk);
-}
-
-static void delete_sector(TerrainSector *sector, Terrain *terrain)
-{
-       tree_clr(&sector->chunks, &delete_chunk, terrain, NULL, 0);
-       pthread_rwlock_destroy(&sector->lock);
-       free(sector);
-}
-
-static TerrainSector *get_sector(Terrain *terrain, v2s32 pos, int mode)
-{
-       if (mode == CHUNK_MODE_CREATE)
-               pthread_rwlock_wrlock(&terrain->lock);
-       else
-               pthread_rwlock_rdlock(&terrain->lock);
-
-       TreeNode **loc = tree_nfd(&terrain->sectors, &pos, &v2s32_cmp);
-       TerrainSector *sector = NULL;
-
-       if (*loc) {
-               sector = (*loc)->dat;
-       } else if (mode == CHUNK_MODE_CREATE) {
-               sector = malloc(sizeof *sector);
-               sector->pos = pos;
-               tree_ini(&sector->chunks);
-               pthread_rwlock_init(&sector->lock, NULL);
-
-               tree_nmk(&terrain->sectors, loc, sector);
-       }
-
-       pthread_rwlock_unlock(&terrain->lock);
-
-       return sector;
-}
-
-Terrain *terrain_create()
-{
-       Terrain *terrain = malloc(sizeof *terrain);
-       tree_ini(&terrain->sectors);
-       pthread_rwlock_init(&terrain->lock, NULL);
-       terrain->cache = NULL;
-       pthread_rwlock_init(&terrain->cache_lock, NULL);
-       return terrain;
-}
-
-void terrain_delete(Terrain *terrain)
-{
-       tree_clr(&terrain->sectors, &delete_sector, terrain, NULL, 0);
-       pthread_rwlock_destroy(&terrain->lock);
-       pthread_rwlock_destroy(&terrain->cache_lock);
-       free(terrain);
-}
-
-TerrainChunk *terrain_get_chunk(Terrain *terrain, v3s32 pos, int mode)
-{
-       TerrainChunk *cache = NULL;
-
-       pthread_rwlock_rdlock(&terrain->cache_lock);
-       cache = terrain->cache;
-       pthread_rwlock_unlock(&terrain->cache_lock);
-
-       if (cache && v3s32_equals(cache->pos, pos))
-               return cache;
-
-       TerrainSector *sector = get_sector(terrain, (v2s32) {pos.x, pos.z}, mode);
-       if (!sector)
-               return NULL;
-
-       if (mode == CHUNK_MODE_CREATE)
-               pthread_rwlock_wrlock(&sector->lock);
-       else
-               pthread_rwlock_rdlock(&sector->lock);
-
-       TreeNode **loc = tree_nfd(&sector->chunks, &pos.y, &s32_cmp);
-       TerrainChunk *chunk = NULL;
-
-       if (*loc) {
-               chunk = (*loc)->dat;
-
-               if (terrain->callbacks.get_chunk && !terrain->callbacks.get_chunk(chunk, mode)) {
-                       chunk = NULL;
-               } else {
-                       pthread_rwlock_wrlock(&terrain->cache_lock);
-                       terrain->cache = chunk;
-                       pthread_rwlock_unlock(&terrain->cache_lock);
-               }
-       } else if (mode == CHUNK_MODE_CREATE) {
-               tree_nmk(&sector->chunks, loc, chunk = allocate_chunk(pos));
-
-               if (terrain->callbacks.create_chunk)
-                       terrain->callbacks.create_chunk(chunk);
-       }
-
-       pthread_rwlock_unlock(&sector->lock);
-
-       return chunk;
-}
-
-TerrainChunk *terrain_get_chunk_nodep(Terrain *terrain, v3s32 nodep, v3s32 *offset, int mode)
-{
-       TerrainChunk *chunk = terrain_get_chunk(terrain, terrain_chunkp(nodep), mode);
-       if (!chunk)
-               return NULL;
-       *offset = terrain_offset(nodep);
-       return chunk;
-}
-
-Blob terrain_serialize_chunk(__attribute__((unused)) Terrain *terrain, TerrainChunk *chunk, void (*callback)(TerrainNode *node, Blob *buffer))
-{
-       bool empty = true;
-
-       CHUNK_ITERATE {
-               if (chunk->data[x][y][z].type != NODE_AIR) {
-                       empty = false;
-                       break;
-               }
-       }
-
-       if (empty)
-               return (Blob) {0, NULL};
-
-       SerializedTerrainChunk serialized_chunk;
-
-       CHUNK_ITERATE {
-               TerrainNode *node = &chunk->data[x][y][z];
-               SerializedTerrainNode *serialized = &serialized_chunk.raw.nodes[x][y][z];
-
-               serialized->type = node->type;
-               serialized->data = (Blob) {0, NULL};
-
-               if (callback)
-                       callback(node, &serialized->data);
-       }
-
-       Blob buffer = {0, NULL};
-       SerializedTerrainChunk_write(&buffer, &serialized_chunk);
-       SerializedTerrainChunk_free(&serialized_chunk);
-       return buffer;
-}
-
-bool terrain_deserialize_chunk(Terrain *terrain, TerrainChunk *chunk, Blob buffer, void (*callback)(TerrainNode *node, Blob buffer))
-{
-       if (buffer.siz == 0) {
-               CHUNK_ITERATE {
-                       if (terrain->callbacks.delete_node)
-                               terrain->callbacks.delete_node(&chunk->data[x][y][z]);
-
-                       chunk->data[x][y][z] = (TerrainNode) {NODE_AIR, NULL};
-               }
-
-               return true;
-       }
-
-       // it's important to copy Blobs that have been malloc'd before reading from them
-       // because reading from a Blob modifies its data and size pointer,
-       // but does not free anything
-       SerializedTerrainChunk serialized_chunk = {0};
-       bool success = SerializedTerrainChunk_read(&buffer, &serialized_chunk);
-
-       if (success) CHUNK_ITERATE {
-               if (terrain->callbacks.delete_node)
-                       terrain->callbacks.delete_node(&chunk->data[x][y][z]);
-
-               TerrainNode *node = &chunk->data[x][y][z];
-               SerializedTerrainNode *serialized = &serialized_chunk.raw.nodes[x][y][z];
-
-               node->type = serialized->type;
-
-               if (callback)
-                       callback(node, serialized->data);
-       }
-
-       SerializedTerrainChunk_free(&serialized_chunk);
-       return success;
-}
-
-TerrainNode terrain_get_node(Terrain *terrain, v3s32 pos)
-{
-       v3s32 offset;
-       TerrainChunk *chunk = terrain_get_chunk_nodep(terrain, pos, &offset, CHUNK_MODE_PASSIVE);
-       if (!chunk)
-               return (TerrainNode) {COUNT_NODE, NULL};
-
-       assert(pthread_rwlock_rdlock(&chunk->lock) == 0);
-       TerrainNode node = chunk->data[offset.x][offset.y][offset.z];
-       pthread_rwlock_unlock(&chunk->lock);
-
-       return node;
-}
-
-v3s32 terrain_chunkp(v3s32 pos)
-{
-       return (v3s32) {
-               floor((double) pos.x / (double) CHUNK_SIZE),
-               floor((double) pos.y / (double) CHUNK_SIZE),
-               floor((double) pos.z / (double) CHUNK_SIZE)};
-}
-
-v3s32 terrain_offset(v3s32 pos)
-{
-       return (v3s32) {
-               (u32) pos.x % CHUNK_SIZE,
-               (u32) pos.y % CHUNK_SIZE,
-               (u32) pos.z % CHUNK_SIZE};
-}
diff --git a/src/terrain.h b/src/terrain.h
deleted file mode 100644 (file)
index c6aea4e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef _TERRAIN_H_
-#define _TERRAIN_H_
-
-#include <dragonstd/list.h>
-#include <dragonstd/tree.h>
-#include <stdbool.h>
-#include <pthread.h>
-#include "node.h"
-#include "types.h"
-
-#define CHUNK_ITERATE \
-       for (s32 x = 0; x < CHUNK_SIZE; x++) \
-       for (s32 y = 0; y < CHUNK_SIZE; y++) \
-       for (s32 z = 0; z < CHUNK_SIZE; z++)
-
-#define CHUNK_MODE_PASSIVE 0
-#define CHUNK_MODE_CREATE 1
-
-typedef struct TerrainNode {
-       NodeType type;
-       void *data;
-} TerrainNode;
-
-typedef TerrainNode TerrainChunkData[CHUNK_SIZE][CHUNK_SIZE][CHUNK_SIZE];
-
-typedef struct {
-       s32 level;
-       v3s32 pos;
-       TerrainChunkData data;
-       void *extra;
-       pthread_rwlock_t lock;
-} TerrainChunk;
-
-typedef struct {
-       Tree sectors;
-       pthread_rwlock_t lock;
-       TerrainChunk *cache;
-       pthread_rwlock_t cache_lock;
-       struct {
-               void (*create_chunk)(TerrainChunk *chunk);
-               void (*delete_chunk)(TerrainChunk *chunk);
-               bool (*get_chunk)(TerrainChunk *chunk, int mode);
-               void (*delete_node)(TerrainNode *node);
-       } callbacks;
-} Terrain;
-
-Terrain *terrain_create();
-void terrain_delete(Terrain *terrain);
-
-TerrainChunk *terrain_get_chunk(Terrain *terrain, v3s32 pos, int mode);
-TerrainChunk *terrain_get_chunk_nodep(Terrain *terrain, v3s32 node_pos, v3s32 *offset, int mode);
-
-Blob terrain_serialize_chunk(Terrain *terrain, TerrainChunk *chunk, void (*callback)(TerrainNode *node, Blob *buffer));
-bool terrain_deserialize_chunk(Terrain *terrain, TerrainChunk *chunk, Blob buffer, void (*callback)(TerrainNode *node, Blob buffer));
-
-TerrainNode terrain_get_node(Terrain *terrain, v3s32 pos);
-
-v3s32 terrain_chunkp(v3s32 pos);
-v3s32 terrain_offset(v3s32 pos);
-
-#endif
diff --git a/textures/crosshair.png b/textures/crosshair.png
deleted file mode 100644 (file)
index 8f03d32..0000000
Binary files a/textures/crosshair.png and /dev/null differ
diff --git a/textures/dirt.png b/textures/dirt.png
deleted file mode 100644 (file)
index 9a64b49..0000000
Binary files a/textures/dirt.png and /dev/null differ
diff --git a/textures/grass.png b/textures/grass.png
deleted file mode 100644 (file)
index 70a3522..0000000
Binary files a/textures/grass.png and /dev/null differ
diff --git a/textures/lava.png b/textures/lava.png
deleted file mode 100644 (file)
index 48aaccf..0000000
Binary files a/textures/lava.png and /dev/null differ
diff --git a/textures/lava_nt.png b/textures/lava_nt.png
deleted file mode 100644 (file)
index e44018f..0000000
Binary files a/textures/lava_nt.png and /dev/null differ
diff --git a/textures/models/player/arm/back.png b/textures/models/player/arm/back.png
deleted file mode 100644 (file)
index 69ffff3..0000000
Binary files a/textures/models/player/arm/back.png and /dev/null differ
diff --git a/textures/models/player/arm/bottom.png b/textures/models/player/arm/bottom.png
deleted file mode 100644 (file)
index fda334e..0000000
Binary files a/textures/models/player/arm/bottom.png and /dev/null differ
diff --git a/textures/models/player/arm/front.png b/textures/models/player/arm/front.png
deleted file mode 100644 (file)
index ce19461..0000000
Binary files a/textures/models/player/arm/front.png and /dev/null differ
diff --git a/textures/models/player/arm/left.png b/textures/models/player/arm/left.png
deleted file mode 100644 (file)
index c2b2325..0000000
Binary files a/textures/models/player/arm/left.png and /dev/null differ
diff --git a/textures/models/player/arm/right.png b/textures/models/player/arm/right.png
deleted file mode 100644 (file)
index 9ae2e41..0000000
Binary files a/textures/models/player/arm/right.png and /dev/null differ
diff --git a/textures/models/player/arm/top.png b/textures/models/player/arm/top.png
deleted file mode 100644 (file)
index e12765d..0000000
Binary files a/textures/models/player/arm/top.png and /dev/null differ
diff --git a/textures/models/player/chest/back.png b/textures/models/player/chest/back.png
deleted file mode 100644 (file)
index 5eca9ec..0000000
Binary files a/textures/models/player/chest/back.png and /dev/null differ
diff --git a/textures/models/player/chest/bottom.png b/textures/models/player/chest/bottom.png
deleted file mode 100644 (file)
index 131d33d..0000000
Binary files a/textures/models/player/chest/bottom.png and /dev/null differ
diff --git a/textures/models/player/chest/front.png b/textures/models/player/chest/front.png
deleted file mode 100644 (file)
index d44fd42..0000000
Binary files a/textures/models/player/chest/front.png and /dev/null differ
diff --git a/textures/models/player/chest/left.png b/textures/models/player/chest/left.png
deleted file mode 100644 (file)
index 995ad5f..0000000
Binary files a/textures/models/player/chest/left.png and /dev/null differ
diff --git a/textures/models/player/chest/right.png b/textures/models/player/chest/right.png
deleted file mode 100644 (file)
index e48eb66..0000000
Binary files a/textures/models/player/chest/right.png and /dev/null differ
diff --git a/textures/models/player/chest/top.png b/textures/models/player/chest/top.png
deleted file mode 100644 (file)
index df84083..0000000
Binary files a/textures/models/player/chest/top.png and /dev/null differ
diff --git a/textures/models/player/head/back.png b/textures/models/player/head/back.png
deleted file mode 100644 (file)
index 935a2b9..0000000
Binary files a/textures/models/player/head/back.png and /dev/null differ
diff --git a/textures/models/player/head/bottom.png b/textures/models/player/head/bottom.png
deleted file mode 100644 (file)
index 1fdae43..0000000
Binary files a/textures/models/player/head/bottom.png and /dev/null differ
diff --git a/textures/models/player/head/front.png b/textures/models/player/head/front.png
deleted file mode 100644 (file)
index 805fec0..0000000
Binary files a/textures/models/player/head/front.png and /dev/null differ
diff --git a/textures/models/player/head/left.png b/textures/models/player/head/left.png
deleted file mode 100644 (file)
index 7dc2a81..0000000
Binary files a/textures/models/player/head/left.png and /dev/null differ
diff --git a/textures/models/player/head/right.png b/textures/models/player/head/right.png
deleted file mode 100644 (file)
index 47436ba..0000000
Binary files a/textures/models/player/head/right.png and /dev/null differ
diff --git a/textures/models/player/head/top.png b/textures/models/player/head/top.png
deleted file mode 100644 (file)
index 916ea2b..0000000
Binary files a/textures/models/player/head/top.png and /dev/null differ
diff --git a/textures/models/player/leg/back.png b/textures/models/player/leg/back.png
deleted file mode 100644 (file)
index 48b93ce..0000000
Binary files a/textures/models/player/leg/back.png and /dev/null differ
diff --git a/textures/models/player/leg/bottom.png b/textures/models/player/leg/bottom.png
deleted file mode 100644 (file)
index 0c942fb..0000000
Binary files a/textures/models/player/leg/bottom.png and /dev/null differ
diff --git a/textures/models/player/leg/front.png b/textures/models/player/leg/front.png
deleted file mode 100644 (file)
index 13b1016..0000000
Binary files a/textures/models/player/leg/front.png and /dev/null differ
diff --git a/textures/models/player/leg/left.png b/textures/models/player/leg/left.png
deleted file mode 100644 (file)
index 104c6e7..0000000
Binary files a/textures/models/player/leg/left.png and /dev/null differ
diff --git a/textures/models/player/leg/right.png b/textures/models/player/leg/right.png
deleted file mode 100644 (file)
index a97a13a..0000000
Binary files a/textures/models/player/leg/right.png and /dev/null differ
diff --git a/textures/models/player/leg/top.png b/textures/models/player/leg/top.png
deleted file mode 100644 (file)
index d575dc7..0000000
Binary files a/textures/models/player/leg/top.png and /dev/null differ
diff --git a/textures/needles.png b/textures/needles.png
deleted file mode 100644 (file)
index 24e3ed4..0000000
Binary files a/textures/needles.png and /dev/null differ
diff --git a/textures/oak_leaves.png b/textures/oak_leaves.png
deleted file mode 100644 (file)
index a29369a..0000000
Binary files a/textures/oak_leaves.png and /dev/null differ
diff --git a/textures/oak_wood.png b/textures/oak_wood.png
deleted file mode 100644 (file)
index 90af189..0000000
Binary files a/textures/oak_wood.png and /dev/null differ
diff --git a/textures/oak_wood_top.png b/textures/oak_wood_top.png
deleted file mode 100644 (file)
index cf8ed6f..0000000
Binary files a/textures/oak_wood_top.png and /dev/null differ
diff --git a/textures/palm_leaves.png b/textures/palm_leaves.png
deleted file mode 100644 (file)
index 9d44925..0000000
Binary files a/textures/palm_leaves.png and /dev/null differ
diff --git a/textures/palm_wood.png b/textures/palm_wood.png
deleted file mode 100644 (file)
index 5f0295d..0000000
Binary files a/textures/palm_wood.png and /dev/null differ
diff --git a/textures/palm_wood_top.png b/textures/palm_wood_top.png
deleted file mode 100644 (file)
index 276ae1e..0000000
Binary files a/textures/palm_wood_top.png and /dev/null differ
diff --git a/textures/pine_leaves.png b/textures/pine_leaves.png
deleted file mode 100644 (file)
index 24e3ed4..0000000
Binary files a/textures/pine_leaves.png and /dev/null differ
diff --git a/textures/pine_wood.png b/textures/pine_wood.png
deleted file mode 100644 (file)
index fae7da1..0000000
Binary files a/textures/pine_wood.png and /dev/null differ
diff --git a/textures/pine_wood_top.png b/textures/pine_wood_top.png
deleted file mode 100644 (file)
index 276ae1e..0000000
Binary files a/textures/pine_wood_top.png and /dev/null differ
diff --git a/textures/player.png b/textures/player.png
deleted file mode 100644 (file)
index f403dc3..0000000
Binary files a/textures/player.png and /dev/null differ
diff --git a/textures/sand.png b/textures/sand.png
deleted file mode 100644 (file)
index 3899f4b..0000000
Binary files a/textures/sand.png and /dev/null differ
diff --git a/textures/skybox/day/back.png b/textures/skybox/day/back.png
deleted file mode 100644 (file)
index 6b98546..0000000
Binary files a/textures/skybox/day/back.png and /dev/null differ
diff --git a/textures/skybox/day/bottom.png b/textures/skybox/day/bottom.png
deleted file mode 100644 (file)
index ceaa6aa..0000000
Binary files a/textures/skybox/day/bottom.png and /dev/null differ
diff --git a/textures/skybox/day/front.png b/textures/skybox/day/front.png
deleted file mode 100644 (file)
index f62ee88..0000000
Binary files a/textures/skybox/day/front.png and /dev/null differ
diff --git a/textures/skybox/day/left.png b/textures/skybox/day/left.png
deleted file mode 100644 (file)
index 558391a..0000000
Binary files a/textures/skybox/day/left.png and /dev/null differ
diff --git a/textures/skybox/day/right.png b/textures/skybox/day/right.png
deleted file mode 100644 (file)
index b1b7b9f..0000000
Binary files a/textures/skybox/day/right.png and /dev/null differ
diff --git a/textures/skybox/day/top.png b/textures/skybox/day/top.png
deleted file mode 100644 (file)
index 45567ca..0000000
Binary files a/textures/skybox/day/top.png and /dev/null differ
diff --git a/textures/skybox/night/back.png b/textures/skybox/night/back.png
deleted file mode 100644 (file)
index 0a0a862..0000000
Binary files a/textures/skybox/night/back.png and /dev/null differ
diff --git a/textures/skybox/night/bottom.png b/textures/skybox/night/bottom.png
deleted file mode 100644 (file)
index e51749a..0000000
Binary files a/textures/skybox/night/bottom.png and /dev/null differ
diff --git a/textures/skybox/night/front.png b/textures/skybox/night/front.png
deleted file mode 100644 (file)
index 6ec46e1..0000000
Binary files a/textures/skybox/night/front.png and /dev/null differ
diff --git a/textures/skybox/night/left.png b/textures/skybox/night/left.png
deleted file mode 100644 (file)
index c04fb71..0000000
Binary files a/textures/skybox/night/left.png and /dev/null differ
diff --git a/textures/skybox/night/right.png b/textures/skybox/night/right.png
deleted file mode 100644 (file)
index 60329f4..0000000
Binary files a/textures/skybox/night/right.png and /dev/null differ
diff --git a/textures/skybox/night/top.png b/textures/skybox/night/top.png
deleted file mode 100644 (file)
index 2711dd1..0000000
Binary files a/textures/skybox/night/top.png and /dev/null differ
diff --git a/textures/snow.png b/textures/snow.png
deleted file mode 100644 (file)
index 359335e..0000000
Binary files a/textures/snow.png and /dev/null differ
diff --git a/textures/stone.png b/textures/stone.png
deleted file mode 100644 (file)
index 3af8ac9..0000000
Binary files a/textures/stone.png and /dev/null differ
diff --git a/textures/sun.png b/textures/sun.png
deleted file mode 100644 (file)
index fb3b88d..0000000
Binary files a/textures/sun.png and /dev/null differ
diff --git a/textures/unknown.png b/textures/unknown.png
deleted file mode 100644 (file)
index bbea82c..0000000
Binary files a/textures/unknown.png and /dev/null differ
diff --git a/textures/vulcano_stone.png b/textures/vulcano_stone.png
deleted file mode 100644 (file)
index c359713..0000000
Binary files a/textures/vulcano_stone.png and /dev/null differ
diff --git a/textures/water.png b/textures/water.png
deleted file mode 100644 (file)
index b9a66fd..0000000
Binary files a/textures/water.png and /dev/null differ
diff --git a/textures/water_nt.png b/textures/water_nt.png
deleted file mode 100644 (file)
index f457566..0000000
Binary files a/textures/water_nt.png and /dev/null differ
index fa554b9853f19a633b267c040f16b54ece40ccee..214981bf435c53007ba6c259a3e50b0ad075e219 100755 (executable)
--- a/upload.sh
+++ b/upload.sh
@@ -1,13 +1,18 @@
 #!/bin/bash
+echo "Snapshot uploading temporarily disabled"
+exit
+
 VERSION=`git tag --points-at HEAD`
 IS_RELEASE="1"
 if [[ $VERSION = "" ]]; then
        VERSION=`git rev-parse --short HEAD`
        IS_RELEASE="0"
 fi
+
 curl -f -i -X POST -H "Content-Type: multipart/form-data" \
        -F "secret=$SECRET" \
        -F "name=$VERSION" \
        -F "is_release=$IS_RELEASE" \
-       -F "build=@dragonblocks_alpha-$VERSION.zip" \
+       -F "ubuntu=@dragonblocks_alpha-$VERSION.zip" \
+       -F "windows=@dragonblocks_alpha-win64-$VERSION.zip" \
        https://elidragon.tk/dragonblocks_alpha/upload.php