From 036e11f7a82f6fb8ce4836278b6f1365400c83a5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 27 Sep 2024 21:51:20 +1000 Subject: [PATCH] Qt: Remove unused variable --- src/core/controller.cpp | 5 +++-- src/core/controller.h | 1 + src/core/system.cpp | 6 +++--- src/core/types.h | 3 ++- src/duckstation-qt/controllersettingswindow.cpp | 2 -- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index 1aee13852..7640bce1d 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -215,8 +215,9 @@ bool Controller::PortAndSlotIsMultitap(u32 port, u32 slot) const char* Controller::GetPortDisplayName(u32 port, u32 slot, bool mtap) { - static constexpr const char* no_mtap_labels[] = {"1", "2"}; - static constexpr const char* mtap_labels[][4] = {{"1A", "1B", "1C", "1D"}, {"2A", "2B", "2C", "2D"}}; + static constexpr const std::array no_mtap_labels = {{"1", "2"}}; + static constexpr const std::array, NUM_MULTITAPS> + mtap_labels = {{{{"1A", "1B", "1C", "1D"}}, {{"2A", "2B", "2C", "2D"}}}}; DebugAssert(port < 2 && slot < 4); return mtap ? mtap_labels[port][slot] : no_mtap_labels[port]; diff --git a/src/core/controller.h b/src/core/controller.h index da3d11537..23561499d 100644 --- a/src/core/controller.h +++ b/src/core/controller.h @@ -7,6 +7,7 @@ #include "settings.h" #include "types.h" +#include #include #include #include diff --git a/src/core/system.cpp b/src/core/system.cpp index d18d4e20b..71aee249f 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -3904,14 +3904,14 @@ void System::UpdateMultitaps() case MultitapMode::Disabled: { Pad::GetMultitap(0)->SetEnable(false, 0); - Pad::GetMultitap(1)->SetEnable(false, 0); + Pad::GetMultitap(1)->SetEnable(false, 1); } break; case MultitapMode::Port1Only: { Pad::GetMultitap(0)->SetEnable(true, 0); - Pad::GetMultitap(1)->SetEnable(false, 0); + Pad::GetMultitap(1)->SetEnable(false, 1); } break; @@ -3925,7 +3925,7 @@ void System::UpdateMultitaps() case MultitapMode::BothPorts: { Pad::GetMultitap(0)->SetEnable(true, 0); - Pad::GetMultitap(1)->SetEnable(true, 4); + Pad::GetMultitap(1)->SetEnable(true, 1); } break; diff --git a/src/core/types.h b/src/core/types.h index cbef5ad79..1f671cbf4 100644 --- a/src/core/types.h +++ b/src/core/types.h @@ -234,7 +234,8 @@ enum class MultitapMode enum : u32 { NUM_CONTROLLER_AND_CARD_PORTS = 8, - NUM_MULTITAPS = 2 + NUM_MULTITAPS = 2, + NUM_CONTROLLER_AND_CARD_PORTS_PER_MULTITAP = NUM_CONTROLLER_AND_CARD_PORTS / NUM_MULTITAPS, }; enum class CPUFastmemMode : u8 diff --git a/src/duckstation-qt/controllersettingswindow.cpp b/src/duckstation-qt/controllersettingswindow.cpp index d5f7050f7..be5030902 100644 --- a/src/duckstation-qt/controllersettingswindow.cpp +++ b/src/duckstation-qt/controllersettingswindow.cpp @@ -21,8 +21,6 @@ #include #include -static constexpr const std::array s_mtap_slot_names = {{'A', 'B', 'C', 'D'}}; - ControllerSettingsWindow::ControllerSettingsWindow(SettingsInterface* game_sif /* = nullptr */, QWidget* parent /* = nullptr */) : QWidget(parent), m_editing_settings_interface(game_sif)