enhancement: remember window sizes for P96 screens also (#1568)

P96 screens would always resize the window to the resolution set. However, if the user had resized the window to other dimensions, it would be preferable to keep those, instead.

This change does that, with the following catch: Only if the amiga window if larger than the requested RTG resolution, will it be kept. If it's smaller, the window will resize to accomodate the new resolution, to avoid scaling it down.
This commit is contained in:
Dimitris Panokostas 2025-01-11 13:48:57 +01:00
parent b3365c9120
commit 08d809e49e
No known key found for this signature in database
GPG Key ID: 330156A68E9E0929

View File

@ -2476,7 +2476,14 @@ bool target_graphics_buffer_update(const int monid, const bool force)
{
if (mon->amiga_window && isfullscreen() == 0)
{
SDL_SetWindowSize(mon->amiga_window, w, h);
if (mon->amigawin_rect.w > w || mon->amigawin_rect.h > h)
{
SDL_SetWindowSize(mon->amiga_window, mon->amigawin_rect.w, mon->amigawin_rect.h);
}
else
{
SDL_SetWindowSize(mon->amiga_window, w, h);
}
}
#ifdef USE_OPENGL
renderQuad = { dx, dy, w, h };
@ -2522,7 +2529,7 @@ bool target_graphics_buffer_update(const int monid, const bool force)
if (mon->amiga_window && isfullscreen() == 0)
{
if (mon->amigawin_rect.w != 800 && mon->amigawin_rect.h != 600)
if (mon->amigawin_rect.w > 800 && mon->amigawin_rect.h != 600)
{
SDL_SetWindowSize(mon->amiga_window, mon->amigawin_rect.w, mon->amigawin_rect.h);
}