mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-13 15:40:57 +00:00
PSP2: fix touch sometimes not directly under finger
This commit is contained in:
parent
a69294d525
commit
9af2b5ca3a
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user