diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/bootmanager.h | 5 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 14 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.h | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 |
7 files changed, 22 insertions, 20 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index f1b428bde..21707e451 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp | |||
| @@ -305,8 +305,8 @@ static Core::Frontend::EmuWindow::WindowSystemInfo GetWindowSystemInfo(QWindow* | |||
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, | 307 | GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, |
| 308 | InputCommon::InputSubsystem* input_subsystem_) | 308 | std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_) |
| 309 | : QWidget(parent), emu_thread(emu_thread_), input_subsystem{input_subsystem_} { | 309 | : QWidget(parent), emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)} { |
| 310 | setWindowTitle(QStringLiteral("yuzu %1 | %2-%3") | 310 | setWindowTitle(QStringLiteral("yuzu %1 | %2-%3") |
| 311 | .arg(QString::fromUtf8(Common::g_build_name), | 311 | .arg(QString::fromUtf8(Common::g_build_name), |
| 312 | QString::fromUtf8(Common::g_scm_branch), | 312 | QString::fromUtf8(Common::g_scm_branch), |
| @@ -452,7 +452,7 @@ void GRenderWindow::TouchUpdateEvent(const QTouchEvent* event) { | |||
| 452 | int active_points = 0; | 452 | int active_points = 0; |
| 453 | 453 | ||
| 454 | // average all active touch points | 454 | // average all active touch points |
| 455 | for (const auto tp : event->touchPoints()) { | 455 | for (const auto& tp : event->touchPoints()) { |
| 456 | if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) { | 456 | if (tp.state() & (Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointStationary)) { |
| 457 | active_points++; | 457 | active_points++; |
| 458 | pos += tp.pos(); | 458 | pos += tp.pos(); |
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h index ecb3b8135..ca35cf831 100644 --- a/src/yuzu/bootmanager.h +++ b/src/yuzu/bootmanager.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <atomic> | 7 | #include <atomic> |
| 8 | #include <condition_variable> | 8 | #include <condition_variable> |
| 9 | #include <memory> | ||
| 9 | #include <mutex> | 10 | #include <mutex> |
| 10 | 11 | ||
| 11 | #include <QImage> | 12 | #include <QImage> |
| @@ -126,7 +127,7 @@ class GRenderWindow : public QWidget, public Core::Frontend::EmuWindow { | |||
| 126 | 127 | ||
| 127 | public: | 128 | public: |
| 128 | explicit GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, | 129 | explicit GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_, |
| 129 | InputCommon::InputSubsystem* input_subsystem_); | 130 | std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_); |
| 130 | ~GRenderWindow() override; | 131 | ~GRenderWindow() override; |
| 131 | 132 | ||
| 132 | // EmuWindow implementation. | 133 | // EmuWindow implementation. |
| @@ -188,7 +189,7 @@ private: | |||
| 188 | QStringList GetUnsupportedGLExtensions() const; | 189 | QStringList GetUnsupportedGLExtensions() const; |
| 189 | 190 | ||
| 190 | EmuThread* emu_thread; | 191 | EmuThread* emu_thread; |
| 191 | InputCommon::InputSubsystem* input_subsystem; | 192 | std::shared_ptr<InputCommon::InputSubsystem> input_subsystem; |
| 192 | 193 | ||
| 193 | // Main context that will be shared with all other contexts that are requested. | 194 | // Main context that will be shared with all other contexts that are requested. |
| 194 | // If this is used in a shared context setting, then this should not be used directly, but | 195 | // If this is used in a shared context setting, then this should not be used directly, but |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 489877be9..588bbd677 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -51,8 +51,10 @@ const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> Config: | |||
| 51 | }, | 51 | }, |
| 52 | }}; | 52 | }}; |
| 53 | 53 | ||
| 54 | const int Config::default_lstick_mod = Qt::Key_E; | 54 | const std::array<int, 2> Config::default_stick_mod = { |
| 55 | const int Config::default_rstick_mod = Qt::Key_R; | 55 | Qt::Key_E, |
| 56 | Qt::Key_R, | ||
| 57 | }; | ||
| 56 | 58 | ||
| 57 | const std::array<int, Settings::NativeMouseButton::NumMouseButtons> Config::default_mouse_buttons = | 59 | const std::array<int, Settings::NativeMouseButton::NumMouseButtons> Config::default_mouse_buttons = |
| 58 | { | 60 | { |
| @@ -285,7 +287,7 @@ void Config::ReadPlayerValues() { | |||
| 285 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { | 287 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { |
| 286 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( | 288 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( |
| 287 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], | 289 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], |
| 288 | default_analogs[i][3], default_analogs[i][4], 0.5f); | 290 | default_analogs[i][3], default_stick_mod[i], 0.5f); |
| 289 | auto& player_analogs = player.analogs[i]; | 291 | auto& player_analogs = player.analogs[i]; |
| 290 | 292 | ||
| 291 | player_analogs = qt_config | 293 | player_analogs = qt_config |
| @@ -323,7 +325,7 @@ void Config::ReadDebugValues() { | |||
| 323 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { | 325 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { |
| 324 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( | 326 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( |
| 325 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], | 327 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], |
| 326 | default_analogs[i][3], default_analogs[i][4], 0.5f); | 328 | default_analogs[i][3], default_stick_mod[i], 0.5f); |
| 327 | auto& debug_pad_analogs = Settings::values.debug_pad_analogs[i]; | 329 | auto& debug_pad_analogs = Settings::values.debug_pad_analogs[i]; |
| 328 | 330 | ||
| 329 | debug_pad_analogs = qt_config | 331 | debug_pad_analogs = qt_config |
| @@ -877,7 +879,7 @@ void Config::SavePlayerValues() { | |||
| 877 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { | 879 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { |
| 878 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( | 880 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( |
| 879 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], | 881 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], |
| 880 | default_analogs[i][3], default_analogs[i][4], 0.5f); | 882 | default_analogs[i][3], default_stick_mod[i], 0.5f); |
| 881 | WriteSetting(QStringLiteral("player_%1_").arg(p) + | 883 | WriteSetting(QStringLiteral("player_%1_").arg(p) + |
| 882 | QString::fromStdString(Settings::NativeAnalog::mapping[i]), | 884 | QString::fromStdString(Settings::NativeAnalog::mapping[i]), |
| 883 | QString::fromStdString(player.analogs[i]), | 885 | QString::fromStdString(player.analogs[i]), |
| @@ -898,7 +900,7 @@ void Config::SaveDebugValues() { | |||
| 898 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { | 900 | for (int i = 0; i < Settings::NativeAnalog::NumAnalogs; ++i) { |
| 899 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( | 901 | const std::string default_param = InputCommon::GenerateAnalogParamFromKeys( |
| 900 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], | 902 | default_analogs[i][0], default_analogs[i][1], default_analogs[i][2], |
| 901 | default_analogs[i][3], default_analogs[i][4], 0.5f); | 903 | default_analogs[i][3], default_stick_mod[i], 0.5f); |
| 902 | WriteSetting(QStringLiteral("debug_pad_") + | 904 | WriteSetting(QStringLiteral("debug_pad_") + |
| 903 | QString::fromStdString(Settings::NativeAnalog::mapping[i]), | 905 | QString::fromStdString(Settings::NativeAnalog::mapping[i]), |
| 904 | QString::fromStdString(Settings::values.debug_pad_analogs[i]), | 906 | QString::fromStdString(Settings::values.debug_pad_analogs[i]), |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index 9eeaf9d1e..aa929d134 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -24,8 +24,7 @@ public: | |||
| 24 | 24 | ||
| 25 | static const std::array<int, Settings::NativeButton::NumButtons> default_buttons; | 25 | static const std::array<int, Settings::NativeButton::NumButtons> default_buttons; |
| 26 | static const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> default_analogs; | 26 | static const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> default_analogs; |
| 27 | static const int default_lstick_mod; | 27 | static const std::array<int, 2> default_stick_mod; |
| 28 | static const int default_rstick_mod; | ||
| 29 | static const std::array<int, Settings::NativeMouseButton::NumMouseButtons> | 28 | static const std::array<int, Settings::NativeMouseButton::NumMouseButtons> |
| 30 | default_mouse_buttons; | 29 | default_mouse_buttons; |
| 31 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; | 30 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 80bf40acb..13ecb3dc5 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -305,8 +305,8 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | // Handle clicks for the modifier buttons as well. | 307 | // Handle clicks for the modifier buttons as well. |
| 308 | ConfigureButtonClick(ui->buttonLStickMod, &lstick_mod, Config::default_lstick_mod); | 308 | ConfigureButtonClick(ui->buttonLStickMod, &lstick_mod, Config::default_stick_mod[0]); |
| 309 | ConfigureButtonClick(ui->buttonRStickMod, &rstick_mod, Config::default_rstick_mod); | 309 | ConfigureButtonClick(ui->buttonRStickMod, &rstick_mod, Config::default_stick_mod[1]); |
| 310 | 310 | ||
| 311 | for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; ++analog_id) { | 311 | for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; ++analog_id) { |
| 312 | for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; ++sub_button_id) { | 312 | for (int sub_button_id = 0; sub_button_id < ANALOG_SUB_BUTTONS_NUM; ++sub_button_id) { |
| @@ -532,9 +532,9 @@ void ConfigureInputPlayer::RestoreDefaults() { | |||
| 532 | 532 | ||
| 533 | // Reset Modifier Buttons | 533 | // Reset Modifier Buttons |
| 534 | lstick_mod = | 534 | lstick_mod = |
| 535 | Common::ParamPackage(InputCommon::GenerateKeyboardParam(Config::default_lstick_mod)); | 535 | Common::ParamPackage(InputCommon::GenerateKeyboardParam(Config::default_stick_mod[0])); |
| 536 | rstick_mod = | 536 | rstick_mod = |
| 537 | Common::ParamPackage(InputCommon::GenerateKeyboardParam(Config::default_rstick_mod)); | 537 | Common::ParamPackage(InputCommon::GenerateKeyboardParam(Config::default_stick_mod[1])); |
| 538 | 538 | ||
| 539 | // Reset Analogs | 539 | // Reset Analogs |
| 540 | for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; ++analog_id) { | 540 | for (int analog_id = 0; analog_id < Settings::NativeAnalog::NumAnalogs; ++analog_id) { |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index cab9d680a..a1b61d119 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -187,7 +187,7 @@ static void InitializeLogging() { | |||
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | GMainWindow::GMainWindow() | 189 | GMainWindow::GMainWindow() |
| 190 | : input_subsystem{std::make_unique<InputCommon::InputSubsystem>()}, | 190 | : input_subsystem{std::make_shared<InputCommon::InputSubsystem>()}, |
| 191 | config{std::make_unique<Config>()}, vfs{std::make_shared<FileSys::RealVfsFilesystem>()}, | 191 | config{std::make_unique<Config>()}, vfs{std::make_shared<FileSys::RealVfsFilesystem>()}, |
| 192 | provider{std::make_unique<FileSys::ManualContentProvider>()} { | 192 | provider{std::make_unique<FileSys::ManualContentProvider>()} { |
| 193 | InitializeLogging(); | 193 | InitializeLogging(); |
| @@ -474,7 +474,7 @@ void GMainWindow::InitializeWidgets() { | |||
| 474 | #ifdef YUZU_ENABLE_COMPATIBILITY_REPORTING | 474 | #ifdef YUZU_ENABLE_COMPATIBILITY_REPORTING |
| 475 | ui.action_Report_Compatibility->setVisible(true); | 475 | ui.action_Report_Compatibility->setVisible(true); |
| 476 | #endif | 476 | #endif |
| 477 | render_window = new GRenderWindow(this, emu_thread.get(), input_subsystem.get()); | 477 | render_window = new GRenderWindow(this, emu_thread.get(), input_subsystem); |
| 478 | render_window->hide(); | 478 | render_window->hide(); |
| 479 | 479 | ||
| 480 | game_list = new GameList(vfs, provider.get(), this); | 480 | game_list = new GameList(vfs, provider.get(), this); |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 957f20fa8..0ce66a1ca 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -258,7 +258,7 @@ private: | |||
| 258 | Ui::MainWindow ui; | 258 | Ui::MainWindow ui; |
| 259 | 259 | ||
| 260 | std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc; | 260 | std::unique_ptr<DiscordRPC::DiscordInterface> discord_rpc; |
| 261 | std::unique_ptr<InputCommon::InputSubsystem> input_subsystem; | 261 | std::shared_ptr<InputCommon::InputSubsystem> input_subsystem; |
| 262 | 262 | ||
| 263 | GRenderWindow* render_window; | 263 | GRenderWindow* render_window; |
| 264 | GameList* game_list; | 264 | GameList* game_list; |