aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gfx/sdl-1.2/src/env.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gfx/sdl-1.2/src/env.c b/src/gfx/sdl-1.2/src/env.c
index 07bc25d..74ebb2f 100644
--- a/src/gfx/sdl-1.2/src/env.c
+++ b/src/gfx/sdl-1.2/src/env.c
@@ -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;