aboutsummaryrefslogtreecommitdiff
path: root/backends/events
diff options
context:
space:
mode:
authorrsn88872018-03-19 21:42:19 -0500
committerrsn88872018-03-20 03:14:11 -0500
commit9af2b5ca3a1a6acbc4adb16c80688ac3bacd3f79 (patch)
tree4cbc5dd6b698a290f48446d8b28e7ae9c191b40c /backends/events
parenta69294d5254e7df2e3d81ad94bd4fa4d6b2cd5b3 (diff)
downloadscummvm-rg350-9af2b5ca3a1a6acbc4adb16c80688ac3bacd3f79.tar.gz
scummvm-rg350-9af2b5ca3a1a6acbc4adb16c80688ac3bacd3f79.tar.bz2
scummvm-rg350-9af2b5ca3a1a6acbc4adb16c80688ac3bacd3f79.zip
PSP2: fix touch sometimes not directly under finger
Diffstat (limited to 'backends/events')
-rw-r--r--backends/events/psp2sdl/psp2sdl-events.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/backends/events/psp2sdl/psp2sdl-events.cpp b/backends/events/psp2sdl/psp2sdl-events.cpp
index 5b0b6074fb..6fc0b7dede 100644
--- a/backends/events/psp2sdl/psp2sdl-events.cpp
+++ b/backends/events/psp2sdl/psp2sdl-events.cpp
@@ -349,6 +349,9 @@ void PSP2EventSource::convertTouchXYToGameXY(float touchX, float touchY, int *ga
int screenH = _km.y_max;
int screenW = _km.x_max;
+ int windowH = g_system->getHeight();
+ int windowW = g_system->getWidth();
+
bool fullscreen = ConfMan.getBool("fullscreen");
bool aspectRatioCorrection = ConfMan.getBool("aspect_ratio");
@@ -359,13 +362,13 @@ void PSP2EventSource::convertTouchXYToGameXY(float touchX, float touchY, int *ga
float sx, sy;
float ratio = (float)screenW / (float)screenH;
- if (aspectRatioCorrection) {
+ if (aspectRatioCorrection && (windowH == 200 || windowH == 400)) {
ratio = 4.0 / 3.0;
}
if (fullscreen || screenH >= dispH) {
h = dispH;
- if (aspectRatioCorrection) {
+ if (aspectRatioCorrection && (windowH == 200 || windowH == 400)) {
ratio = ratio * 1.1;
}
w = h * ratio;
@@ -379,7 +382,7 @@ void PSP2EventSource::convertTouchXYToGameXY(float touchX, float touchY, int *ga
h = screenH;
w = screenW;
}
- if (aspectRatioCorrection) {
+ if (aspectRatioCorrection && (windowH == 200 || windowH == 400)) {
// stretch the height only if it fits, otherwise make the width smaller
if (((float)w * (1.0 / ratio)) <= (float)dispH) {
h = w * (1.0 / ratio);