From bee784c36e81bc37b6d6781964ebf0cc12b413de Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Tue, 9 Dec 2025 16:03:30 -0600 Subject: [PATCH] fix clang build --- Makefile | 1 + src/main.c | 5 ++--- src/render.cpp | 24 +----------------------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 71d451a..b155efb 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ CFLAGS += -Wno-error=unused-const-variable CFLAGS += -Wno-error=unused-but-set-variable CFLAGS += -Wno-error=unused-variable CFLAGS += -I$(MAKEFILE_PATH)/include +CFLAGS += -I$(dir $(GLFW))../include CXXFLAGS += -fno-exceptions #CFLAGS += -DDEBUG_BUTTONS #CFLAGS += -DDEBUG_AXES diff --git a/src/main.c b/src/main.c index ec9cf57..d95ee2b 100644 --- a/src/main.c +++ b/src/main.c @@ -234,7 +234,7 @@ int main() const double frame_rate = 60.0; const double first_frame = glfwGetTime(); double last_frame = first_frame; - double frames = 1; + //double frames = 1; const char * last_gamepad_name = NULL; struct game_state state = {0}; @@ -404,8 +404,7 @@ int main() glfwWaitEventsTimeout(delta); } //printf("fps %f\n", frames / (glfwGetTime() - first_frame)); - - frames += 1; + //frames += 1; } glfwTerminate(); diff --git a/src/render.cpp b/src/render.cpp index 5f71bd2..784805d 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -55,20 +55,6 @@ mat4x4 perspective(float low1, float high1, return m3; } -static const float x_scale = 1.0f / 12.0f; -//static const float y_scale = 1.0f / 27.0f; -static const float y_scale = 1.0f / 12.0f; - -static inline float px(float x) -{ - return (x * x_scale) * 2.0 - 1.0 + x_scale; -} - -static inline float py(float y) -{ - return (y * y_scale) * -2.0 + 1.0 - y_scale; -} - /* levels are 13x28 */ @@ -166,7 +152,7 @@ void render_blocks(mesh block_mesh, base_color = vec4(1, 0, 0, (float)((2.0 - dt) * 0.5)); block_position.y -= dt * 10.0; block_position.z += 1; - float dir = fabsf(sin(destroyed_time * 100)) / sin(destroyed_time * 100); + float dir = fabs(sin(destroyed_time * 100)) / sin(destroyed_time * 100); rot = dt * dir; } @@ -288,14 +274,6 @@ static inline mat4x4 char_tex_trans(char c) return texture_trans; } -static inline int max(int a, int b) -{ - if (a > b) - return a; - else - return b; -} - void render_text(struct mesh plane_mesh, uint uniform_trans, uint uniform_texture_trans,