Skip to content

Commit

Permalink
VITA: Remove useless override
Browse files Browse the repository at this point in the history
This does basically the same as the base class but in a more complicated
way. Just remove it
  • Loading branch information
phcoder committed Sep 25, 2024
1 parent 49f49c6 commit ba5dbdb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
33 changes: 0 additions & 33 deletions backends/events/psp2sdl/psp2sdl-events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@

#include "math.h"

Common::Point PSP2EventSource::getTouchscreenSize() {
return Common::Point(960, 544);
}

void PSP2EventSource::preprocessEvents(SDL_Event *event) {

// prevent suspend (scummvm games contain a lot of cutscenes..)
Expand All @@ -57,33 +53,4 @@ bool PSP2EventSource::isTouchPortActive(SDL_TouchID port) {
return port == 0 || ConfMan.getBool("touchpad_mouse_mode");
}

void PSP2EventSource::convertTouchXYToGameXY(float touchX, float touchY, int *gameX, int *gameY) {
int screenH = _graphicsManager->getWindowHeight();
int screenW = _graphicsManager->getWindowWidth();
Common::Point touchscreenSize = getTouchscreenSize();

const int dispW = touchscreenSize.x;
const int dispH = touchscreenSize.y;

int x, y, w, h;
float sx, sy;
float ratio = (float)screenW / (float)screenH;

h = dispH;
w = h * ratio;

x = (dispW - w) / 2;
y = (dispH - h) / 2;

sy = (float)h / (float)screenH;
sx = (float)w / (float)screenW;

// Find touch coordinates in terms of screen pixels
float dispTouchX = (touchX * (float)dispW);
float dispTouchY = (touchY * (float)dispH);

*gameX = CLIP((int)((dispTouchX - x) / sx), 0, screenW - 1);
*gameY = CLIP((int)((dispTouchY - y) / sy), 0, screenH - 1);
}

#endif
2 changes: 0 additions & 2 deletions backends/events/psp2sdl/psp2sdl-events.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class PSP2EventSource : public SdlEventSource {
void preprocessEvents(SDL_Event *event) override;
bool isTouchPortTouchpadMode(SDL_TouchID port) override;
bool isTouchPortActive(SDL_TouchID port) override;
Common::Point getTouchscreenSize() override;
void convertTouchXYToGameXY(float touchX, float touchY, int *gameX, int *gameY) override;
};

#endif /* BACKEND_EVENTS_PSP2_H */

0 comments on commit ba5dbdb

Please sign in to comment.