fix clang build

This commit is contained in:
Zack Buhman 2025-12-09 16:03:30 -06:00
parent 04a73ef02a
commit bee784c36e
3 changed files with 4 additions and 26 deletions

View File

@ -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

View File

@ -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();

View File

@ -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,