sdl-1.2: return to original dimensions on fullscreen exit
This commit is contained in:
parent
a84a55aa25
commit
3f6bf6aa1a
|
@ -23,7 +23,7 @@ void gfx_deinit(void)
|
|||
static struct
|
||||
{
|
||||
int w, h;
|
||||
} display;
|
||||
} display, windowed;
|
||||
|
||||
void gfx_register_sprite(struct sprite *const s)
|
||||
{
|
||||
|
@ -60,6 +60,11 @@ static int resize_screen(int w, int h, const bool full_screen)
|
|||
w = display.w;
|
||||
h = display.h;
|
||||
}
|
||||
else
|
||||
{
|
||||
windowed.w = w;
|
||||
windowed.h = h;
|
||||
}
|
||||
|
||||
int bpp = info->vfmt->BitsPerPixel;
|
||||
|
||||
|
@ -149,8 +154,8 @@ int gfx_toggle_fullscreen(void)
|
|||
{
|
||||
fullscreen ^= true;
|
||||
|
||||
const int w = fullscreen ? display.w : screen_w;
|
||||
const int h = fullscreen ? display.h : screen_h;
|
||||
const int w = fullscreen ? display.w : windowed.w;
|
||||
const int h = fullscreen ? display.h : windowed.h;
|
||||
|
||||
if ((resize_screen(w, h, fullscreen)))
|
||||
return -1;
|
||||
|
|
Loading…
Reference in New Issue