mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-25 08:59:58 +00:00
(Android) detect portrait orientation by aspect ratio
This commit is contained in:
parent
13277f080b
commit
47e950e9d8
15
gfx/gl.c
15
gfx/gl.c
@ -668,16 +668,15 @@ void gl_set_viewport(void *data, unsigned width, unsigned height, bool force_ful
|
||||
unsigned x = 0, y = 0;
|
||||
struct gl_ortho ortho = {0, 1, 0, 1, -1, 1};
|
||||
|
||||
float device_aspect = 0.0f;
|
||||
if (gl->ctx_driver->translate_aspect)
|
||||
device_aspect = context_translate_aspect_func(width, height);
|
||||
else
|
||||
device_aspect = (float)width / height;
|
||||
|
||||
if (gl->keep_aspect && !force_full)
|
||||
{
|
||||
float desired_aspect = g_settings.video.aspect_ratio;
|
||||
|
||||
float device_aspect = 0.0f;
|
||||
if (gl->ctx_driver->translate_aspect)
|
||||
device_aspect = context_translate_aspect_func(width, height);
|
||||
else
|
||||
device_aspect = (float)width / height;
|
||||
|
||||
float delta;
|
||||
|
||||
#ifdef RARCH_CONSOLE
|
||||
@ -712,7 +711,7 @@ void gl_set_viewport(void *data, unsigned width, unsigned height, bool force_ful
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
if (AConfiguration_getOrientation(g_android->config) == ACONFIGURATION_ORIENTATION_PORT)
|
||||
if (device_aspect > 1.0f)
|
||||
y *= 2;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user