[Scummvm-git-logs] scummvm master -> 70a6435b78b3fff6c307c592e630d12d1cebc78c

sev- noreply at scummvm.org
Wed Aug 14 20:01:54 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
70a6435b78 GUI: Add ability to force DPI scaling via config


Commit: 70a6435b78b3fff6c307c592e630d12d1cebc78c
    https://github.com/scummvm/scummvm/commit/70a6435b78b3fff6c307c592e630d12d1cebc78c
Author: Jozen (me at jozen.blue)
Date: 2024-08-14T22:01:51+02:00

Commit Message:
GUI: Add ability to force DPI scaling via config

Changed paths:
    backends/platform/sdl/sdl-window.cpp
    doc/docportal/advanced_topics/configuration_file.rst


diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp
index 72b8e9bd710..508ffe8a6c8 100644
--- a/backends/platform/sdl/sdl-window.cpp
+++ b/backends/platform/sdl/sdl-window.cpp
@@ -25,6 +25,7 @@
 
 #include "common/textconsole.h"
 #include "common/util.h"
+#include "common/config-manager.h"
 
 #include "icons/scummvm.xpm"
 
@@ -289,6 +290,9 @@ void SdlWindow::getDisplayDpi(float *dpi, float *defaultDpi) const {
 }
 
 float SdlWindow::getDpiScalingFactor() const {
+	if (ConfMan.hasKey("forced_dpi_scaling"))
+		return ConfMan.getInt("forced_dpi_scaling") / 100.f;
+
 	float dpi, defaultDpi;
 	getDisplayDpi(&dpi, &defaultDpi);
 	float ratio = dpi / defaultDpi;
diff --git a/doc/docportal/advanced_topics/configuration_file.rst b/doc/docportal/advanced_topics/configuration_file.rst
index 94715091ace..8f03dc359e6 100755
--- a/doc/docportal/advanced_topics/configuration_file.rst
+++ b/doc/docportal/advanced_topics/configuration_file.rst
@@ -219,6 +219,7 @@ There are many recognized configuration keys. In the table below, each key is ei
 		":ref:`font_override <fontoverride>`",boolean,false,
 		":ref:`footsteps <footsteps>`",boolean,true,
 		":ref:`force_2d_renderer <2d>`",boolean,false,
+		forced_dpi_scaling,integer,,"Overrides DPI scaling factor reported by the system."
 		":ref:`frameLimit <framelimit>`",boolean,true,
 		":ref:`frameSkip <frameskip>`",boolean,false,
 		":ref:`frames_per_secondfl <fpsfl>`",boolean,false,




More information about the Scummvm-git-logs mailing list