HarbourMasters / Shipwright

3.18k stars 482 forks source link

[Crash] SOH is confused by Windows High DPI settings #3741

Open djrobx opened 9 months ago

djrobx commented 9 months ago

My Ship sails on a 4K TV connected to a Windows 11 gaming PC. To make text readable, Windows defaults to a 250% DPI scaling setting. The Ship works fine at first. If I:

1) Launch SOH.exe 2) Set it to fullscreen 3) Quit soh 4) Launch SOH again

The render output is zoomed such that I can only see the upper left quarter of the game. If I hit F11 to toggle fullscreen a couple times, it pops back into place.

If I:

1) Launch SOH.exe 2) Set it to fullscreen 3) Set the internal resolution to 200% 4) Quit soh 5) Launch SOH again

SOH will crash every time, because it tries to create a massively large texture. I have to manually edit the json to turn off full screen to load it again.

Workaround: If I right click on soh.exe and set the application compatibility, high DPI to "application controlled" it fixes this issue, but the code that initially reads the desktop size probably needs to be updated to account for Windows scaling. Interestingly the F11/full screen code works fine, it's just when full screen is set on initial startup.

Spodi commented 9 months ago

You could try this test build and tell if everyting still works: https://github.com/HarbourMasters/Shipwright/pull/3754 Disable the compat setting for this of course.