Remove "proof of concept" launching of levels from the command line.
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sun, 13 Aug 2006 22:43:34 +0000 (22:43 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Sun, 13 Aug 2006 22:43:34 +0000 (22:43 +0000)
(Revision [202].)  Breaking replays for a development feature isn't
worth it.  Anyhow, a branch would be a better place for this.

git-svn-id: https://s.snth.net/svn/neverball/trunk@548 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/game.c
ball/level.c
ball/levels.c
ball/main.c
ball/set.c
ball/st_title.c

index f464fcd..50d023f 100644 (file)
@@ -189,7 +189,8 @@ int game_init(const struct level *level, int t, int g)
     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);
 
index 3e68e97..2037b89 100644 (file)
@@ -124,7 +124,7 @@ int level_load(const char *filename, struct level *level)
     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,
index 1c9ccb1..4da6d14 100644 (file)
@@ -37,8 +37,6 @@ int level_replay(const char *filename)
     return demo_replay_init(filename, &current_level_game);
 }
 
-static struct level single_level; /* a level without set */
-
 int level_play_go(void)
 /* Start to play the current level */
 {
@@ -63,16 +61,6 @@ int level_play_go(void)
     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)
index 0077026..3321266 100644 (file)
@@ -220,7 +220,6 @@ static int loop(void)
 
 static char *data_path    = NULL;
 static char *replay_path  = NULL;
-static char *level_path   = NULL;
 static int   display_info = 0;
 
 /* Option handling */
@@ -233,7 +232,6 @@ static void parse_args(int argc, char **argv)
     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"
@@ -260,8 +258,6 @@ static void parse_args(int argc, char **argv)
             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)
@@ -328,20 +324,11 @@ int main(int argc, char *argv[])
             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;
         }
@@ -426,11 +413,6 @@ int main(int argc, char *argv[])
         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);
 
index 87df3b9..2825df3 100644 (file)
@@ -337,7 +337,7 @@ static void set_load_levels(void)
             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;
index 09bac05..70d85bd 100644 (file)
@@ -98,7 +98,7 @@ static int title_enter(void)
     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;