Qt: Remove unused variable

This commit is contained in:
Stenzek 2024-09-27 21:51:20 +10:00
parent 615781be39
commit 036e11f7a8
No known key found for this signature in database
5 changed files with 9 additions and 8 deletions

View File

@ -215,8 +215,9 @@ bool Controller::PortAndSlotIsMultitap(u32 port, u32 slot)
const char* Controller::GetPortDisplayName(u32 port, u32 slot, bool mtap) const char* Controller::GetPortDisplayName(u32 port, u32 slot, bool mtap)
{ {
static constexpr const char* no_mtap_labels[] = {"1", "2"}; static constexpr const std::array<const char*, NUM_MULTITAPS> 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<std::array<const char*, NUM_CONTROLLER_AND_CARD_PORTS_PER_MULTITAP>, NUM_MULTITAPS>
mtap_labels = {{{{"1A", "1B", "1C", "1D"}}, {{"2A", "2B", "2C", "2D"}}}};
DebugAssert(port < 2 && slot < 4); DebugAssert(port < 2 && slot < 4);
return mtap ? mtap_labels[port][slot] : no_mtap_labels[port]; return mtap ? mtap_labels[port][slot] : no_mtap_labels[port];

View File

@ -7,6 +7,7 @@
#include "settings.h" #include "settings.h"
#include "types.h" #include "types.h"
#include <array>
#include <memory> #include <memory>
#include <optional> #include <optional>
#include <span> #include <span>

View File

@ -3904,14 +3904,14 @@ void System::UpdateMultitaps()
case MultitapMode::Disabled: case MultitapMode::Disabled:
{ {
Pad::GetMultitap(0)->SetEnable(false, 0); Pad::GetMultitap(0)->SetEnable(false, 0);
Pad::GetMultitap(1)->SetEnable(false, 0); Pad::GetMultitap(1)->SetEnable(false, 1);
} }
break; break;
case MultitapMode::Port1Only: case MultitapMode::Port1Only:
{ {
Pad::GetMultitap(0)->SetEnable(true, 0); Pad::GetMultitap(0)->SetEnable(true, 0);
Pad::GetMultitap(1)->SetEnable(false, 0); Pad::GetMultitap(1)->SetEnable(false, 1);
} }
break; break;
@ -3925,7 +3925,7 @@ void System::UpdateMultitaps()
case MultitapMode::BothPorts: case MultitapMode::BothPorts:
{ {
Pad::GetMultitap(0)->SetEnable(true, 0); Pad::GetMultitap(0)->SetEnable(true, 0);
Pad::GetMultitap(1)->SetEnable(true, 4); Pad::GetMultitap(1)->SetEnable(true, 1);
} }
break; break;

View File

@ -234,7 +234,8 @@ enum class MultitapMode
enum : u32 enum : u32
{ {
NUM_CONTROLLER_AND_CARD_PORTS = 8, 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 enum class CPUFastmemMode : u8

View File

@ -21,8 +21,6 @@
#include <QtWidgets/QTextEdit> #include <QtWidgets/QTextEdit>
#include <array> #include <array>
static constexpr const std::array<char, 4> s_mtap_slot_names = {{'A', 'B', 'C', 'D'}};
ControllerSettingsWindow::ControllerSettingsWindow(SettingsInterface* game_sif /* = nullptr */, ControllerSettingsWindow::ControllerSettingsWindow(SettingsInterface* game_sif /* = nullptr */,
QWidget* parent /* = nullptr */) QWidget* parent /* = nullptr */)
: QWidget(parent), m_editing_settings_interface(game_sif) : QWidget(parent), m_editing_settings_interface(game_sif)