Avoid ugly android viewport hack.

This commit is contained in:
Themaister 2013-01-24 07:29:26 +01:00
parent 34b86c2d14
commit 947e49fbe2

View File

@ -206,10 +206,6 @@ static inline bool load_gl_proc_win32(gl_t *gl)
#define pglUnmapBuffer glUnmapBuffer #define pglUnmapBuffer glUnmapBuffer
#endif #endif
#ifdef ANDROID
static bool android_portrait;
#endif
////////////////// Shaders ////////////////// Shaders
#ifdef HAVE_OPENGLES2 #ifdef HAVE_OPENGLES2
@ -716,8 +712,7 @@ void gl_set_viewport(void *data, unsigned width, unsigned height, bool force_ful
} }
#ifdef ANDROID #ifdef ANDROID
android_portrait = (AConfiguration_getOrientation(g_android->config) == ACONFIGURATION_ORIENTATION_PORT); if (AConfiguration_getOrientation(g_android->config) == ACONFIGURATION_ORIENTATION_PORT)
if (android_portrait)
y *= 2; y *= 2;
#endif #endif
@ -1825,11 +1820,11 @@ static void gl_viewport_info(void *data, struct rarch_viewport *vp)
*vp = gl->vp; *vp = gl->vp;
vp->full_width = gl->win_width; vp->full_width = gl->win_width;
vp->full_height = gl->win_height; vp->full_height = gl->win_height;
#ifdef ANDROID
// FIXME: ugly hack around broken logic in input_translate_coord_viewport // Adjust as GL viewport is bottom-up.
if (android_portrait) unsigned top_y = vp->y + vp->height;
vp->y = 0; unsigned top_dist = gl->win_height - top_y;
#endif vp->y = top_dist;
} }
static bool gl_read_viewport(void *data, uint8_t *buffer) static bool gl_read_viewport(void *data, uint8_t *buffer)