From: Holger Schemel Date: Tue, 14 Jul 2020 21:18:56 +0000 (+0200) Subject: fixed screen rotation for newer SDL versions on Android X-Git-Tag: 4.2.0.0~7 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=aff7fb95675072451fcf25e8c0199923b0687027;p=rocksndiamonds.git fixed screen rotation for newer SDL versions on Android Using the previous code with newer SDL versions on Android, screen rotation did not work anymore, because the "resizable" flag seems to be needed even when creating fullscreen surfaces to correctly detect device rotation in recent SDL versions. This was fixed by always using the "resizable" flag, regardless of windowed or fullscreen surfaces on all platforms. --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index d271951e..add67e5b 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -497,7 +497,7 @@ static boolean SDLCreateScreen(boolean fullscreen) { SDL_Surface *new_surface = NULL; - int surface_flags_window = SURFACE_FLAGS | SDL_WINDOW_RESIZABLE; + int surface_flags_window = SURFACE_FLAGS; int surface_flags_fullscreen = SURFACE_FLAGS | SDL_WINDOW_FULLSCREEN_DESKTOP; #if 1 diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index c49894f6..acdafd5b 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -23,7 +23,7 @@ // definitions needed for "system.c" -#define SURFACE_FLAGS (0) +#define SURFACE_FLAGS (SDL_WINDOW_RESIZABLE) #define SET_TRANSPARENT_PIXEL (SDL_TRUE) #define UNSET_TRANSPARENT_PIXEL (SDL_FALSE)