NO WARNINGS

This commit is contained in:
2024-08-27 13:42:40 +03:00
parent 93f61018cd
commit 66c90181cd
7 changed files with 17 additions and 6 deletions

View File

@ -20,8 +20,6 @@ void game_tick(void) {
state->scene = title_scene(state);
}
struct state *state = ctx.udata;
input_add_action(&ctx.input, "debug_dump_atlases");
input_bind_action_scancode(&ctx.input, "debug_dump_atlases", SDL_SCANCODE_HOME);

View File

@ -59,7 +59,7 @@ static void ingame_tick(struct state *state) {
m_set(rect, ((t_frect){ 256, 256, 48, 48 })),
m_opt(color, ((t_color){ 255, 255, 255, 255 })),
m_opt(stretch, false ),
m_opt(texture_origin, ((t_fvec2){ ctx.tick_count % 48, ctx.tick_count % 48 })));
m_opt(texture_origin, ((t_fvec2){ (float)(ctx.tick_count % 48), (float)(ctx.tick_count % 48) })));
m_sprite(m_set(path, "/assets/light.png"),
m_set(rect, ((t_frect){ 48, 64, 64, 64 })),

View File

@ -18,13 +18,13 @@ static void title_tick(struct state *state) {
m_sprite("/assets/title.png", ((t_frect) {
(RENDER_BASE_WIDTH / 2) - (320 / 2), 64, 320, 128 }));
((float)RENDER_BASE_WIDTH / 2) - ((float)320 / 2), 64, 320, 128 }));
/* draw the tick count as an example of dynamic text */
size_t text_str_len = snprintf(NULL, 0, "%lld", state->ctx->tick_count) + 1;
size_t text_str_len = snprintf(NULL, 0, "%lu", state->ctx->tick_count) + 1;
char *text_str = cmalloc(text_str_len);
snprintf(text_str, text_str_len, "%lld", state->ctx->tick_count);
snprintf(text_str, text_str_len, "%lu", state->ctx->tick_count);
const char *font = "fonts/kenney-pixel.ttf";
int text_h = 32;