From 43906e5e961c3c2e514f435e371419f752726add Mon Sep 17 00:00:00 2001 From: Sacha Date: Sun, 7 Jul 2013 17:47:50 +1000 Subject: [PATCH] Qt and Blackberry buildfix. --- CMakeLists.txt | 1 - Qt/Native.pro | 1 + Qt/mainwindow.cpp | 11 ++++++++++- native | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c482fd03be..2f4ce81032 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -580,7 +580,6 @@ add_library(native STATIC native/image/zim_save.h native/input/gesture_detector.cpp native/input/gesture_detector.h - native/input/input_state.cpp native/input/keycodes.h native/input/input_state.h native/input/input_state.cpp diff --git a/Qt/Native.pro b/Qt/Native.pro index 1f45429af2..77952d7343 100755 --- a/Qt/Native.pro +++ b/Qt/Native.pro @@ -88,6 +88,7 @@ SOURCES += ../native/audio/*.cpp \ ../native/i18n/*.cpp \ ../native/image/*.cpp \ ../native/input/gesture_detector.cpp \ + ../native/input/input_state.cpp \ ../native/json/json_writer.cpp \ ../native/math/curves.cpp \ ../native/math/expression_parser.cpp \ diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index fc5a66cdc5..5ec297f735 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -82,6 +82,12 @@ void MainWindow::ShowMemory(u32 addr) memoryWindow->Goto(addr); } +inline float clamp1(float x) { + if (x > 1.0f) return 1.0f; + if (x < -1.0f) return -1.0f; + return x; +} + void MainWindow::Update() { emugl->updateGL(); @@ -94,7 +100,10 @@ void MainWindow::Update() else __CtrlButtonUp(controllist[i].psp_id); } - __CtrlSetAnalog(input_state.pad_lstick_x, input_state.pad_lstick_y); + __CtrlSetAnalogX(clamp1(input_state.pad_lstick_x), 0); + __CtrlSetAnalogY(clamp1(input_state.pad_lstick_y), 0); + __CtrlSetAnalogX(clamp1(input_state.pad_rstick_x), 1); + __CtrlSetAnalogY(clamp1(input_state.pad_rstick_y), 1); if (lastUIState != globalUIState) { lastUIState = globalUIState; diff --git a/native b/native index 585081e1c0..35ccbc6df3 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 585081e1c0651c782411212464571691503239bd +Subproject commit 35ccbc6df3bcde28c30d838dc6f8ef5715d34114