oops! fixed
[neverball] / ball / st_set.c
index b3b6331..7246263 100644 (file)
 #include "gui.h"
 #include "set.h"
 #include "progress.h"
-#include "game.h"
 #include "audio.h"
 #include "config.h"
 #include "util.h"
-#include "st_shared.h"
+#include "common.h"
+
+#include "game_common.h"
 
 #include "st_set.h"
 #include "st_title.h"
 #include "st_start.h"
+#include "st_shared.h"
 
 /*---------------------------------------------------------------------------*/
 
-#define SET_STEP    5
+#define SET_STEP 6
 
 static int total = 0;
 static int first = 0;
@@ -44,7 +46,7 @@ static int set_action(int i)
     switch (i)
     {
     case GUI_BACK:
-        set_free();
+        set_quit();
         return goto_state(&st_title);
         break;
 
@@ -101,6 +103,8 @@ static int set_enter(void)
     if (do_init)
     {
         total = set_init();
+        first = MIN(first, (total - 1) - ((total - 1) % SET_STEP));
+
         audio_music_fade_to(0.5f, "bgm/inter.ogg");
         audio_play(AUD_START, 1.f);
     }
@@ -115,6 +119,8 @@ static int set_enter(void)
             gui_navig(jd, first > 0, first + SET_STEP < total);
         }
 
+        gui_space(id);
+
         if ((jd = gui_harray(id)))
         {
             shot_id = gui_image(jd, set_shot(first), 7 * w / 16, 7 * h / 16);