zocker-160 / Soldiers-HoWW2-widescreen-fix

Widescreen and Resolution fix for Soldiers: Heroes of World War 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect scaling at 125% DPI and 3440 x 1440 (G-Sync)

pomianowski opened this issue Β· comments

Hi, first of all, thank you so much for taking the time to fumble around with this game. I play again once in a few years and it gets harder over the time to launch it πŸ˜‚

Anyway, the game boots up fine, but the scaling looks 125% like the system scaling set in Windows settings. Back to 100% and everything looks fine.

I don't quite know how your fix works, but the scaling value for the current window can be taken from User32.
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdpiforwindow

Int32 windowDpi = (Int32)User32.GetDpiForWindow(windowHandlePointer);
Double windowDpiScale = windowDpi / 96.0; // 1.25 - like 125%

Screenshots

Scaling 125%
image

Scaling 100%
image

W11 scaling settings
image

Info

Windows DPI scaling: 125%
Microsoft Windows NT 10.0.22000.0
ExBuild: 22000.1.amd64fre.co_release.210604-1628
Full name: NVIDIA GeForce RTX 3080
Driver: 512.15
Rendered resolution: 3440 / 1440
Refresh rate: 100Hz
G-Sync: Enabled
Min. refresh rate: 49Hz
PCIe Generation: Gen 3 / Gen 3
PCIe Width: x16 / x16

thanks for this report, sadly there is not much I can do about that.

Finding out which scaling setting is used is one thing, but the key issue is, that the game uses the desktop resolution as the size for the render screen and fonts, and with anything other than 100%, that approach breaks, because Windows e.g .reports an 125% higher resolution to the game.

There are only really a few ways I can think of potentially fixing this:

  1. change DPI settings under right click on exe > properties > compatibility > change high DPI setting
  2. hack the resolution detection and selector in the game (should be possible, but I just don't have the time right now)
  3. define a fixed resolution in the config inside the profile folder (that will probably not work)