fix clang build
This commit is contained in:
parent
04a73ef02a
commit
bee784c36e
1
Makefile
1
Makefile
@ -16,6 +16,7 @@ CFLAGS += -Wno-error=unused-const-variable
|
|||||||
CFLAGS += -Wno-error=unused-but-set-variable
|
CFLAGS += -Wno-error=unused-but-set-variable
|
||||||
CFLAGS += -Wno-error=unused-variable
|
CFLAGS += -Wno-error=unused-variable
|
||||||
CFLAGS += -I$(MAKEFILE_PATH)/include
|
CFLAGS += -I$(MAKEFILE_PATH)/include
|
||||||
|
CFLAGS += -I$(dir $(GLFW))../include
|
||||||
CXXFLAGS += -fno-exceptions
|
CXXFLAGS += -fno-exceptions
|
||||||
#CFLAGS += -DDEBUG_BUTTONS
|
#CFLAGS += -DDEBUG_BUTTONS
|
||||||
#CFLAGS += -DDEBUG_AXES
|
#CFLAGS += -DDEBUG_AXES
|
||||||
|
|||||||
@ -234,7 +234,7 @@ int main()
|
|||||||
const double frame_rate = 60.0;
|
const double frame_rate = 60.0;
|
||||||
const double first_frame = glfwGetTime();
|
const double first_frame = glfwGetTime();
|
||||||
double last_frame = first_frame;
|
double last_frame = first_frame;
|
||||||
double frames = 1;
|
//double frames = 1;
|
||||||
const char * last_gamepad_name = NULL;
|
const char * last_gamepad_name = NULL;
|
||||||
|
|
||||||
struct game_state state = {0};
|
struct game_state state = {0};
|
||||||
@ -404,8 +404,7 @@ int main()
|
|||||||
glfwWaitEventsTimeout(delta);
|
glfwWaitEventsTimeout(delta);
|
||||||
}
|
}
|
||||||
//printf("fps %f\n", frames / (glfwGetTime() - first_frame));
|
//printf("fps %f\n", frames / (glfwGetTime() - first_frame));
|
||||||
|
//frames += 1;
|
||||||
frames += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
|
|||||||
@ -55,20 +55,6 @@ mat4x4 perspective(float low1, float high1,
|
|||||||
return m3;
|
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
|
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));
|
base_color = vec4(1, 0, 0, (float)((2.0 - dt) * 0.5));
|
||||||
block_position.y -= dt * 10.0;
|
block_position.y -= dt * 10.0;
|
||||||
block_position.z += 1;
|
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;
|
rot = dt * dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,14 +274,6 @@ static inline mat4x4 char_tex_trans(char c)
|
|||||||
return texture_trans;
|
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,
|
void render_text(struct mesh plane_mesh,
|
||||||
uint uniform_trans,
|
uint uniform_trans,
|
||||||
uint uniform_texture_trans,
|
uint uniform_texture_trans,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user