diff --git a/.clang-format b/.clang-format index 6a30c4e..e3389be 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,5 @@ BasedOnStyle: LLVM ColumnLimit: 0 SpacesInParentheses: false -BreakBeforeBraces: Allman \ No newline at end of file +BreakBeforeBraces: Allman +IndentWidth: 2 \ No newline at end of file diff --git a/build_linux_server_release.sh b/build_linux_server_release.sh index 087e800..cc2f436 100755 --- a/build_linux_server_release.sh +++ b/build_linux_server_release.sh @@ -6,4 +6,4 @@ cmake .. cmake --build . cd - -gcc -o flight_server -Wall -O2 -DRELEASE -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 +gcc -o flight_server -Wall -O2 -DNDEBUG -DRELEASE -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/build_release.bat b/build_release.bat index b0fcea4..bae8730 100644 --- a/build_release.bat +++ b/build_release.bat @@ -1,3 +1,3 @@ call shadergen.bat -set compileopts=/Fe"flight_release" /O2 /DRELEASE +set compileopts=/Fe"flight_release" /O2 /DRELEASE /DNDEBUG call build_msvc.bat \ No newline at end of file diff --git a/buildsettings.h b/buildsettings.h index 38f5aa3..45b1aba 100644 --- a/buildsettings.h +++ b/buildsettings.h @@ -9,7 +9,7 @@ #define SERVER_ADDRESS "127.0.0.1" -#define PROFILING +// #define PROFILING #define DEBUG_RENDERING #define DEBUG_WORLD #define UNLOCK_ALL @@ -20,6 +20,8 @@ #ifdef RELEASE +// #define PROFILING +// #define SERVER_ADDRESS "127.0.0.1" #define SERVER_ADDRESS "207.246.80.160" #else diff --git a/gamestate.c b/gamestate.c index 03af263..c5c0274 100644 --- a/gamestate.c +++ b/gamestate.c @@ -2485,6 +2485,7 @@ void process(struct GameState *gs, double dt, bool is_subframe) } // sun processing for this current entity + #if 0 PROFILE_SCOPE("this entity sun processing") { SUNS_ITER(gs) @@ -2516,6 +2517,7 @@ void process(struct GameState *gs, double dt, bool is_subframe) } } } + #endif if (e->is_explosion) { diff --git a/main.c b/main.c index 4ee386e..6b60cc4 100644 --- a/main.c +++ b/main.c @@ -914,7 +914,6 @@ static void ui(bool draw, double dt, double width, double height) bool invited = myentity() != NULL && myentity()->squad_invited_to != SquadNone; double size = 200.0; - double yes_no_size = 50.0; double x_center = 0.75 * width; double x = x_center - size / 2.0; // AABB box = (AABB){ .x = x, .y = invite_y, .width = size, .height = size @@ -1420,7 +1419,6 @@ static void frame(void) interact_pressed = mousepressed[SAPP_MOUSEBUTTON_RIGHT].pressed; // networking - static cpVect before_reprediction = {0}; PROFILE_SCOPE("networking") { ENetEvent event; @@ -1460,8 +1458,6 @@ static void frame(void) &decompressed_max_len, NULL); if (return_value == LZO_E_OK) { - if (myentity() != NULL) - before_reprediction = entity_pos(myentity()); PROFILE_SCOPE("Deserializing data") { server_to_client_deserialize(&msg, decompressed, @@ -1563,8 +1559,6 @@ static void frame(void) // gameplay ui(false, dt, width, height); // if ui button is pressed before game logic, set the pressed to // false so it doesn't propagate from the UI modal/button - cpVect build_target_pos = {0}; - double build_target_rotation = 0.0; struct BuildPreviewInfo { cpVect grid_pos; @@ -1843,8 +1837,6 @@ static void frame(void) draw_circle(entity_pos(myentity()), VISION_RADIUS); } - double halfbox = BOX_SIZE / 2.0; - // mouse frozen, debugging tool if (mouse_frozen) {