[Scummvm-git-logs] scummvm master -> 86b1e74b282d8277275b85c63ba25784b6d8ce99

rsn8887 rsn8887 at users.noreply.github.com
Thu Feb 8 07:20:15 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:
86b1e74b28 PSP2: allow 'frontpanel_touchpad_mode=true' option in ScummVM.ini


Commit: 86b1e74b282d8277275b85c63ba25784b6d8ce99
    https://github.com/scummvm/scummvm/commit/86b1e74b282d8277275b85c63ba25784b6d8ce99
Author: rsn8887 (rsn8887 at users.noreply.github.com)
Date: 2018-02-08T00:19:41-06:00

Commit Message:
PSP2: allow 'frontpanel_touchpad_mode=true' option in ScummVM.ini

Can change option to 'true' manually in scummvm.ini to force front
panel into indirect touchpad mode where the pointer doesn't jump
to finger.

Changed paths:
    backends/events/psp2sdl/psp2sdl-events.cpp
    backends/platform/sdl/psp2/psp2.cpp


diff --git a/backends/events/psp2sdl/psp2sdl-events.cpp b/backends/events/psp2sdl/psp2sdl-events.cpp
index 773096f..0b7f741 100644
--- a/backends/events/psp2sdl/psp2sdl-events.cpp
+++ b/backends/events/psp2sdl/psp2sdl-events.cpp
@@ -89,7 +89,7 @@ void PSP2EventSource::preprocessFingerDown(SDL_Event *event) {
 	int x = _km.x / MULTIPLIER;
 	int y = _km.y / MULTIPLIER;
 
-	if (port == 0) {
+	if (port == 0 && !ConfMan.getBool("frontpanel_touchpad_mode")) {
 		convertTouchXYToGameXY(event->tfinger.x, event->tfinger.y, &x, &y);
 	}
 
@@ -136,7 +136,7 @@ void PSP2EventSource::preprocessFingerUp(SDL_Event *event) {
 							simulatedButton = SDL_BUTTON_RIGHT;
 						} else if (numFingersDown == 1) {
 							simulatedButton = SDL_BUTTON_LEFT;
-							if (port == 0) {
+							if (port == 0 && !ConfMan.getBool("frontpanel_touchpad_mode")) {
 								convertTouchXYToGameXY(event->tfinger.x, event->tfinger.y, &x, &y);
 							}
 						}
@@ -156,7 +156,7 @@ void PSP2EventSource::preprocessFingerUp(SDL_Event *event) {
 				}
 			} else if (numFingersDown == 1) {
 				// when dragging, and the last finger is lifted, the drag is over
-				if (port == 0) {
+				if (port == 0 && !ConfMan.getBool("frontpanel_touchpad_mode")) {
 					convertTouchXYToGameXY(event->tfinger.x, event->tfinger.y, &x, &y);
 				}
 				event->type = SDL_MOUSEBUTTONUP;
@@ -187,7 +187,7 @@ void PSP2EventSource::preprocessFingerMotion(SDL_Event *event) {
 		int x = _km.x / MULTIPLIER;
 		int y = _km.y / MULTIPLIER;
 
-		if (port == 0) {
+		if (port == 0 && !ConfMan.getBool("frontpanel_touchpad_mode")) {
 			convertTouchXYToGameXY(event->tfinger.x, event->tfinger.y, &x, &y);
 		}	else {
 			// for relative mode, use the pointer speed setting
@@ -274,7 +274,7 @@ void PSP2EventSource::preprocessFingerMotion(SDL_Event *event) {
 					// or location of "oldest" finger (front)
 					int mouseDownX = x;
 					int mouseDownY = y;
-					if (port == 0) {
+					if (port == 0 && !ConfMan.getBool("frontpanel_touchpad_mode")) {
 						for (int i = 0; i < MAX_NUM_FINGERS; i++) {
 							if (_finger[port][i].id == id) {
 								for (int j = 0; j < MAX_NUM_FINGERS; j++) {
diff --git a/backends/platform/sdl/psp2/psp2.cpp b/backends/platform/sdl/psp2/psp2.cpp
index 29be31f..3034b6d 100644
--- a/backends/platform/sdl/psp2/psp2.cpp
+++ b/backends/platform/sdl/psp2/psp2.cpp
@@ -81,6 +81,7 @@ void OSystem_PSP2::initBackend() {
 	ConfMan.registerDefault("joystick_deadzone", 2);
 	ConfMan.registerDefault("shader", 0);
 	ConfMan.registerDefault("touchpad_mouse_mode", false);
+	ConfMan.registerDefault("frontpanel_touchpad_mode", false);
 
 	if (!ConfMan.hasKey("fullscreen")) {
 		ConfMan.setBool("fullscreen", true);
@@ -100,6 +101,10 @@ void OSystem_PSP2::initBackend() {
 	if (!ConfMan.hasKey("touchpad_mouse_mode")) {
 		ConfMan.setBool("touchpad_mouse_mode", false);
 	}
+	if (!ConfMan.hasKey("frontpanel_touchpad_mode")) {
+		ConfMan.setBool("frontpanel_touchpad_mode", false);
+	}
+
 	
 	// Create the savefile manager
 	if (_savefileManager == 0)





More information about the Scummvm-git-logs mailing list