[Scummvm-git-logs] scummvm master -> 9af2b5ca3a1a6acbc4adb16c80688ac3bacd3f79

rsn8887 rsn8887 at users.noreply.github.com
Tue Mar 20 09:14:46 CET 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9af2b5ca3a PSP2: fix touch sometimes not directly under finger


Commit: 9af2b5ca3a1a6acbc4adb16c80688ac3bacd3f79
    https://github.com/scummvm/scummvm/commit/9af2b5ca3a1a6acbc4adb16c80688ac3bacd3f79
Author: rsn8887 (rsn8887 at users.noreply.github.com)
Date: 2018-03-20T03:14:11-05:00

Commit Message:
PSP2: fix touch sometimes not directly under finger

Changed paths:
    backends/events/psp2sdl/psp2sdl-events.cpp
    backends/graphics/psp2sdl/psp2sdl-graphics.cpp


diff --git a/backends/events/psp2sdl/psp2sdl-events.cpp b/backends/events/psp2sdl/psp2sdl-events.cpp
index 5b0b607..6fc0b7d 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);
diff --git a/backends/graphics/psp2sdl/psp2sdl-graphics.cpp b/backends/graphics/psp2sdl/psp2sdl-graphics.cpp
index 1947f8f..222cf0c 100644
--- a/backends/graphics/psp2sdl/psp2sdl-graphics.cpp
+++ b/backends/graphics/psp2sdl/psp2sdl-graphics.cpp
@@ -264,7 +264,7 @@ void PSP2SdlGraphicsManager::SDL_UpdateRects(SDL_Surface *screen, int numrects,
 	float sx, sy;
 	float ratio = (float)screenW / (float)screenH;
 
-	if (aspectRatioCorrection) {
+	if (aspectRatioCorrection && (screenH == 200 || screenH == 400)) {
 		ratio = 4.0 / 3.0;
 	}
 
@@ -281,7 +281,7 @@ void PSP2SdlGraphicsManager::SDL_UpdateRects(SDL_Surface *screen, int numrects,
 			h = screenH;
 			w = screenW;
 		}
-		if (aspectRatioCorrection) {
+		if (aspectRatioCorrection && (screenH == 200 || screenH == 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);





More information about the Scummvm-git-logs mailing list