]> git.lizzy.rs Git - dragonblocks_alpha.git/commitdiff
Add linmath submodule
authorElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 24 Mar 2021 15:05:08 +0000 (16:05 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 24 Mar 2021 15:05:08 +0000 (16:05 +0100)
.gitmodules [new file with mode: 0644]
BUILDING.md
README.md
deps/linmath.h [new submodule]
release.sh
src/Makefile
src/client.c
src/types.h

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..aac1dfe
--- /dev/null
@@ -0,0 +1,3 @@
+[submodule "deps/linmath.h"]
+       path = deps/linmath.h
+       url = https://github.com/datenwolf/linmath.h
index ad558df108fd3f139ad038b3d2129da142adadff..10539b7b9b6d9bcc735999e7d7c5ebff467cc00b 100644 (file)
@@ -1,6 +1,22 @@
 # Building instructions
 
-The code and the Makefile are located in the src/ directory
+GNU make is used for compiling. The code and the Makefile are located in the src/ directory.
+
+## Dependencies
+To build anything you need g++ and GNU make.
+```bash
+sudo apt install build-essential make
+```
+
+The development versions OpenGL, GLFW3, GLEW are required to build the client.
+```bash
+sudo apt install libgl1-mesa-dev libglfw3-dev libglew-dev
+```
+
+When building the client, don't forget to pull the submodules before building.
+``bash
+git submodule update --init
+```
 
 ## Available targets
 - `all` (default)
@@ -9,9 +25,9 @@ The code and the Makefile are located in the src/ directory
 - `clean`
 - `clobber`
 
-Debug flag (`-g`) is set by default.
+The debug flag (`-g`) is set by default (RELEASE=TRUE will disable it).
 
-## Release Build
+## Release
 ```bash
 ./release.sh
 ```
index 64b05680be5d8a310a62703de13e90cff6f2c084..e32951577e0e5eb865a9fb4c9784ec87fc98e7aa 100644 (file)
--- a/README.md
+++ b/README.md
@@ -26,3 +26,10 @@ All positions are signed integers (`s32`)
 - `invalid`: unknown nodes received from server
 
 Interrupt handlers for SIGINT und SIGTERM are implemented.
+
+## Dependencies
+
+The client depends on GLFW3, OpenGL and GLEW.
+```bash
+sudo apt install libgl1-mesa-dri libglfw3 libglew2.1
+```
diff --git a/deps/linmath.h b/deps/linmath.h
new file mode 160000 (submodule)
index 0000000..0538757
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 05387571f57224f8cbc2b390b423dab6b9158988
index 963799e2cb827fa42ca139299074af380ed60ba3..ea86eb461b442c3575bf00a0b9ab09c919f33498 100755 (executable)
@@ -4,7 +4,7 @@ cd .build/src
 make clobber && make all RELEASE=TRUE -j$(nproc) && make clean
 cp Dragonblocks DragonblocksServer ..
 cd ..
-rm -rf src BUILDING.md .git* release.sh DragonblocksAlpha-*.zip
+rm -rf .git* deps src BUILDING.md release.sh DragonblocksAlpha-*.zip
 cd ..
 mv .build DragonblocksAlpha
 zip DragonblocksAlpha-`git rev-parse --short HEAD` DragonblocksAlpha/*
index 0b3e6c5745f089ccf09b494c9bf79e83470a1ca2..33139cf4ab27df0a1fe93cdb2e1fd4ccf37b70db 100644 (file)
@@ -18,7 +18,7 @@ DragonblocksServer: $(SERVER)
        cc $(FLAGS) -o DragonblocksServer $(SERVER) $(LIBRARIES)
 
 %.o: %.c
-       cc $(FLAGS) -o $@ -c -Wall -Wextra -Wpedantic -Werror $<
+       cc $(FLAGS) -o $@ -c -Wall -Wextra -Wpedantic -Werror -isystem ../deps $<
 
 clean:
        rm -rf *.o
index 9ce1e6a7a6a5e16528ede8032fef4eeb6e8762af..3b30040d618104ba158fc713487a1e74d0e46796 100644 (file)
@@ -8,6 +8,7 @@
 #include <GL/glew.h>
 #include <GL/gl.h>
 #include <GLFW/glfw3.h>
+#include <linmath.h/linmath.h>
 #include "client.h"
 #include "signal.h"
 #include "util.h"
index cbf9baaf3cbf9baf6aa6c8e974a89a9c871e749b..f34684baf30a3bbf75a0080554202f51c31013e4 100644 (file)
@@ -28,15 +28,6 @@ DEFTYPES(16)
 DEFTYPES(32)
 DEFTYPES(64)
 
-typedef float f32;
-typedef double f64;
-
-DEFVEC(f32)
-DEFVEC(f64)
-
-typedef v2f32 v2f;
-typedef v3f32 v3f;
-
 #undef DEFRW
 #undef DEFVEC
 #undef DEFTYP