mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #1051 from trigger-death/develop
Last windowed size is now remembered
This commit is contained in:
commit
8d57305bb3
|
@ -191,6 +191,7 @@ static void platform_resize(int width, int height)
|
||||||
rct_drawpixelinfo *screenDPI;
|
rct_drawpixelinfo *screenDPI;
|
||||||
int newScreenBufferSize;
|
int newScreenBufferSize;
|
||||||
void *newScreenBuffer;
|
void *newScreenBuffer;
|
||||||
|
uint32 flags;
|
||||||
|
|
||||||
if (_surface != NULL)
|
if (_surface != NULL)
|
||||||
SDL_FreeSurface(_surface);
|
SDL_FreeSurface(_surface);
|
||||||
|
@ -247,6 +248,18 @@ static void platform_resize(int width, int height)
|
||||||
window_relocate_windows(width, height);
|
window_relocate_windows(width, height);
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
gfx_invalidate_screen();
|
||||||
|
|
||||||
|
// Check if the window has been resized in windowed mode and update the config file accordingly
|
||||||
|
// This is called in rct2_update_2 and is only called after resizing a window has finished
|
||||||
|
flags = SDL_GetWindowFlags(gWindow);
|
||||||
|
if ((flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED |
|
||||||
|
SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP)) == 0) {
|
||||||
|
if (width != gConfigGeneral.window_width || height != gConfigGeneral.window_height) {
|
||||||
|
gConfigGeneral.window_width = width;
|
||||||
|
gConfigGeneral.window_height = height;
|
||||||
|
config_save_default();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform_update_palette(char* colours, int start_index, int num_colours)
|
void platform_update_palette(char* colours, int start_index, int num_colours)
|
||||||
|
|
Loading…
Reference in New Issue