aboutsummaryrefslogtreecommitdiff
path: root/src/sdl/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdl/main.c')
-rw-r--r--src/sdl/main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sdl/main.c b/src/sdl/main.c
index 46f30c3..c3a9abe 100644
--- a/src/sdl/main.c
+++ b/src/sdl/main.c
@@ -60,11 +60,18 @@ load_font(
static void
solve_on_error(
- const char * const err
+ const char * const err,
+ void *user_data
) {
+ UNUSED(user_data);
die("Error solving level: %s", err);
}
+static const sok_solve_cbs_t
+SOLVE_CBS = {
+ .on_error = solve_on_error,
+};
+
static void
set_level(
draw_ctx_t * const draw_ctx,
@@ -233,7 +240,7 @@ int main(int argc, char *argv[]) {
// get current number of moves
const size_t old_num_moves = ctx.num_moves;
- if (sok_solve(&ctx, solve_on_error)) {
+ if (sok_solve(&ctx, &SOLVE_CBS, NULL)) {
// found solution, print it
log_moves(&ctx, old_num_moves);
} else {