Nevermania: Tweaks
[neverball] / ball / st_level.c
index e84e6b1..f408dbd 100644 (file)
@@ -12,6 +12,8 @@
  * General Public License for more details.
  */
 
+#include <string.h>
+
 #include "gui.h"
 #include "game.h"
 #include "set.h"
@@ -23,6 +25,7 @@
 #include "st_level.h"
 #include "st_play.h"
 #include "st_start.h"
+#include "st_over.h"
 
 /*---------------------------------------------------------------------------*/
 
@@ -47,16 +50,27 @@ static int level_enter(void)
 
             if ((kd = gui_vstack(jd)))
             {
-                gui_label(kd, _(curr_set()->name), GUI_SML,
-                          GUI_ALL, gui_wht, gui_wht);
+                gui_label(kd, set_name(curr_set()), GUI_SML, GUI_ALL,
+                          gui_wht, gui_wht);
+
                 gui_space(kd);
 
                 if ((ld = gui_hstack(kd)))
                 {
-                    gui_label(ld, ln,          GUI_LRG, GUI_NE,
-                              textcol1, textcol2);
-                    gui_label(ld, _("Level "), GUI_LRG, GUI_NW,
-                              textcol1, textcol2);
+                    if (b == 0)
+                    {
+                        gui_label(ld, ln,          GUI_LRG, GUI_NE,
+                                  textcol1, textcol2);
+                        gui_label(ld, _("Level "), GUI_LRG, GUI_NW,
+                                  textcol1, textcol2);
+                    }
+                    else
+                    {
+                        gui_label(ld, ln,                GUI_MED, GUI_NE,
+                                  textcol1, textcol2);
+                        gui_label(ld, _("Bonus Level "), GUI_MED, GUI_NW,
+                                  textcol1, textcol2);
+                    }
                 }
 
                 gui_label(kd, mode_to_str(lg->mode, 1), GUI_SML, GUI_BOT,
@@ -82,7 +96,6 @@ static int level_enter(void)
 static void level_timer(int id, float dt)
 {
     game_step_fade(dt);
-    audio_timer(dt);
 }
 
 static int level_click(int b, int d)
@@ -107,8 +120,9 @@ static int level_buttn(int b, int d)
         }
         if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
         {
-            level_stop(GAME_NONE, curr_clock(), curr_coins());
-            return goto_end_level();
+            level_stat(GAME_NONE, curr_clock(), curr_coins());
+            level_stop();
+            return goto_state(&st_over);
         }
     }
     return 1;
@@ -116,16 +130,16 @@ static int level_buttn(int b, int d)
 
 /*---------------------------------------------------------------------------*/
 
-static void poser_paint(int id, float st)
+static void poser_paint(int id, float t)
 {
-    game_draw(1, st);
+    game_draw(1, t);
 }
 
 static int poser_buttn(int c, int d)
 {
     if (d && config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, c))
         return goto_state(&st_level);
-    
+
     return 1;
 }
 
@@ -138,6 +152,7 @@ struct state st_level = {
     level_timer,
     NULL,
     NULL,
+    NULL,
     level_click,
     level_keybd,
     level_buttn,
@@ -153,6 +168,7 @@ struct state st_poser = {
     NULL,
     NULL,
     NULL,
+    NULL,
     poser_buttn,
     1, 0
 };