Those sets haven't been merged.
[neverball] / ball / st_goal.c
index 094a298..96f5f98 100644 (file)
@@ -12,7 +12,7 @@
  * General Public License for more details.
  */
 
-#include <stdio.h> /* Necessary for sprintf() line 128 */.
+#include <stdio.h>
 
 #include "gui.h"
 #include "game.h"
@@ -100,7 +100,7 @@ static int goal_enter(void)
 
     int id, jd, kd;
 
-          struct level_game *lg = curr_lg(); /* Note: const removed.  Is this really needed? */
+    struct level_game *lg = curr_lg();
     const struct level *l = lg->level;
 
     int high;
@@ -120,25 +120,18 @@ static int goal_enter(void)
     {
         int gid;
 
-        if(lg->mode == MODE_CHALLENGE && lg->bonus > 0)
+        if (lg->mode == MODE_CHALLENGE && lg->bonus)
         {
-            lg->bonus = 0;
-            lg->bonusid += 1;
-            char buf[MAXSTR] = {0};
+            char buf[MAXSTR];
 
+            sprintf(buf, _("You have unlocked bonus level %s!"),
+                    lg->bonus_repr);
 
-            const char *roman[] =
-            {
-                "",
-                "I",   "II",   "III",   "IV",   "V",
-                "VI",  "VII",  "VIII",  "IX",   "X",
-                "XI",  "XII",  "XIII",  "XIV",  "XV",
-                "XVI", "XVII", "XVIII", "XIX",  "XX",
-                "XXI", "XXII", "XXIII", "XXIV", "XXV"
-            };
-            sprintf(buf, "You Have Unlocked Bonus Level %s!", roman[lg->bonusid]);
             gid = gui_label(id, s3,  GUI_MED, GUI_ALL, gui_grn, gui_red);
             gid = gui_label(id, buf, GUI_SML, GUI_ALL, gui_blu, gui_grn);
+
+            lg->bonus = 0;
+            lg->bonus_repr = NULL;
         }
 
         if (high)
@@ -246,18 +239,18 @@ static int goal_enter(void)
 
 static void goal_timer(int id, float dt)
 {
-    static float DT = 0.0f;
+    static float t = 0.0f;
 
     float g[3] = { 0.0f, 9.8f, 0.0f };
 
-    DT += dt;
+    t += dt;
 
     if (time_state() < 1.f)
     {
+        demo_play_step();
         game_step(g, dt, 0);
-        demo_play_step(dt);
     }
-    else if (DT > 0.05f && coins_id)
+    else if (t > 0.05f && coins_id)
     {
         int coins = gui_value(coins_id);
 
@@ -279,7 +272,7 @@ static void goal_timer(int id, float dt)
                 audio_play(AUD_BALL, 1.0f);
             }
         }
-        DT = 0.0f;
+        t = 0.0f;
     }
 
     gui_timer(id, dt);
@@ -314,6 +307,7 @@ struct state st_goal = {
     goal_timer,
     shared_point,
     shared_stick,
+    shared_angle,
     shared_click,
     NULL,
     goal_buttn,