From 9dd83c4f9f07abd29020500e193e20ec79339c85 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 24 Aug 2024 14:23:32 +1000 Subject: [PATCH] InputManager: Remove unused pointer type --- src/core/guncon.cpp | 2 +- src/core/input_types.h | 3 +-- src/core/justifier.cpp | 2 +- src/duckstation-qt/controllerbindingwidgets.cpp | 3 +-- src/duckstation-qt/inputbindingdialog.cpp | 2 +- src/duckstation-qt/inputbindingwidgets.cpp | 4 ++-- src/util/input_manager.cpp | 5 ++--- 7 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/core/guncon.cpp b/src/core/guncon.cpp index 5de8e5f27..89d23e41c 100644 --- a/src/core/guncon.cpp +++ b/src/core/guncon.cpp @@ -273,7 +273,7 @@ static const Controller::ControllerBindingInfo s_binding_info[] = { } // clang-format off - {"Pointer", TRANSLATE_NOOP("GunCon", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast(GunCon::Binding::ButtonCount), InputBindingInfo::Type::AbsolutePointer, GenericInputBinding::Unknown}, + {"Pointer", TRANSLATE_NOOP("GunCon", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast(GunCon::Binding::ButtonCount), InputBindingInfo::Type::Pointer, GenericInputBinding::Unknown}, BUTTON("Trigger", TRANSLATE_NOOP("GunCon", "Trigger"), ICON_PF_CROSS, GunCon::Binding::Trigger, GenericInputBinding::R2), BUTTON("ShootOffscreen", TRANSLATE_NOOP("GunCon", "Shoot Offscreen"), nullptr, GunCon::Binding::ShootOffscreen, GenericInputBinding::L2), BUTTON("A", TRANSLATE_NOOP("GunCon", "A"), ICON_PF_BUTTON_A, GunCon::Binding::A, GenericInputBinding::Cross), diff --git a/src/core/input_types.h b/src/core/input_types.h index 41b72cca8..a49d79502 100644 --- a/src/core/input_types.h +++ b/src/core/input_types.h @@ -15,8 +15,7 @@ struct InputBindingInfo Axis, HalfAxis, Motor, - Pointer, // Receive relative mouse movement events, bind_index is offset by the axis. - AbsolutePointer, // Allows selection of specific pointers, but defaults to the first. + Pointer, // Receive relative mouse movement events, bind_index is offset by the axis. Macro, }; diff --git a/src/core/justifier.cpp b/src/core/justifier.cpp index d216bc39e..b13873e24 100644 --- a/src/core/justifier.cpp +++ b/src/core/justifier.cpp @@ -336,7 +336,7 @@ static const Controller::ControllerBindingInfo s_binding_info[] = { } // clang-format off - {"Pointer", TRANSLATE_NOOP("Justifier", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast(Justifier::Binding::ButtonCount), InputBindingInfo::Type::AbsolutePointer, GenericInputBinding::Unknown}, + {"Pointer", TRANSLATE_NOOP("Justifier", "Pointer/Aiming"), ICON_PF_MOUSE, static_cast(Justifier::Binding::ButtonCount), InputBindingInfo::Type::Pointer, GenericInputBinding::Unknown}, BUTTON("Trigger", TRANSLATE_NOOP("Justifier", "Trigger"), ICON_PF_CROSS, Justifier::Binding::Trigger, GenericInputBinding::R2), BUTTON("ShootOffscreen", TRANSLATE_NOOP("Justifier", "Shoot Offscreen"), nullptr, Justifier::Binding::ShootOffscreen, GenericInputBinding::L2), BUTTON("Start", TRANSLATE_NOOP("Justifier", "Start"), ICON_PF_START, Justifier::Binding::Start, GenericInputBinding::Cross), diff --git a/src/duckstation-qt/controllerbindingwidgets.cpp b/src/duckstation-qt/controllerbindingwidgets.cpp index 9f05db321..bffca6bce 100644 --- a/src/duckstation-qt/controllerbindingwidgets.cpp +++ b/src/duckstation-qt/controllerbindingwidgets.cpp @@ -478,8 +478,7 @@ void ControllerBindingWidget::bindBindingWidgets(QWidget* parent) for (const Controller::ControllerBindingInfo& bi : m_controller_info->bindings) { if (bi.type == InputBindingInfo::Type::Axis || bi.type == InputBindingInfo::Type::HalfAxis || - bi.type == InputBindingInfo::Type::Button || bi.type == InputBindingInfo::Type::Pointer || - bi.type == InputBindingInfo::Type::AbsolutePointer) + bi.type == InputBindingInfo::Type::Button || bi.type == InputBindingInfo::Type::Pointer) { InputBindingWidget* widget = parent->findChild(QString::fromUtf8(bi.name)); if (!widget) diff --git a/src/duckstation-qt/inputbindingdialog.cpp b/src/duckstation-qt/inputbindingdialog.cpp index 52a8ab31d..5cc3a20cc 100644 --- a/src/duckstation-qt/inputbindingdialog.cpp +++ b/src/duckstation-qt/inputbindingdialog.cpp @@ -269,7 +269,7 @@ void InputBindingDialog::saveListToSettings() else Host::DeleteBaseSettingValue(m_section_name.c_str(), m_key_name.c_str()); Host::CommitBaseSettingChanges(); - if (m_bind_type == InputBindingInfo::Type::Pointer || m_bind_type == InputBindingInfo::Type::AbsolutePointer) + if (m_bind_type == InputBindingInfo::Type::Pointer) g_emu_thread->updateControllerSettings(); g_emu_thread->reloadInputBindings(); } diff --git a/src/duckstation-qt/inputbindingwidgets.cpp b/src/duckstation-qt/inputbindingwidgets.cpp index 03f34392e..ec3b543a1 100644 --- a/src/duckstation-qt/inputbindingwidgets.cpp +++ b/src/duckstation-qt/inputbindingwidgets.cpp @@ -227,7 +227,7 @@ void InputBindingWidget::setNewBinding() { Host::SetBaseStringSettingValue(m_section_name.c_str(), m_key_name.c_str(), new_binding.c_str()); Host::CommitBaseSettingChanges(); - if (m_bind_type == InputBindingInfo::Type::Pointer || m_bind_type == InputBindingInfo::Type::AbsolutePointer) + if (m_bind_type == InputBindingInfo::Type::Pointer) g_emu_thread->updateControllerSettings(); g_emu_thread->reloadInputBindings(); } @@ -250,7 +250,7 @@ void InputBindingWidget::clearBinding() { Host::DeleteBaseSettingValue(m_section_name.c_str(), m_key_name.c_str()); Host::CommitBaseSettingChanges(); - if (m_bind_type == InputBindingInfo::Type::Pointer || m_bind_type == InputBindingInfo::Type::AbsolutePointer) + if (m_bind_type == InputBindingInfo::Type::Pointer) g_emu_thread->updateControllerSettings(); g_emu_thread->reloadInputBindings(); } diff --git a/src/util/input_manager.cpp b/src/util/input_manager.cpp index f76e04b1f..6029a02ee 100644 --- a/src/util/input_manager.cpp +++ b/src/util/input_manager.cpp @@ -302,7 +302,7 @@ bool InputManager::ParseBindingAndGetSource(std::string_view binding, InputBindi std::string InputManager::ConvertInputBindingKeyToString(InputBindingInfo::Type binding_type, InputBindingKey key) { - if (binding_type == InputBindingInfo::Type::Pointer || binding_type == InputBindingInfo::Type::AbsolutePointer) + if (binding_type == InputBindingInfo::Type::Pointer) { // pointer and device bindings don't have a data part if (key.source_type == InputSourceType::Pointer) @@ -355,7 +355,7 @@ std::string InputManager::ConvertInputBindingKeysToString(InputBindingInfo::Type const InputBindingKey* keys, size_t num_keys) { // can't have a chord of devices/pointers - if (binding_type == InputBindingInfo::Type::Pointer || binding_type == InputBindingInfo::Type::AbsolutePointer) + if (binding_type == InputBindingInfo::Type::Pointer) { // so only take the first if (num_keys > 0) @@ -853,7 +853,6 @@ void InputManager::AddPadBindings(SettingsInterface& si, const std::string& sect break; case InputBindingInfo::Type::Pointer: - case InputBindingInfo::Type::AbsolutePointer: { auto cb = [pad_index, base = bi.bind_index](InputBindingKey key, float value) { if (!System::IsValid())