From a40a1bf49181bdc52a7a7388c3ee0a3a807f9ff4 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Nov 2022 08:32:08 +0000 Subject: [PATCH] Get linux build working --- build_linux_server_release.sh | 8 +++++++- gamestate.c | 3 +-- server_main.c | 15 ++++++--------- types.h | 4 ++-- world.bin | Bin 144700 -> 170321 bytes 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/build_linux_server_release.sh b/build_linux_server_release.sh index 7ca5238..1ee2ea1 100755 --- a/build_linux_server_release.sh +++ b/build_linux_server_release.sh @@ -1,3 +1,9 @@ #!/usr/bin/env bash -gcc -o flight_server -Wall -O2 -Ithirdparty -Ithirdparty/enet/include -Ithirdparty/minilzo -Ithirdparty/Chipmunk2D/include -Ithirdparty/Chipmunk2D/include/chipmunk server_main.c server.c debugdraw.c gamestate.c sokol_impl.c thirdparty/minilzo/minilzo.c thirdparty/enet/*.c thirdparty/Chipmunk2D/src/*.c -lm -lpthread +mkdir thirdparty/opus/build +cd thirdparty/opus/build +cmake .. +cmake --build . +cd - + +gcc -o flight_server -Wall -O2 -Ithirdparty -Ithirdparty/opus/include -Ithirdparty/enet/include -Ithirdparty/minilzo -Ithirdparty/Chipmunk2D/include -Ithirdparty/Chipmunk2D/include/chipmunk server_main.c server.c debugdraw.c gamestate.c sokol_impl.c thirdparty/minilzo/minilzo.c thirdparty/enet/*.c thirdparty/Chipmunk2D/src/*.c -lm -lpthread -ldl thirdparty/opus/build/libopus.a diff --git a/gamestate.c b/gamestate.c index e124332..885fef1 100644 --- a/gamestate.c +++ b/gamestate.c @@ -790,7 +790,6 @@ SerMaybeFailure ser_inputframe(SerState* ser, InputFrame* i) SER_ASSERT(i->build_type >= 0); SER_ASSERT(i->build_type < BoxLast); SER_VAR(&i->build_rotation); - SER_ASSERT(!isnan(i->build_rotation)); return ser_ok; } @@ -1717,4 +1716,4 @@ void process(GameState* gs, float dt) } cpSpaceStep(gs->space, dt); -} \ No newline at end of file +} diff --git a/server_main.c b/server_main.c index 09eecf9..e3f3aeb 100644 --- a/server_main.c +++ b/server_main.c @@ -1,6 +1,6 @@ +#include "types.h" #define MINIAUDIO_IMPLEMENTATION #include "miniaudio.h" -#include "types.h" #define SOKOL_IMPL #include "sokol_time.h" @@ -14,18 +14,15 @@ ServerThreadInfo server_info = { void term(int signum) { - ma_mutex_lock(&server_info.info_mutex); - server_info.running = false; - ma_mutex_unlock(&server_info.info_mutex); + server_info.should_quit = true; } - int main(int argc, char **argv) { - struct sigaction action; - memset(&action, 0, sizeof(struct sigaction)); - action.sa_handler = term; - sigaction(SIGTERM, &action, NULL); + struct sigaction action; + memset(&action, 0, sizeof(struct sigaction)); + action.sa_handler = term; + sigaction(SIGTERM, &action, NULL); stm_setup(); ma_mutex_init(&server_info.info_mutex); diff --git a/types.h b/types.h index 49a7d6e..b8c988a 100644 --- a/types.h +++ b/types.h @@ -82,7 +82,7 @@ typedef void cpShape; #include #ifndef OPUS_TYPES_H -typedef __int32 opus_int32; +typedef int opus_int32; #endif #ifndef _STDBOOL @@ -663,4 +663,4 @@ static void set_color(Color c) (Color) { .r = 1.0f, .g = 1.0f, .b = 1.0f, .a = 1.0f } #define RED \ (Color) { .r = 1.0f, .g = 0.0f, .b = 0.0f, .a = 1.0f } -#define GOLD colhex(255, 215, 0) \ No newline at end of file +#define GOLD colhex(255, 215, 0) diff --git a/world.bin b/world.bin index 8af546ced00e207f1892389f607f0c734d22563b..5e8cfaaf866ab67f1a996fa865958eac963539d0 100644 GIT binary patch delta 7521 zcmbVRdsI}_8b5o_z<}D7!|)amP()D>N`&gdfJ_=DqM=?>Go}<_LLR1F$`>fUN^j^< zj+tGde4yb2LGVF56!2B1Wwz{Luom7-leDW>uaewv?|p{Zo*DnSf3Rkqv(Nta?|c8g zP2F{;3kQ1@C+iybHWhpS(r5jotwyiKJ5EGLMhtq}G%qafoz86^orsQjmObS!OdD;m zu8sQflZNQX=s~kg^G#uK^K#~!=4a+)dz+1|@;|;oK2_sU;3QlrNQEuaWy3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