Fix filling in demo name on Windows. The last directory delimiter will always
[neverball] / ball / st_play.c
index ee3357d..5dd6b67 100644 (file)
@@ -22,8 +22,7 @@
 #include "st_shared.h"
 
 #include "st_play.h"
-#include "st_fail.h"
-#include "st_goal.h"
+#include "st_play_end.h"
 #include "st_over.h"
 
 /*---------------------------------------------------------------------------*/
@@ -199,15 +198,8 @@ static void play_loop_timer(int id, float dt)
     state = game_step(g, at, &state_value);
     if (state)
     {
-       level_stop(state, state_value, curr_clock(), curr_coins());
-       goto_state(&st_goal);
-/*     switch (state)
-       {
-       case GAME_TIME: goto_state(&st_time_out); break;
-       case GAME_FALL: goto_state(&st_fall_out); break;
-       case GAME_SPEC:
-       case GAME_GOAL: goto_state(&st_goal);     break;
-       }*/
+        level_stop(state, state_value, curr_clock(), curr_coins());
+        goto_state(&st_play_end);
     }
 
     game_step_fade(dt);
@@ -277,7 +269,7 @@ static int play_loop_keybd(int c, int d)
     if (d && c == SDLK_c && config_get_d(CONFIG_CHEAT))
     {
         level_stop(GAME_GOAL, 0, curr_clock(), curr_coins());
-        return goto_state(&st_goal);
+        return goto_state(&st_play_end);
     }
     return 1;
 }
@@ -287,10 +279,10 @@ static int play_loop_buttn(int b, int d)
     if (d == 1)
     {
         if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
-       {
-           level_stop(GAME_NONE, 0, curr_clock(), curr_coins());
+        {
+            level_stop(GAME_NONE, 0, curr_clock(), curr_coins());
             return abort_play();
-       }
+        }
 
         if (config_tst_d(CONFIG_JOYSTICK_BUTTON_R, b))
             view_rotate = +1;
@@ -361,7 +353,7 @@ static void look_point(int id, int x, int y, int dx, int dy)
 static int look_keybd(int c, int d)
 {
     if (d && c == SDLK_F12)
-       return goto_state(&st_play_loop);
+        return goto_state(&st_play_loop);
 
     return 1;
 }
@@ -369,7 +361,7 @@ static int look_keybd(int c, int d)
 static int look_buttn(int b, int d)
 {
     if (d && config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
-       return goto_state(&st_play_loop);
+        return goto_state(&st_play_loop);
 
     return 1;
 }