if (game_state)
game_free();
- if (!sol_load_gl(&file, level->file, config_get_d(CONFIG_TEXTURES),
+ if (!sol_load_gl(&file, config_data(level->file),
+ config_get_d(CONFIG_TEXTURES),
config_get_d(CONFIG_SHADOW)))
return (game_state = 0);
memset(&sol, 0, sizeof (sol));
/* Try to load the sol file */
- if (!sol_load_only_head(&sol, filename))
+ if (!sol_load_only_head(&sol, config_data(filename)))
{
fprintf(stderr,
_("Error while loading level file '%s': %s\n"), filename,
return demo_replay_init(filename, ¤t_level_game);
}
-static struct level single_level; /* a level without set */
-
int level_play_go(void)
/* Start to play the current level */
{
return demo_play_init(USER_REPLAY_FILE, l, lg);
}
-/* Prepare to play a single level */
-
-void level_play_single(const char *filename)
-{
- struct level *l = &single_level;
-
- level_load(filename, l);
- level_play(l, MODE_SINGLE);
-}
-
/* Prepare to play a level sequence from the `i'th level */
void level_play(const struct level *l, int m)
static char *data_path = NULL;
static char *replay_path = NULL;
-static char *level_path = NULL;
static int display_info = 0;
/* Option handling */
const char *usage = _(
"Usage: %s [options ...]\n"
"-r, --replay file play the replay 'file'.\n"
- "-l, --level file.sol play the level 'file.sol'.\n"
"-i, --info display info about level or replay.\n"
" --data dir use 'dir' as game data directory.\n"
"-v, --version show version.\n"
data_path = *(++argv);
else if ((CASE("-r") || CASE("--replay")) && MAND)
replay_path = *(++argv);
- else if ((CASE("-l") || CASE("--level")) && MAND)
- level_path = *(++argv);
else if ((CASE("-i") || CASE("--info")))
display_info = 1;
else if (!missing)
demo_replay_dump_info();
}
- if (level_path != NULL)
- {
- struct level l;
- if (!level_load(level_path, &l))
- return 1;
- else if (display_info)
- level_dump_info(&l);
- }
-
if (display_info)
{
- if (replay_path == NULL && level_path == NULL)
+ if (replay_path == NULL)
{
- fprintf(stderr, _("%s: --info requires --replay or --level\n"),
+ fprintf(stderr, _("%s: --info requires --replay\n"),
argv[0]);
return 1;
}
demo_play_goto(1);
goto_state(&st_demo_play);
}
- else if (level_path != NULL)
- {
- level_play_single(level_path);
- goto_state(&st_level);
- }
else
goto_state(&st_title);
res = (fscanf(fin, "%s", name) == 1);
assert(res);
- level_load(config_data(name), l);
+ level_load(name, l);
/* Initialize set related info */
l->set = current_set;
audio_music_fade_to(0.5f, "bgm/title.ogg");
/* Initialize the first level of the first set for display. */
- level_load(config_data("map-rlk/title.sol"), &title_level);
+ level_load("map-rlk/title.sol", &title_level);
game_init(&title_level, 0, 0);
real_time = 0.0f;