mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Restore the D-Pad behavior (see #18028)
This commit is contained in:
1 parent
ef6ea1bd23
commit
72be2f5459
2 files changed
+14
-12
No files matched your search
@@ -251,6 +251,7 @@ void ControlMapper::SwapMappingIfEnabled(uint32_t *vkey) {
|
||||
}
|
||||
|
||||
// Can only be called from Key or Axis.
|
||||
// mutex_ should be locked.
|
||||
// TODO: We should probably make a batched version of this.
|
||||
bool ControlMapper::UpdatePSPState(const InputMapping &changedMapping, double now) {
|
||||
// Instead of taking an input key and finding what it outputs, we loop through the OUTPUTS and
|
||||
|
||||
+13
-12
@@ -351,22 +351,23 @@ void PSPDpad::ProcessTouch(float x, float y, bool down) {
|
||||
}
|
||||
|
||||
int lastDown = down_;
|
||||
int pressed = ctrlMask & ~lastDown;
|
||||
int released = (~ctrlMask) & lastDown;
|
||||
down_ = ctrlMask;
|
||||
__CtrlUpdateButtons(ctrlMask, CTRL_LEFT | CTRL_RIGHT | CTRL_UP | CTRL_DOWN);
|
||||
|
||||
if (g_Config.bHapticFeedback) {
|
||||
int pressed = down_ & ~lastDown;
|
||||
static const int dir[4] = { CTRL_RIGHT, CTRL_DOWN, CTRL_LEFT, CTRL_UP };
|
||||
bool vibrate = false;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (pressed & dir[i]) {
|
||||
vibrate = true;
|
||||
}
|
||||
bool vibrate = false;
|
||||
static const int dir[4] = { CTRL_RIGHT, CTRL_DOWN, CTRL_LEFT, CTRL_UP };
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (pressed & dir[i]) {
|
||||
vibrate = true;
|
||||
__CtrlUpdateButtons(dir[i], 0);
|
||||
}
|
||||
if (vibrate) {
|
||||
System_Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
if (released & dir[i]) {
|
||||
__CtrlUpdateButtons(0, dir[i]);
|
||||
}
|
||||
}
|
||||
if (vibrate && g_Config.bHapticFeedback) {
|
||||
System_Vibrate(HAPTIC_VIRTUAL_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
void PSPDpad::Draw(UIContext &dc) {
|
||||
|
||||
Reference in new issue
Block a user