From d1df63036a93139ca66615f143bc390659c689da Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Wed, 19 Jun 2013 20:46:06 +0200 Subject: [PATCH] Don't clamp to a circle in the virtual stick. --- ui/virtual_input.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ui/virtual_input.cpp b/ui/virtual_input.cpp index dbc3924574..a5862ae577 100644 --- a/ui/virtual_input.cpp +++ b/ui/virtual_input.cpp @@ -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;