mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- always construct the original IWAD SmallFont.
This is for printing localized messages without having to fall back on the VGA font.
This commit is contained in:
parent
fcbde757c9
commit
c1b0122558
3 changed files with 29 additions and 10 deletions
|
@ -221,7 +221,8 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
}
|
||||
else
|
||||
{
|
||||
FTexture *texs[256 - '!'] = {};
|
||||
FTexture *texs[256] = {};
|
||||
if (lcount > 256 - start) lcount = 256 - start;
|
||||
for (i = 0; i < lcount; i++)
|
||||
{
|
||||
TArray<FTextureID> array;
|
||||
|
@ -240,10 +241,10 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
if (doomtemplate)
|
||||
{
|
||||
// Handle the misplaced '|'.
|
||||
if (texs[121 - start] && !texs[120 - start] && !texs[122 - start] && !texs[124 - start])
|
||||
if (texs[121 - '!'] && !texs[120 - '!'] && !texs[122 - '!'] && !texs[124 - '!'])
|
||||
{
|
||||
texs[124 - start] = texs[121 - start];
|
||||
texs[121 - start] = nullptr;
|
||||
texs[124 - '!'] = texs[121 - '!'];
|
||||
texs[121 - '!'] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -255,7 +256,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
Type = Multilump;
|
||||
if (position < minchar) minchar = position;
|
||||
if (position > maxchar) maxchar = position;
|
||||
charMap.Insert(position, TexMan.GetTexture(lump));
|
||||
charMap.Insert(position, texs[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1524,7 +1524,7 @@ void V_InitFonts()
|
|||
{
|
||||
// The font has been replaced, so we need to create a copy of the original as well.
|
||||
SmallFont = new FFont("SmallFont", "STCFN%.3d", nullptr, HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1);
|
||||
OriginalSmallFont = new FFont("SmallFont", "FONTA%02u", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, 1, -1, -1, false, true);
|
||||
OriginalSmallFont = new FFont("SmallFont", "STCFN%.3d", "defsmallfont", HU_FONTSTART, HU_FONTSIZE, HU_FONTSTART, -1, -1, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -928,6 +928,7 @@ void FTextureManager::AddTexturesForWad(int wadnum, FMultipatchTextureBuilder &b
|
|||
{
|
||||
int firsttexture = Textures.Size();
|
||||
int lumpcount = Wads.GetNumLumps();
|
||||
bool iwad = wadnum == Wads.GetIwadNum();
|
||||
|
||||
FirstTextureForFile.Push(firsttexture);
|
||||
|
||||
|
@ -980,16 +981,33 @@ void FTextureManager::AddTexturesForWad(int wadnum, FMultipatchTextureBuilder &b
|
|||
if (Wads.CheckLumpName(i, "BLOCKMAP")) continue;
|
||||
if (Wads.CheckLumpName(i, "BEHAVIOR")) continue;
|
||||
|
||||
bool force = false;
|
||||
// Don't bother looking at this lump if something later overrides it.
|
||||
if (Wads.CheckNumForName(Name, ns_graphics) != i) continue;
|
||||
if (Wads.CheckNumForName(Name, ns_graphics) != i)
|
||||
{
|
||||
if (iwad)
|
||||
{
|
||||
// We need to make an exception for font characters of the SmallFont coming from the IWAD to be able to construct the original font.
|
||||
if (Name.IndexOf("STCFN") != 0 && Name.IndexOf("FONTA") != 0) continue;
|
||||
force = true;
|
||||
}
|
||||
else continue;
|
||||
}
|
||||
|
||||
// skip this if it has already been added as a wall patch.
|
||||
if (CheckForTexture(Name, ETextureType::WallPatch, 0).Exists()) continue;
|
||||
if (!force && CheckForTexture(Name, ETextureType::WallPatch, 0).Exists()) continue;
|
||||
}
|
||||
else if (ns == ns_graphics)
|
||||
{
|
||||
// Don't bother looking this lump if something later overrides it.
|
||||
if (Wads.CheckNumForName(Name, ns_graphics) != i) continue;
|
||||
if (Wads.CheckNumForName(Name, ns_graphics) != i)
|
||||
{
|
||||
if (iwad)
|
||||
{
|
||||
// We need to make an exception for font characters of the SmallFont coming from the IWAD to be able to construct the original font.
|
||||
if (Name.IndexOf("STCFN") != 0 && Name.IndexOf("FONTA") != 0) continue;
|
||||
}
|
||||
else continue;
|
||||
}
|
||||
}
|
||||
else if (ns >= ns_firstskin)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue