1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-29 09:29:10 +00:00

Fix #10309: [SDL] Uninitialized width and height when turning off full screen

This commit is contained in:
Rubidium
2023-01-07 12:49:11 +01:00
committed by Michael Lutz
parent 7ccfc4b143
commit 88030d781b

View File

@@ -648,12 +648,11 @@ bool VideoDriver_SDL_Base::ChangeResolution(int w, int h)
bool VideoDriver_SDL_Base::ToggleFullscreen(bool fullscreen)
{
int w, h;
/* Remember current window size */
if (fullscreen) {
SDL_GetWindowSize(this->sdl_window, &w, &h);
int w, h;
SDL_GetWindowSize(this->sdl_window, &w, &h);
if (fullscreen) {
/* Find fullscreen window size */
SDL_DisplayMode dm;
if (SDL_GetCurrentDisplayMode(0, &dm) < 0) {