Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4K Resolution not detected #6056

Closed
DorpsGek opened this issue Jul 7, 2014 · 6 comments
Closed

4K Resolution not detected #6056

DorpsGek opened this issue Jul 7, 2014 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jul 7, 2014

sigii opened the ticket and wrote:

I have a 4k resolution display and openttd is not detecting it.

It only offers 1920x1200 as max resolution.

I'm able to resize the window without any problems in non-fullscreen mode.

Reported version: 1.4.1
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/6056
@DorpsGek
Copy link
Member Author

Alberth wrote:

We use an external library for handling screens and selecting screen resolution. OpenTTD just uses whatever the library provides to us. You may want to look higher upstream, and check whether that library has any known issues w.r.t. high resolution screens.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6056#comment13396

@DorpsGek
Copy link
Member Author

Rubidium wrote:

OpenTTD asks the operating systems for the supported resolutions. If that function does not return anything with width >= 640 and height >= 480, then it will use a fallback list of resolutions.

The only conclusion I can make is that Windows is not returning an useful resolution with EnumDisplaySettings.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6056#comment13411

@DorpsGek
Copy link
Member Author

gpsoft wrote:

I tried the function on my computer, which has also 4k screen.
The list of resolutions is attached.

But if you check the MDSN documentation about EnumDisplaySettings, it says:

"Note Apps that you design to target Windows 8 and later can no longer query or set display modes that are less than 32 bits per pixel (bpp); these operations will fail. These apps have a compatibility manifest that targets Windows 8. Windows 8 still supports 8-bit and 16-bit color modes for desktop apps that were built without a Windows 8 manifest; Windows 8 emulates these modes but still runs in 32-bit color mode."

As you can see in the list, there is only 32 bit resolution from the function (I am also using Windows 8).
So in the function "static void FindResolutions()" we should test if the operating system is Windows 8 and later, if yes then we have to set "bpp" to 32 even if we are intended to use 8bit resolution.
I guess it won't be hard to make a patch, but if anyone interested, I can try to make it, just let me know.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6056#comment13572

@DorpsGek
Copy link
Member Author

frosch wrote:

In that case, can you please test the nightly.
The nightly (i.e. 1.5) defaults to 32bpp video modes.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6056#comment13573

@DorpsGek
Copy link
Member Author

gpsoft wrote:

I tested the nightly, it is fine.
But I think we can do it properly also on different video modes. I made a small fix for this problem, the patch is attached (I will try to run it in the debugger after having a setup in Visual Studio).
I tested this on Windows 8.1 and Windows 7 (after compiling with MinGW) and on both it works fine and picks up the real resolutions.
Feel free to modify it if you are not happy with the way how I did it.

The detection of windows version is not a currently recommended way but I couldn't do it that way, _WIN32_WINNT is probably not defined and for the new functions it needs to have a minimal level of 0x0500. But it works fine, might be deprecated in a future versions of Windows.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/6056#comment13574

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
@TrueBrain
Copy link
Member

So if I read this correctly, the problem is that the game tries to start in 8bpp, and 32bpp solves the issue?

32bpp-anim is the default blitter these days, so that should fix this issue. Given it is 4 years later, going to assume it is. If not, please open a new ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

2 participants