From 536521d356571be803461b8fc74db84e977f23d8 Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Thu, 13 Jun 2019 15:22:41 -0500 Subject: SWITCH: Enable touchpad mouse mode option in controls --- backends/events/switchsdl/switchsdl-events.cpp | 31 +++----------------------- 1 file changed, 3 insertions(+), 28 deletions(-) (limited to 'backends/events/switchsdl') diff --git a/backends/events/switchsdl/switchsdl-events.cpp b/backends/events/switchsdl/switchsdl-events.cpp index 64c2b42dfd..9a42dc3e40 100644 --- a/backends/events/switchsdl/switchsdl-events.cpp +++ b/backends/events/switchsdl/switchsdl-events.cpp @@ -350,7 +350,7 @@ void SwitchEventSource::convertTouchXYToGameXY(float touchX, float touchY, int * int screenW = _km.x_max; int windowH = g_system->getHeight(); - //int windowW = g_system->getWidth(); + int windowW = g_system->getWidth(); bool fullscreen = ConfMan.getBool("fullscreen"); bool aspectRatioCorrection = ConfMan.getBool("aspect_ratio"); @@ -362,33 +362,8 @@ void SwitchEventSource::convertTouchXYToGameXY(float touchX, float touchY, int * float sx, sy; float ratio = (float)screenW / (float)screenH; - if (aspectRatioCorrection && (windowH == 200 || windowH == 400)) { - ratio = 4.0f / 3.0f; - } - - if (fullscreen || screenH >= dispH) { - h = dispH; - if (aspectRatioCorrection && (windowH == 200 || windowH == 400)) { - ratio = ratio * 1.1f; - } - w = h * ratio; - } else { - if (screenH <= dispH / 2 && screenW <= dispW / 2) { - h = screenH * 2; - w = screenW * 2; - } else { - h = screenH; - w = screenW; - } - if (aspectRatioCorrection && (windowH == 200 || windowH == 400)) { - // stretch the height only if it fits, otherwise make the width smaller - if (((float)w * (1.0f / ratio)) <= (float)dispH) { - h = w * (1.0f / ratio); - } else { - w = h * ratio; - } - } - } + h = dispH; + w = h * ratio; x = (dispW - w) / 2; y = (dispH - h) / 2; -- cgit v1.2.3