Cocoa Port: Fix a bug where mipmapped HUD font rendering would fail on very small non-Retina displays. (Regression from commit 180df28c.)

- As a positive side-effect, this fix also allows mipmapped HUD font rendering to work on the OpenEmu plug-in, so that capability has now been enabled.
This commit is contained in:
rogerman 2022-05-08 00:12:20 -07:00
parent 25643e5f82
commit d9c912d7fd
2 changed files with 2 additions and 7 deletions

View File

@ -6407,7 +6407,7 @@ void OGLHUDLayer::CopyHUDFont(const FT_Face &fontFace, const size_t glyphSize, c
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GLint texLevel = 0;
for (size_t tileSize = glyphTileSize, texSize = glyphTileSize * 16, gSize = glyphSize; texSize >= 1; texLevel++, tileSize >>= 1, texSize >>= 1, gSize = (GLfloat)tileSize * 0.75f)
for (size_t tileSize = glyphTileSize, texSize = glyphTileSize * 16, gSize = glyphSize; gSize >= 1; texLevel++, tileSize >>= 1, texSize >>= 1, gSize = (GLfloat)tileSize * 0.75f)
{
const size_t charMapBufferPixCount = texSize * texSize;
const uint32_t fontColor = 0x00FFFFFF;
@ -6422,11 +6422,6 @@ void OGLHUDLayer::CopyHUDFont(const FT_Face &fontFace, const size_t glyphSize, c
charMapBuffer[i] = fontColor;
}
if (tileSize == 0)
{
continue;
}
error = FT_Set_Char_Size(fontFace, gSize << 6, gSize << 6, 72, 72);
if (error)
{

View File

@ -376,7 +376,7 @@ volatile bool execute = true;
_cdp = new OE_OGLDisplayPresenter(fetchObj);
_cdp->Init();
_cdp->SetHUDFontPath(hudFontPath);
_cdp->SetHUDRenderMipmapped(false); // Mipmapped HUD rendering doesn't work on OpenEmu!
_cdp->SetHUDRenderMipmapped(true);
// OpenEmu doesn't provide us with the backing scaling factor, which is used to
// adapt ClientDisplayPresenter to HiDPI/Retina displays. But if OpenEmu ever