Get linux build working

main
root 2 years ago
parent 71ad6c7bbd
commit a40a1bf491

@ -1,3 +1,9 @@
#!/usr/bin/env bash #!/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

@ -790,7 +790,6 @@ SerMaybeFailure ser_inputframe(SerState* ser, InputFrame* i)
SER_ASSERT(i->build_type >= 0); SER_ASSERT(i->build_type >= 0);
SER_ASSERT(i->build_type < BoxLast); SER_ASSERT(i->build_type < BoxLast);
SER_VAR(&i->build_rotation); SER_VAR(&i->build_rotation);
SER_ASSERT(!isnan(i->build_rotation));
return ser_ok; return ser_ok;
} }
@ -1717,4 +1716,4 @@ void process(GameState* gs, float dt)
} }
cpSpaceStep(gs->space, dt); cpSpaceStep(gs->space, dt);
} }

@ -1,6 +1,6 @@
#include "types.h"
#define MINIAUDIO_IMPLEMENTATION #define MINIAUDIO_IMPLEMENTATION
#include "miniaudio.h" #include "miniaudio.h"
#include "types.h"
#define SOKOL_IMPL #define SOKOL_IMPL
#include "sokol_time.h" #include "sokol_time.h"
@ -14,18 +14,15 @@ ServerThreadInfo server_info = {
void term(int signum) void term(int signum)
{ {
ma_mutex_lock(&server_info.info_mutex); server_info.should_quit = true;
server_info.running = false;
ma_mutex_unlock(&server_info.info_mutex);
} }
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
struct sigaction action; struct sigaction action;
memset(&action, 0, sizeof(struct sigaction)); memset(&action, 0, sizeof(struct sigaction));
action.sa_handler = term; action.sa_handler = term;
sigaction(SIGTERM, &action, NULL); sigaction(SIGTERM, &action, NULL);
stm_setup(); stm_setup();
ma_mutex_init(&server_info.info_mutex); ma_mutex_init(&server_info.info_mutex);

@ -82,7 +82,7 @@ typedef void cpShape;
#include <stdbool.h> #include <stdbool.h>
#ifndef OPUS_TYPES_H #ifndef OPUS_TYPES_H
typedef __int32 opus_int32; typedef int opus_int32;
#endif #endif
#ifndef _STDBOOL #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 } (Color) { .r = 1.0f, .g = 1.0f, .b = 1.0f, .a = 1.0f }
#define RED \ #define RED \
(Color) { .r = 1.0f, .g = 0.0f, .b = 0.0f, .a = 1.0f } (Color) { .r = 1.0f, .g = 0.0f, .b = 0.0f, .a = 1.0f }
#define GOLD colhex(255, 215, 0) #define GOLD colhex(255, 215, 0)

Binary file not shown.
Loading…
Cancel
Save