From 76fa76f5b887158d2382bf5cb4bd1859858486c3 Mon Sep 17 00:00:00 2001 From: Vladislav Ostapov Date: Mon, 24 Nov 2025 19:07:41 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=87=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D0=BD=D0=B0=20"=D0=B7?= =?UTF-8?q?=D0=B5=D0=BC=D0=BB=D0=B5"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/joystick-reader.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ground/joystick-reader.cpp b/ground/joystick-reader.cpp index cbac9be..7dbe7ae 100644 --- a/ground/joystick-reader.cpp +++ b/ground/joystick-reader.cpp @@ -64,13 +64,12 @@ bool JoystickReader::readData(std::vector& data) { // Читаем кнопки int buttons = SDL_JoystickNumButtons(joystick); for (int i = 0; i < buttons && i < data.size() - axes; ++i) { - auto buttonState = SDL_JoystickGetButton(joystick, i); - data[axes + i] = static_cast(1000.0 + (buttonState * (1000.0 / 255.0))); + data[axes + i] = SDL_JoystickGetButton(joystick, i) ? 2000 : 1000; } for (auto& i: data) { - if (i < 950) i = 950; - if (i > 2050) i = 2050; + if (i < 1000) i = 1000; + if (i > 2000) i = 2000; } return true; }