Skip to content

Commit

Permalink
fix solid background, error message if hu_font not found
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Oct 1, 2024
1 parent e979aa3 commit c940284
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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)
{
Expand All @@ -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();
Expand Down

0 comments on commit c940284

Please sign in to comment.