From da7a32c6ea92242c99412c2702ad59df36007de4 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Mon, 25 Mar 2024 08:29:53 +0100 Subject: Added support for HiDPI fonts * TrueTypeFont class now takes into account the graphics scale, in order to render an appropriate higher-resolution texture. * Removed TrueTypeFont::fontCounter, since TTF_Init/TTF_Quit already keep a counter. * Avoid copying the rendered string needlessly, when it already exists in the cache. Avoid another copy, when inserting a new chunk into the cache. --- src/client.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 7d887436..8e144e8e 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1339,12 +1339,9 @@ void Client::checkGraphicsSize() const int width = graphics->getWidth(); const int height = graphics->getHeight(); - const auto guiTop = gui->getTop(); - if (guiTop->getWidth() == width && guiTop->getHeight() == height) + if (!gui->videoResized(width, height)) return; - gui->videoResized(width, height); - if (mDesktop) mDesktop->setSize(width, height); -- cgit v1.2.3-70-g09d2