Tweaking orientation handling in Android.
This commit is contained in:
parent
70d9da8369
commit
1d67cc867c
1 changed files with 24 additions and 6 deletions
|
|
@ -24053,13 +24053,7 @@ static void setup(void)
|
|||
if (native_screensize && fullscreen)
|
||||
{
|
||||
#if defined __ANDROID__
|
||||
/* FIXME 2019-11-02: Could this work on every device instead of just Android ones? */
|
||||
SDL_SetHint(SDL_HINT_ORIENTATIONS, "Portrait");
|
||||
int tmp;
|
||||
|
||||
tmp = WINDOW_WIDTH;
|
||||
WINDOW_WIDTH = WINDOW_HEIGHT;
|
||||
WINDOW_HEIGHT = tmp;
|
||||
#else
|
||||
fprintf(stderr, "Warning: Asking for native screen size overrides request to rotate orientation.\n");
|
||||
#endif
|
||||
|
|
@ -24153,6 +24147,30 @@ static void setup(void)
|
|||
SDL_RenderSetScale(renderer, window_scale_h, window_scale_h);
|
||||
}
|
||||
}
|
||||
#if defined __ANDROID__
|
||||
/* Deal with rotate orientation in native screens */
|
||||
if (rotate_orientation)
|
||||
{
|
||||
if (ww > hh)
|
||||
{
|
||||
int tmp;
|
||||
tmp = ww;
|
||||
ww = hh;
|
||||
hh = tmp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hh > ww)
|
||||
{
|
||||
int tmp;
|
||||
tmp = ww;
|
||||
ww = hh;
|
||||
hh = tmp;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue