Fix unnecessary diffs

master
Ameer 2020-07-02 16:51:16 +07:00
parent 6b7c8e469b
commit 6e1639c7b0
4 changed files with 27 additions and 29 deletions

@ -49,9 +49,8 @@ public:
void ChangeKeyStatus(int key_code, bool pressed) { void ChangeKeyStatus(int key_code, bool pressed) {
std::lock_guard guard{mutex}; std::lock_guard guard{mutex};
for (const KeyButtonPair& pair : list) { for (const KeyButtonPair& pair : list) {
if (pair.key_code == key_code) { if (pair.key_code == key_code)
pair.key_button->status.store(pressed); pair.key_button->status.store(pressed);
}
} }
} }

@ -45,6 +45,7 @@ void Init() {
#ifdef HAVE_SDL2 #ifdef HAVE_SDL2
sdl = SDL::Init(); sdl = SDL::Init();
#endif #endif
udp = CemuhookUDP::Init(); udp = CemuhookUDP::Init();
} }
@ -111,6 +112,7 @@ std::vector<std::unique_ptr<DevicePoller>> GetPollers(DeviceType type) {
#ifdef HAVE_SDL2 #ifdef HAVE_SDL2
pollers = sdl->GetPollers(type); pollers = sdl->GetPollers(type);
#endif #endif
return pollers; return pollers;
} }

@ -444,7 +444,6 @@ private:
class SDLAnalogFactory final : public Input::Factory<Input::AnalogDevice> { class SDLAnalogFactory final : public Input::Factory<Input::AnalogDevice> {
public: public:
explicit SDLAnalogFactory(SDLState& state_) : state(state_) {} explicit SDLAnalogFactory(SDLState& state_) : state(state_) {}
/** /**
* Creates analog device from joystick axes * Creates analog device from joystick axes
* @param params contains parameters for creating the device: * @param params contains parameters for creating the device:

@ -281,25 +281,24 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
button->setContextMenuPolicy(Qt::CustomContextMenu); button->setContextMenuPolicy(Qt::CustomContextMenu);
connect(button, &QPushButton::clicked, [=] { connect(button, &QPushButton::clicked, [=] {
HandleClick( HandleClick(button_map[button_id],
button_map[button_id], [=](Common::ParamPackage params) {
[=](Common::ParamPackage params) { // Workaround for ZL & ZR for analog triggers like on XBOX controllors.
// Workaround for ZL & ZR for analog triggers like on XBOX controllors. // Analog triggers (from controllers like the XBOX controller) would not
// Analog triggers (from controllers like the XBOX controller) would not // work due to a different range of their signals (from 0 to 255 on
// work due to a different range of their signals (from 0 to 255 on // analog triggers instead of -32768 to 32768 on analog joysticks). The
// analog triggers instead of -32768 to 32768 on analog joysticks). The // SDL driver misinterprets analog triggers as analog joysticks.
// SDL driver misinterprets analog triggers as analog joysticks. // TODO: reinterpret the signal range for analog triggers to map the
// TODO: reinterpret the signal range for analog triggers to map the // values correctly. This is required for the correct emulation of the
// values correctly. This is required for the correct emulation of the // analog triggers of the GameCube controller.
// analog triggers of the GameCube controller. if (button_id == Settings::NativeButton::ZL ||
if (button_id == Settings::NativeButton::ZL || button_id == Settings::NativeButton::ZR) {
button_id == Settings::NativeButton::ZR) { params.Set("direction", "+");
params.Set("direction", "+"); params.Set("threshold", "0.5");
params.Set("threshold", "0.5"); }
} buttons_param[button_id] = std::move(params);
buttons_param[button_id] = std::move(params); },
}, InputCommon::Polling::DeviceType::Button);
InputCommon::Polling::DeviceType::Button);
}); });
connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) { connect(button, &QPushButton::customContextMenuRequested, [=](const QPoint& menu_location) {
QMenu context_menu; QMenu context_menu;
@ -325,13 +324,12 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
analog_button->setContextMenuPolicy(Qt::CustomContextMenu); analog_button->setContextMenuPolicy(Qt::CustomContextMenu);
connect(analog_button, &QPushButton::clicked, [=]() { connect(analog_button, &QPushButton::clicked, [=]() {
HandleClick( HandleClick(analog_map_buttons[analog_id][sub_button_id],
analog_map_buttons[analog_id][sub_button_id], [=](const Common::ParamPackage& params) {
[=](const Common::ParamPackage& params) { SetAnalogButton(params, analogs_param[analog_id],
SetAnalogButton(params, analogs_param[analog_id], analog_sub_buttons[sub_button_id]);
analog_sub_buttons[sub_button_id]); },
}, InputCommon::Polling::DeviceType::Button);
InputCommon::Polling::DeviceType::Button);
}); });
connect(analog_button, &QPushButton::customContextMenuRequested, connect(analog_button, &QPushButton::customContextMenuRequested,
[=](const QPoint& menu_location) { [=](const QPoint& menu_location) {