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
Add support for scaled resolutions #6516
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
found issue(s) with the introduced code (1/1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy
found issue(s) with the introduced code (1/1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ihhub I just left a few suggestions, please take a look when you have time. In addition, this scale
is actually not really used anywhere yet, as far as I understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ihhub I just left a few questions and suggestions, could you please take a look when you have time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ihhub, I found one bug, could you please address it when you have time:
If I set the 2x resolution in windowed mode (i.e. 960x540(x2)
) and then switch to fullscreen mode by clicking the Mode
icon (not F4), the engine switches to 960x540 without x2.
If I press F4 in windowed mode for the first time the engine correctly switches to 960x540(x2). But if I press F4 two more times the engine first switches to 960x540(x2) windowed and then to 960x540 fullscreen without x2.
Changing resolution without switching fullscreen/windowed mode works correctly.
I use Windows OS.
Hi, @ihhub, I've tested the last commit. The issue is gone, now the Fullscreen mode is correctly set for scaled resolutions. |
Hi @oleg-derevenetz , I addressed your concerns about uniqueness of elements as well I made extra optimization of the code. Please take a look again when you have time. |
Hi @Branikolog , could you please test this pull request as the highest priority as we need this change for the upcoming release? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ihhub I just left a few questions and suggestions, could you please take a look?
Hi, @ihhub |
640x480x2 resolution is 1280x960, but with in-game picture linearly scaled x2, so GUI elements doesn't look small, like with just 1280x960. To have, say, 800x600x2, you should have 1600x1200 in the list of supported resolutions, and to have 928x520x2 you should have 1856x1040 in the list of supported resolutions. Do you have them in this list?
Yes, it was to be expected because of upscaling.
There is still one of SDL upscaling algorithms is applied. It's in fact really as-if you resized your window x2 linearly in both dimensions. |
Hi, @Branikolog. (There would be good in future to have non integer scales, for example set in-game resolution to 1366x768 and upscale it to fullscreen 1920x1080.) |
Hi, @oleg-derevenetz !
That's a valid point. I've added this custom resolution and one more x2 option appeared for me. 👍
Well, I've expected, if I set 640x480 x2 (window more) I would get a clear image with each game pixel include 2 pixels of my monitor. But it works the same (I mean being blurred while custom stretched) as if I stretched the game window by hand for some unknown, non-integer size. Anyway, Thanks for clarification, @oleg-derevenetz , very much. :) Hi, @Districh-ru !
My monitor is rather old and supports quite a poor set of resolutions. I had to add manually some low widescreen resolutions, as the lowest default available 16:9 for me was 1280x768.
Worked for me as well. :)
Isn't it upscaled if we run the application fullscreen? I mean each of the available resolutions are stretching the image on running application fullscreen. More anticipated feature for me is to allow to set a custom resolutions, as I have to manually set them for my OS, before it appears in resolution selection window. |
SonarCloud Quality Gate failed. |
Not exact. Any resolution changes the Desktop resolution ans the upscale is done by monitor or graphic card driver. This causes a problem in Windows OS: Opened windows change their size to match the set resolution, changing their inner arrangement. And after exiting the game some of opened windows do not restore its original size and inner arrangement. Also some windows are force dropped to my second monitor, which is TV and is mostly turned off, so I have to get them back from the switched off TV "to the touch". :) This is the Windows OS issue and it causes with many applications. But if fheroes2 would set the in-game resolutuion to chosen and in fullscreen do not change the Desktop resolution it would be very nice for me. :) |
I experience the same problems, but I prefer image quality over my OS windows arrangement. :) Isn't this problem was fixed while running on software emulated cursor mode? (which lowers quality as well, but makes it possible to run engine on any resolution plus scaling the cursor)
I see. |
@Districh-ru you are already able to choose the scaling method (among supported by SDL) via |
Thanks, @oleg-derevenetz, I forgot about this. I prefer Bilinear scaling, so I did not search the сап file for it. |
@Districh-ru |
I believe, nearest scaling should be turned on as a default while selecting x2 resolutions in window mode. |
Based on the demand from users with high resolution displays. This feature is available only on SDL 2.
Also fixed text alignment for resolution selection dialog.
relates to #5373
relates to #4946