From c940284a53a0370cf3b65dd33314340ecd6135d6 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Tue, 1 Oct 2024 14:09:08 +0700 Subject: [PATCH] fix solid background, error message if hu_font not found --- src/st_stuff.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index d8e04629c..beeabff32 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -31,6 +31,7 @@ #include "doomtype.h" #include "hu_command.h" #include "hu_obituary.h" +#include "i_system.h" #include "i_video.h" #include "info.h" #include "m_array.h" @@ -1323,7 +1324,7 @@ static void DrawSolidBackground(void) patch_t *sbar = V_CachePatchName("STBAR", PU_CACHE); // [FG] temporarily draw status bar to background buffer - V_DrawPatch(0, 0, sbar); + V_DrawPatch(-video.deltaw, 0, sbar); byte *pal = W_CacheLumpName("PLAYPAL", PU_CACHE); @@ -1690,17 +1691,19 @@ void ST_Start(void) } } -patch_t **hu_font; +patch_t **hu_font = NULL; void ST_Init(void) { sbardef = ST_ParseSbarDef(); - if (sbardef) + if (!sbardef) { - LoadFacePatches(); + return; } + LoadFacePatches(); + hudfont_t *hudfont; array_foreach(hudfont, sbardef->hudfonts) { @@ -1711,6 +1714,11 @@ void ST_Init(void) } } + if (!hu_font) + { + I_Error("ST_Init: \"Console\" font not found"); + } + HU_InitCrosshair(); HU_InitCommandHistory(); HU_InitObituaries();