aboutsummaryrefslogtreecommitdiff
path: root/src/sdl/draw.c
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2019-01-15 20:53:07 -0500
committerPaul Duncan <pabs@pablotron.org>2019-01-15 20:53:07 -0500
commitedbbfd40714ba9adfd770b9ccb6a0eecdc43a736 (patch)
treea078ac125a8355489083baa458738c3336c30910 /src/sdl/draw.c
parentd43d705f4d0dceb503ee04a972929a9f61c85658 (diff)
downloadsok-edbbfd40714ba9adfd770b9ccb6a0eecdc43a736.tar.bz2
sok-edbbfd40714ba9adfd770b9ccb6a0eecdc43a736.zip
fix warnings
Diffstat (limited to 'src/sdl/draw.c')
-rw-r--r--src/sdl/draw.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sdl/draw.c b/src/sdl/draw.c
index 0d2b17a..5bb8de7 100644
--- a/src/sdl/draw.c
+++ b/src/sdl/draw.c
@@ -79,6 +79,7 @@ draw_on_size(
const sok_pos_t level_size,
void * const data
) {
+ UNUSED(ctx);
draw_ctx_t * const draw_ctx = data;
const size_t cell_size = get_cell_size(draw_ctx);
@@ -98,7 +99,7 @@ draw_on_size(
// draw floor
for (size_t y = 0; y < level_size.y; y++) {
for (size_t x = 0; x < level_size.x; x++) {
- if (x > 0 && y > 0 && x < level_size.x - 1 && y < level_size.y - 1) {
+ if (x && y && x < (size_t) (level_size.x - 1) && y < (size_t) (level_size.y - 1)) {
const sok_pos_t pos = { x, y };
draw_cell(draw_ctx, pos, SPRITE_FLOOR, 0);
}
@@ -114,6 +115,7 @@ draw_on_wall(
const sok_pos_t pos,
void * const data
) {
+ UNUSED(ctx);
draw_ctx_t * const draw_ctx = data;
draw_cell(draw_ctx, pos, SPRITE_WALL, 0);
return true;
@@ -127,6 +129,9 @@ draw_on_goal(
const bool has_box,
void * const data
) {
+ UNUSED(ctx);
+ UNUSED(has_player);
+ UNUSED(has_box);
draw_ctx_t * const draw_ctx = data;
draw_cell(draw_ctx, pos, SPRITE_GOAL, 0);
return true;
@@ -139,6 +144,8 @@ draw_on_home(
const bool has_goal,
void * const data
) {
+ UNUSED(ctx);
+ UNUSED(has_goal);
draw_ctx_t * const draw_ctx = data;
const double angle = sok_ctx_is_done(draw_ctx->ctx) ? (10 * sin(draw_ctx->ticks * M_2_PI / 1000.0)) : 0;
@@ -154,6 +161,8 @@ draw_on_box(
const bool has_goal,
void * const data
) {
+ UNUSED(ctx);
+ UNUSED(has_goal);
draw_ctx_t * const draw_ctx = data;
const double angle = sok_ctx_is_done(draw_ctx->ctx) ? (5 * sin((100 * (pos.y + pos.x) + draw_ctx->ticks) * M_2_PI / 1000.0)) : 0;