From 5953f492c1d6ac3c4ff2e5471bf2c6b1807b92d8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Aug 2019 20:09:04 +0200 Subject: [PATCH] - fixed: The OriginalSmallFont must always be created, even when the actual SmallFont is not the IWAD default. --- src/gamedata/fonts/v_font.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gamedata/fonts/v_font.cpp b/src/gamedata/fonts/v_font.cpp index b113480ee..e11423c84 100644 --- a/src/gamedata/fonts/v_font.cpp +++ b/src/gamedata/fonts/v_font.cpp @@ -1609,8 +1609,6 @@ void V_InitFonts() SmallFont = new FFont("SmallFont", "FONTA%02u", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, 1, -1); SmallFont->SetCursor('['); } - OriginalSmallFont = new FFont("OriginalSmallFont", "FONTA%02u", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, 1, -1, -1, false, true); - OriginalSmallFont->SetCursor('['); } else if (Wads.CheckNumForName("STCFN033", ns_graphics) >= 0) { @@ -1626,9 +1624,20 @@ void V_InitFonts() { SmallFont = new FFont("SmallFont", "STCFN%.3d", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1); } - OriginalSmallFont = new FFont("OriginalSmallFont", "STCFN%.3d", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1, -1, false, true); } } + + // Create the original small font as a fallback for incomplete definitions. + if (Wads.CheckNumForName("FONTA_S") >= 0) + { + OriginalSmallFont = new FFont("OriginalSmallFont", "FONTA%02u", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, 1, -1, -1, false, true); + OriginalSmallFont->SetCursor('['); + } + else if (Wads.CheckNumForName("STCFN033", ns_graphics) >= 0) + { + OriginalSmallFont = new FFont("OriginalSmallFont", "STCFN%.3d", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1, -1, false, true); + } + if (SmallFont) { uint32_t colors[256] = {};