diff --git a/qw/source/sbar.c b/qw/source/sbar.c index fcc7fc3fe..35a2cf26b 100644 --- a/qw/source/sbar.c +++ b/qw/source/sbar.c @@ -1973,13 +1973,11 @@ Sbar_GIB_Print_Center_f (void) Sbar_CenterPrint (GIB_Argv(1)); } -void -Sbar_Init (void) +static void +sbar_load_pics (void) { int i; - init_views (); - for (i = 0; i < 10; i++) { sb_nums[0][i] = Draw_PicFromWad (va ("num_%i", i)); sb_nums[1][i] = Draw_PicFromWad (va ("anum_%i", i)); @@ -2054,6 +2052,26 @@ Sbar_Init (void) sb_face_invis_invuln = Draw_PicFromWad ("face_inv2"); sb_face_quad = Draw_PicFromWad ("face_quad"); + sb_sbar = Draw_PicFromWad ("sbar"); + sb_ibar = Draw_PicFromWad ("ibar"); + sb_scorebar = Draw_PicFromWad ("scorebar"); +} + +static void +sbar_gamedir (int phase) +{ + if (!phase) + return; + sbar_load_pics (); +} + +void +Sbar_Init (void) +{ + QFS_GamedirCallback (sbar_gamedir); + sbar_load_pics (); + init_views (); + Cmd_AddCommand ("+showscores", Sbar_ShowScores, "Display information on everyone playing"); Cmd_AddCommand ("-showscores", Sbar_DontShowScores, @@ -2063,10 +2081,6 @@ Sbar_Init (void) Cmd_AddCommand ("-showteamscores", Sbar_DontShowTeamScores, "Stop displaying information for your team"); - sb_sbar = Draw_PicFromWad ("sbar"); - sb_ibar = Draw_PicFromWad ("ibar"); - sb_scorebar = Draw_PicFromWad ("scorebar"); - r_viewsize_callback = viewsize_f; hud_scoreboard_uid = Cvar_Get ("hud_scoreboard_uid", "0", CVAR_NONE,