mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-05 00:26:23 +00:00
Touch controls: Make it harder to accidentally hit dpad diagonals.
Treats the dpad as 4-way out to a certain radius.
This commit is contained in:
parent
fedf7edc2b
commit
63bc4910cf
@ -143,8 +143,10 @@ void PSPDpad::ProcessTouch(float x, float y, bool down) {
|
||||
|
||||
int ctrlMask = 0;
|
||||
int lastDown = down_;
|
||||
|
||||
bool fourWay = g_Config.bDisableDpadDiagonals || rad < 1.25f;
|
||||
if (down) {
|
||||
if (g_Config.bDisableDpadDiagonals) {
|
||||
if (fourWay) {
|
||||
int direction = (int)(floorf((atan2f(dy, dx) / (2 * M_PI) * 4) + 0.5f)) & 3;
|
||||
switch (direction) {
|
||||
case 0: ctrlMask |= CTRL_RIGHT; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user