Oops, forgot to enable the stats only on config.
[neverball] / ball / hud.c
index 3a3f966..13da0cd 100644 (file)
@@ -51,6 +51,9 @@ static void hud_fps(void)
 
     if (now - then > 250)
     {
+        if (count && config_get_d(CONFIG_STATS))
+            fprintf(stdout, "%f\n", (float) (now - then) / count);
+
         fps   = count * 1000 / (now - then);
         then  = now;
         count = 0;
@@ -127,12 +130,15 @@ void hud_free(void)
 void hud_paint(void)
 {
     int mode = curr_lg()->mode;
+
     if (mode == MODE_CHALLENGE)
         gui_paint(Lhud_id);
-    if (mode == MODE_PRACTICE || mode == MODE_SINGLE)
+
+    if (mode == MODE_PRACTICE)
         gui_paint(Rhud2_id);
     else
         gui_paint(Rhud_id);
+
     gui_paint(time_id);
 
     if (config_get_d(CONFIG_FPS))
@@ -171,9 +177,7 @@ void hud_update(int pulse)
     {
         gui_set_clock(time_id, clock);
 
-        if (last > clock && pulse &&
-            mode != MODE_PRACTICE &&
-            mode != MODE_SINGLE)
+        if (last > clock && pulse && mode != MODE_PRACTICE)
         {
             if (clock <= 1000 && (last / 100) > (clock / 100))
             {
@@ -190,19 +194,6 @@ void hud_update(int pulse)
 
     /* balls and score + select coin widget */
 
-#if 0
-    if (mode == MODE_CHALLENGE)
-    {
-        if (gui_value(ball_id) != balls) gui_set_count(ball_id, balls);
-        if (gui_value(scor_id) != score) gui_set_count(scor_id, score);
-        c_id = coin_id;
-    }
-    else if (mode == MODE_NORMAL)
-        c_id = coin_id;
-    else
-        c_id = coin2_id;
-#endif
-
     switch (mode)
     {
     case MODE_CHALLENGE: