From 02df4195486212a774cb4f1ca3006eb51d4d9de8 Mon Sep 17 00:00:00 2001 From: adrian17 Date: Thu, 31 Jul 2014 11:41:00 +0200 Subject: [PATCH] Make window resizable again. Note: I can't simple place SDL_WINDOW_RESIZABLE in _fullscreen_modes[] because SDL ignores this flag in SDL_SetWindowFullscreen and if the user started the game in fullscreen and switched to window, it wouldn't be resizable. The way I did it is the only way I know to make the window resizable regardless of whether the game was first started in window or in fullscreen. --- src/osinterface.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osinterface.c b/src/osinterface.c index 5efe2a2a75..9895eebf4f 100644 --- a/src/osinterface.c +++ b/src/osinterface.c @@ -54,7 +54,7 @@ static void *_screenBuffer; static SDL_Cursor* _cursors[NO_CURSORS]; -static const int fullscreen_modes[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP }; +static const int _fullscreen_modes[] = { 0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP }; void osinterface_init() { @@ -174,7 +174,7 @@ static void osinterface_create_window() RCT2_GLOBAL(0x009E2D8C, sint32) = 0; _window = SDL_CreateWindow("OpenRCT2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, - fullscreen_modes[gGeneral_config.fullscreen_mode]); + _fullscreen_modes[gGeneral_config.fullscreen_mode] | SDL_WINDOW_RESIZABLE); if (!_window) { RCT2_ERROR("SDL_CreateWindow failed %s", SDL_GetError()); exit(-1); @@ -423,7 +423,7 @@ void osinterface_set_fullscreen_mode(int mode){ if (mode == gGeneral_config.fullscreen_mode) return; - if (SDL_SetWindowFullscreen(_window, fullscreen_modes[mode])){ + if (SDL_SetWindowFullscreen(_window, _fullscreen_modes[mode])){ RCT2_ERROR("SDL_SetWindowFullscreen %s", SDL_GetError()); exit(1); }