diff options
Diffstat (limited to 'src/sdl')
-rw-r--r-- | src/sdl/draw.c | 9 | ||||
-rw-r--r-- | src/sdl/main.c | 10 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/sdl/draw.c b/src/sdl/draw.c index e275038..99faa19 100644 --- a/src/sdl/draw.c +++ b/src/sdl/draw.c @@ -1,5 +1,6 @@ #include <stdbool.h> // bool #include <math.h> // sinf() +#include <stdio.h> // snprintf() #include "util.h" // warn()/die() #include "color.h" // set_color() #include "draw.h" @@ -188,10 +189,10 @@ draw_title_text( char buf[256]; snprintf( buf, sizeof(buf), - " %s: %s (#%zu) ", + " %s: %s (#%d) ", draw_ctx->level->pack, draw_ctx->level->name, - *draw_ctx->level_num + (int) *draw_ctx->level_num ); // draw text @@ -216,8 +217,8 @@ draw_moves_text( char buf[256]; snprintf( buf, sizeof(buf), - " Moves: %zu%s ", - draw_ctx->ctx->num_moves, + " Moves: %d%s ", + (int) draw_ctx->ctx->num_moves, sok_ctx_is_done(draw_ctx->ctx) ? " (Won!)" : "" ); diff --git a/src/sdl/main.c b/src/sdl/main.c index 7cbe68f..3a20720 100644 --- a/src/sdl/main.c +++ b/src/sdl/main.c @@ -29,7 +29,7 @@ log_moves( buf[ofs++] = SOK_DIR_TO_CHAR(ctx->moves[i].dir); } - SDL_Log("Solution (%zu moves): %s", ctx->num_moves - skip_moves, buf); + SDL_Log("Solution (%d moves): %s", (int) (ctx->num_moves - skip_moves), buf); } static TTF_Font * @@ -77,15 +77,15 @@ set_level( // load level if (!sok_ctx_set_level(ctx, draw_ctx->level->data)) { - die("Couldn't load level %zu", level_num); + die("Couldn't load level %d", (int) level_num); } // log level title SDL_Log( - "Loaded level \"%s: %s\" (#%zu)", + "Loaded level \"%s: %s\" (#%d)", draw_ctx->level->pack, draw_ctx->level->name, - level_num + (int) level_num ); } @@ -205,7 +205,7 @@ int main(int argc, char *argv[]) { case ACTION_RESET: // reset level if (!sok_ctx_set_level(&ctx, draw_ctx.level->data)) { - die("Couldn't load level %zu", level_num); + die("Couldn't load level %d", (int) level_num); } break; |