Unfortunately, there is a bug we can't figure out because of how complex GZDoom's texture system is. There are dozens of texture-related classes and it's mind-boggling, which is understandable, considering how many features the texture system supports, including but not limited to texture composing, HD texture replacements, transparently converting between palletized and truecolor formats, translations, font recoloring. I'd appeciate an explanation of how these classes are structured.
We have a problem with font recoloring. Fonts in The Forestale all have truecolor HD replacements. Untranslated fonts render fine, but all translated colorings of a multi-lump font glyph return the same HD texture with messed up colors. All those colors belong to the palette. Perhaps some GZDoom developer can tell what could cause such a bug. Any help is greatly appreciated.
Screenshots:
Menu icons are all in a font with HD replacements. Menu items are single-character strings using that font. The third item's HD replacement has been replaced with a 256x256 horizontal gradient from RGB(0, 0, 0) to RGB(255, 255, 255) for test purposes. Menu items are untranslated by default. The selected menu item is colored green.
Spoiler: GZDoom correctly recoloring menu items and text
Spoiler: Custom renderer receiving translated textures with messed up colorsThe following code is used to obtain an OpenGL texture ID from an FTexture. Is it correct?
Spoiler: GetTextureIDAnd when rendering the text:
Spoiler: Obtaining translation ID from RenderCommandI'd also like to know what that "int translation" is and if there is more than one way to refer to translations by numbers, whether these translation IDs are global or only relevant to a single font/texture.