You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A reasonable SDL window size would be taken, e.g. the original full screen window size, of maybe 90% of that.
Actual result
The SDL window size is "undefined".
For me the result has been a super low and overly wide SDL window. That window is actually lower than the minimum height and wider than my screen.
Though also crash-worthy resolutions such as 22036 x 376383744 have occured.
Steps to reproduce
Start OpenTTD with SDL2 driver and go to the Game Options
Enable full screen
Disable full screen
Problem lies in sdl2_v.cpp's VideoDriver_SDL_Base::ToggleFullscreen where local variables w and h do not get set in case fullscreen = false, but at line 671 w and h are passed to some SDL function.
However, just flipping the expression of the if at line 654 doesn't seem completely right either. So, I hope someone has more inspiration how to fix this issue.
Actually found with the static code analysis that could be introduced by #10299.
The text was updated successfully, but these errors were encountered:
VideoDriver_SDL_Base::ToggleFullscreen() code is strange, when switching to fullscreen it sets w and h but these are then write only. I think this function needs to be rewritten entirely.
rubidium42
added a commit
to rubidium42/OpenTTD
that referenced
this issue
Jan 7, 2023
Version of OpenTTD
13.0-RC1, Linux, SDL2 driver
Expected result
A reasonable SDL window size would be taken, e.g. the original full screen window size, of maybe 90% of that.
Actual result
The SDL window size is "undefined".
For me the result has been a super low and overly wide SDL window. That window is actually lower than the minimum height and wider than my screen.
Though also crash-worthy resolutions such as 22036 x 376383744 have occured.
Steps to reproduce
Problem lies in sdl2_v.cpp's
VideoDriver_SDL_Base::ToggleFullscreen
where local variablesw
andh
do not get set in casefullscreen = false
, but at line 671w
andh
are passed to some SDL function.However, just flipping the expression of the
if
at line 654 doesn't seem completely right either. So, I hope someone has more inspiration how to fix this issue.Actually found with the static code analysis that could be introduced by #10299.
The text was updated successfully, but these errors were encountered: