Added HUD toggle for replays.
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 11 Jan 2008 21:07:20 +0000 (21:07 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 11 Jan 2008 21:07:20 +0000 (21:07 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@1458 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/st_demo.c
ball/st_play.c

index 3b136d4..5c3b3fa 100644 (file)
@@ -311,6 +311,7 @@ static int demo_buttn(int b, int d)
 
 static int standalone;
 static int demo_paused;
+static int show_hud;
 
 void demo_play_goto(int s)
 {
@@ -335,8 +336,8 @@ static int demo_play_enter(void)
         gui_pulse(id, 1.2f);
     }
 
+    show_hud = 1;
     hud_update(0);
-
     game_set_fly(0.f);
 
     return id;
@@ -345,7 +346,9 @@ static int demo_play_enter(void)
 static void demo_play_paint(int id, float st)
 {
     game_draw(0, st);
-    hud_paint();
+
+    if (show_hud)
+        hud_paint();
 
     if (time_state() < 1.f)
         gui_paint(id);
@@ -375,6 +378,9 @@ static int demo_play_keybd(int c, int d)
             demo_paused = 1;
             return goto_state(&st_demo_end);
         }
+
+        if (c == SDLK_F6)
+            show_hud = !show_hud;
     }
     return 1;
 }
index cfa5c8f..af4aead 100644 (file)
@@ -165,7 +165,7 @@ static int play_set_buttn(int b, int d)
 
 /*---------------------------------------------------------------------------*/
 
-static int nohud = 0;
+static int show_hud;
 
 static int play_loop_enter(void)
 {
@@ -191,7 +191,7 @@ static int play_loop_enter(void)
 
     hud_view_pulse(config_get_d(CONFIG_CAMERA));
 
-    nohud = 0;
+    show_hud = 1;
 
     hud_update(0);
 
@@ -202,7 +202,7 @@ static void play_loop_paint(int id, float st)
 {
     game_draw(0, st);
 
-    if (!nohud)
+    if (show_hud)
         hud_paint();
 
     if (time_state() < 1.f)
@@ -314,7 +314,7 @@ static int play_loop_keybd(int c, int d)
         return goto_state(&st_look);
 
     if (d && c == SDLK_F6)
-        nohud = !nohud;
+        show_hud = !show_hud;
 
     if (d && c == SDLK_c && config_cheat())
     {