mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 17:19:28 +01:00
Don't clamp to a circle in the virtual stick.
This commit is contained in:
1 parent
0e5cab2b0c
commit
d1df63036a
1 file changed
+9
-6
@@ -130,12 +130,15 @@ void TouchStick::update(InputState &input_state)
|
||||
if (!dragging_[i])
|
||||
goto skip;
|
||||
|
||||
// Clamp to a circle
|
||||
float len = sqrtf(dx * dx + dy * dy);
|
||||
if (len > 1.0f) {
|
||||
dx /= len;
|
||||
dy /= len;
|
||||
}
|
||||
// Do not clamp to a circle! The PSP has nearly square range!
|
||||
|
||||
// Old code to clamp to a circle
|
||||
// float len = sqrtf(dx * dx + dy * dy);
|
||||
// if (len > 1.0f) {
|
||||
// dx /= len;
|
||||
// dy /= len;
|
||||
//}
|
||||
|
||||
if (stick_ == 0) {
|
||||
input_state.pad_lstick_x = dx;
|
||||
input_state.pad_lstick_y = -dy;
|
||||
|
||||
Reference in new issue
Block a user