diff --git a/platform/sdl3/main.c b/platform/sdl3/main.c index 9dd6562..136a6a5 100644 --- a/platform/sdl3/main.c +++ b/platform/sdl3/main.c @@ -22,7 +22,7 @@ static bool focused = true; static Sint64 now = 0, then = 0; -static int requested_map = 0; +static int requested_map = -1; static void die(const char *fmt, ...) { @@ -87,14 +87,15 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) /* get requested map */ if (argc > 1) + { requested_map = SDL_atoi(argv[1]); - - SDL_Log("Loading map %d", requested_map); - - if (requested_map >= 0) + SDL_Log("Loading map %d", requested_map); game_load_map(&yeti, maps[requested_map]); + } else + { game_load_map(&yeti, &map_e1m1); + } game_goto(&yeti.game, GAME_MODE_PLAY);