- enforce that localized graphics need to be the same size as the one they replace.

This is one of those things where the work needed to make it robust stands in no relation to the gain.
This simply isn't worth the hassle of going through the entire code and fixing every single use of the 2D texture drawing functions.

Unfortunately this means that the graphics items for the menu cannot be replaced this way because their size will most likely differ, but considering that the only candidates for this are the contents of Doom's main menu, the episode menu, the skill menu and the single player summary screen, it's simply not worth it.

In all these cases the IWAD contents can just as easily be replaced with text and user mods which want to offer localized menus will have to work within the confines of the system, e.g. making sure that all menu items are designed to have proper size for substitution to work or by requesting text based menus, which will be added as a modding feature later.
This commit is contained in:
Christoph Oelckers 2019-02-20 00:42:02 +01:00
parent 5f25fbb2e3
commit 4eb8b53d95

View file

@ -1043,6 +1043,14 @@ void FTextureManager::AddLocalizedVariants()
{
FTextureID tex = CheckForTexture(entry.name, ETextureType::MiscPatch);
if (tex.isValid())
{
FTexture *otex = GetTexture(origTex);
FTexture *ntex = GetTexture(tex);
if (otex->GetDisplayWidth() != ntex->GetDisplayWidth() || otex->GetDisplayHeight() != ntex->GetDisplayHeight())
{
Printf("Localized texture %s must be the same size as the one it replaces\n", entry.name);
}
else
{
tokens[1].ToLower();
auto langids = tokens[1].Split("-", FString::TOK_SKIPEMPTY);
@ -1062,6 +1070,7 @@ void FTextureManager::AddLocalizedVariants()
}
}
}
}
else
{
Printf("%s is not a texture\n", entry.name);