Merge pull request #442 from alexey-lysiuk/fix_machexen_font

Fix incorrect small font rendering with Hexen Mac IWAD
This commit is contained in:
coelckers 2015-12-14 11:29:29 +01:00
commit fe990dcc7c
2 changed files with 37 additions and 0 deletions

View file

@ -184,6 +184,7 @@ void FWadCollection::InitMultipleFiles (TArray<FString> &filenames)
}
RenameNerve();
RenameSprites();
FixMacHexen();
// [RH] Set up hash table
FirstLumpIndex = new DWORD[NumLumps];
@ -956,6 +957,41 @@ void FWadCollection::RenameNerve ()
}
}
//==========================================================================
//
// FixMacHexen
//
// Rename unused high resolution font lumps because they are incorrectly
// treated as extended characters
//
//==========================================================================
void FWadCollection::FixMacHexen()
{
if (GAME_Hexen != gameinfo.gametype)
{
return;
}
for (int i = GetFirstLump(IWAD_FILENUM), last = GetLastLump(IWAD_FILENUM); i <= last; ++i)
{
assert(IWAD_FILENUM == LumpInfo[i].wadnum);
FResourceLump* const lump = LumpInfo[i].lump;
char* const name = lump->Name;
// Unwanted lumps are named like FONTA??1
if (8 == strlen(name)
&& MAKE_ID('F', 'O', 'N', 'T') == lump->dwName
&& 'A' == name[4] && '1' == name[7]
&& isdigit(name[5]) && isdigit(name[6]))
{
name[0] = '\0';
}
}
}
//==========================================================================
//
// W_FindLump

View file

@ -238,6 +238,7 @@ protected:
private:
void RenameSprites();
void RenameNerve();
void FixMacHexen();
void DeleteAll();
};