diff options
Diffstat (limited to 'src/yuzu')
| -rw-r--r-- | src/yuzu/configuration/configure_general.ui | 60 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_graphics_advanced.ui | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player.cpp | 13 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.cpp | 61 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.h | 6 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 7 | 
6 files changed, 91 insertions, 63 deletions
| diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index 8ce97edec..69b6c2d66 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui @@ -25,6 +25,36 @@          <item>           <layout class="QVBoxLayout" name="GeneralVerticalLayout">            <item> +            <layout class="QHBoxLayout" name="horizontalLayout_2"> +              <item> +                <widget class="QLabel" name="fps_cap_label"> +                  <property name="text"> +                    <string>Framerate Cap</string> +                  </property> +                  <property name="toolTip"> +                    <string>Requires the use of the FPS Limiter Toggle hotkey to take effect.</string> +                  </property> +                </widget> +              </item> +              <item> +                <widget class="QSpinBox" name="fps_cap"> +                  <property name="suffix"> +                    <string>x</string> +                  </property> +                  <property name="minimum"> +                    <number>1</number> +                  </property> +                  <property name="maximum"> +                    <number>1000</number> +                  </property> +                  <property name="value"> +                    <number>500</number> +                  </property> +                </widget> +              </item> +            </layout> +          </item> +          <item>             <layout class="QHBoxLayout" name="horizontalLayout_2">              <item>               <widget class="QCheckBox" name="toggle_speed_limit"> @@ -52,36 +82,6 @@             </layout>            </item>            <item> -           <layout class="QHBoxLayout" name="horizontalLayout_2"> -            <item> -             <widget class="QLabel" name="fps_cap_label"> -              <property name="text"> -               <string>Framerate Cap</string> -              </property> -              <property name="toolTip"> -                <string>Requires the use of the FPS Limiter Toggle hotkey to take effect.</string> -              </property> -             </widget> -            </item> -            <item> -             <widget class="QSpinBox" name="fps_cap"> -              <property name="suffix"> -               <string>x</string> -              </property> -              <property name="minimum"> -               <number>1</number> -              </property> -              <property name="maximum"> -               <number>1000</number> -              </property> -              <property name="value"> -               <number>500</number> -              </property> -             </widget> -            </item> -           </layout> -          </item> -          <item>             <widget class="QCheckBox" name="use_multi_core">              <property name="text">               <string>Multicore CPU Emulation</string> diff --git a/src/yuzu/configuration/configure_graphics_advanced.ui b/src/yuzu/configuration/configure_graphics_advanced.ui index 379dc5d2e..4fe6b86ae 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.ui +++ b/src/yuzu/configuration/configure_graphics_advanced.ui @@ -82,14 +82,17 @@             <string>Enables asynchronous shader compilation, which may reduce shader stutter. This feature is experimental.</string>            </property>            <property name="text"> -           <string>Use asynchronous shader building</string> +           <string>Use asynchronous shader building (hack)</string>            </property>           </widget>          </item>          <item>           <widget class="QCheckBox" name="use_fast_gpu_time"> +          <property name="toolTip"> +            <string>Enables Fast GPU Time. This option will force most games to run at their highest native resolution.</string> +          </property>            <property name="text"> -           <string>Use Fast GPU Time</string> +           <string>Use Fast GPU Time (hack)</string>            </property>           </widget>          </item> diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 6b9bd05f1..7527c068b 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp @@ -309,11 +309,14 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i                          buttons_param[button_id].Clear();                          button_map[button_id]->setText(tr("[not set]"));                      }); -                    context_menu.addAction(tr("Toggle button"), [&] { -                        const bool toggle_value = !buttons_param[button_id].Get("toggle", false); -                        buttons_param[button_id].Set("toggle", toggle_value); -                        button_map[button_id]->setText(ButtonToText(buttons_param[button_id])); -                    }); +                    if (buttons_param[button_id].Has("toggle")) { +                        context_menu.addAction(tr("Toggle button"), [&] { +                            const bool toggle_value = +                                !buttons_param[button_id].Get("toggle", false); +                            buttons_param[button_id].Set("toggle", toggle_value); +                            button_map[button_id]->setText(ButtonToText(buttons_param[button_id])); +                        }); +                    }                      if (buttons_param[button_id].Has("threshold")) {                          context_menu.addAction(tr("Set threshold"), [&] {                              const int button_threshold = static_cast<int>( diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index f50cda2f3..cd633e45f 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp @@ -122,6 +122,7 @@ void PlayerControlPreview::UpdateColors() {          colors.slider_arrow = QColor(14, 15, 18);          colors.font2 = QColor(255, 255, 255);          colors.indicator = QColor(170, 238, 255); +        colors.indicator2 = QColor(100, 255, 100);          colors.deadzone = QColor(204, 136, 136);          colors.slider_button = colors.button;      } @@ -139,6 +140,7 @@ void PlayerControlPreview::UpdateColors() {          colors.slider_arrow = QColor(65, 68, 73);          colors.font2 = QColor(0, 0, 0);          colors.indicator = QColor(0, 0, 200); +        colors.indicator2 = QColor(0, 150, 0);          colors.deadzone = QColor(170, 0, 0);          colors.slider_button = QColor(153, 149, 149);      } @@ -317,8 +319,7 @@ void PlayerControlPreview::DrawLeftController(QPainter& p, const QPointF center)          using namespace Settings::NativeAnalog;          DrawJoystick(p, center + QPointF(9, -69) + (axis_values[LStick].value * 8), 1.8f,                       button_values[Settings::NativeButton::LStick]); -        DrawRawJoystick(p, center + QPointF(-140, 90), axis_values[LStick].raw_value, -                        axis_values[LStick].properties); +        DrawRawJoystick(p, center + QPointF(-140, 90), QPointF(0, 0));      }      using namespace Settings::NativeButton; @@ -432,8 +433,7 @@ void PlayerControlPreview::DrawRightController(QPainter& p, const QPointF center          using namespace Settings::NativeAnalog;          DrawJoystick(p, center + QPointF(-9, 11) + (axis_values[RStick].value * 8), 1.8f,                       button_values[Settings::NativeButton::RStick]); -        DrawRawJoystick(p, center + QPointF(140, 90), axis_values[RStick].raw_value, -                        axis_values[RStick].properties); +        DrawRawJoystick(p, QPointF(0, 0), center + QPointF(140, 90));      }      using namespace Settings::NativeButton; @@ -547,8 +547,7 @@ void PlayerControlPreview::DrawDualController(QPainter& p, const QPointF center)          DrawJoystick(p, center + QPointF(-65, -65) + (l_stick.value * 7), 1.62f, l_button);          DrawJoystick(p, center + QPointF(65, 12) + (r_stick.value * 7), 1.62f, r_button); -        DrawRawJoystick(p, center + QPointF(-180, 90), l_stick.raw_value, l_stick.properties); -        DrawRawJoystick(p, center + QPointF(180, 90), r_stick.raw_value, r_stick.properties); +        DrawRawJoystick(p, center + QPointF(-180, 90), center + QPointF(180, 90));      }      using namespace Settings::NativeButton; @@ -634,8 +633,7 @@ void PlayerControlPreview::DrawHandheldController(QPainter& p, const QPointF cen          DrawJoystick(p, center + QPointF(-171, -41) + (l_stick.value * 4), 1.0f, l_button);          DrawJoystick(p, center + QPointF(171, 8) + (r_stick.value * 4), 1.0f, r_button); -        DrawRawJoystick(p, center + QPointF(-50, 0), l_stick.raw_value, l_stick.properties); -        DrawRawJoystick(p, center + QPointF(50, 0), r_stick.raw_value, r_stick.properties); +        DrawRawJoystick(p, center + QPointF(-50, 0), center + QPointF(50, 0));      }      using namespace Settings::NativeButton; @@ -728,10 +726,7 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center)                          button_values[Settings::NativeButton::LStick]);          DrawProJoystick(p, center + QPointF(51, 0), axis_values[RStick].value, 11,                          button_values[Settings::NativeButton::RStick]); -        DrawRawJoystick(p, center + QPointF(-50, 105), axis_values[LStick].raw_value, -                        axis_values[LStick].properties); -        DrawRawJoystick(p, center + QPointF(50, 105), axis_values[RStick].raw_value, -                        axis_values[RStick].properties); +        DrawRawJoystick(p, center + QPointF(-50, 105), center + QPointF(50, 105));      }      using namespace Settings::NativeButton; @@ -821,10 +816,7 @@ void PlayerControlPreview::DrawGCController(QPainter& p, const QPointF center) {          p.setBrush(colors.font);          DrawSymbol(p, center + QPointF(61, 37) + (axis_values[RStick].value * 9.5f), Symbol::C,                     1.0f); -        DrawRawJoystick(p, center + QPointF(-198, -125), axis_values[LStick].raw_value, -                        axis_values[LStick].properties); -        DrawRawJoystick(p, center + QPointF(198, -125), axis_values[RStick].raw_value, -                        axis_values[RStick].properties); +        DrawRawJoystick(p, center + QPointF(-198, -125), center + QPointF(198, -125));      }      using namespace Settings::NativeButton; @@ -2358,8 +2350,33 @@ void PlayerControlPreview::DrawGCJoystick(QPainter& p, const QPointF center, boo      DrawCircle(p, center, 7.5f);  } -void PlayerControlPreview::DrawRawJoystick(QPainter& p, const QPointF center, const QPointF value, -                                           const Input::AnalogProperties& properties) { +void PlayerControlPreview::DrawRawJoystick(QPainter& p, QPointF center_left, QPointF center_right) { +    using namespace Settings::NativeAnalog; +    if (controller_type != Settings::ControllerType::LeftJoycon) { +        DrawJoystickProperties(p, center_right, axis_values[RStick].properties); +        p.setPen(colors.indicator); +        p.setBrush(colors.indicator); +        DrawJoystickDot(p, center_right, axis_values[RStick].raw_value, +                        axis_values[RStick].properties); +        p.setPen(colors.indicator2); +        p.setBrush(colors.indicator2); +        DrawJoystickDot(p, center_right, axis_values[RStick].value, axis_values[RStick].properties); +    } + +    if (controller_type != Settings::ControllerType::RightJoycon) { +        DrawJoystickProperties(p, center_left, axis_values[LStick].properties); +        p.setPen(colors.indicator); +        p.setBrush(colors.indicator); +        DrawJoystickDot(p, center_left, axis_values[LStick].raw_value, +                        axis_values[LStick].properties); +        p.setPen(colors.indicator2); +        p.setBrush(colors.indicator2); +        DrawJoystickDot(p, center_left, axis_values[LStick].value, axis_values[LStick].properties); +    } +} + +void PlayerControlPreview::DrawJoystickProperties(QPainter& p, const QPointF center, +                                                  const Input::AnalogProperties& properties) {      constexpr float size = 45.0f;      const float range = size * properties.range;      const float deadzone = size * properties.deadzone; @@ -2376,10 +2393,14 @@ void PlayerControlPreview::DrawRawJoystick(QPainter& p, const QPointF center, co      pen.setColor(colors.deadzone);      p.setPen(pen);      DrawCircle(p, center, deadzone); +} + +void PlayerControlPreview::DrawJoystickDot(QPainter& p, const QPointF center, const QPointF value, +                                           const Input::AnalogProperties& properties) { +    constexpr float size = 45.0f; +    const float range = size * properties.range;      // Dot pointer -    p.setPen(colors.indicator); -    p.setBrush(colors.indicator);      DrawCircle(p, center + (value * range), 2);  } diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index 5fc16d8af..f4a6a5e1b 100644 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h @@ -90,6 +90,7 @@ private:          QColor highlight2{};          QColor transparent{};          QColor indicator{}; +        QColor indicator2{};          QColor led_on{};          QColor led_off{};          QColor slider{}; @@ -139,7 +140,10 @@ private:      // Draw joystick functions      void DrawJoystick(QPainter& p, QPointF center, float size, bool pressed);      void DrawJoystickSideview(QPainter& p, QPointF center, float angle, float size, bool pressed); -    void DrawRawJoystick(QPainter& p, QPointF center, QPointF value, +    void DrawRawJoystick(QPainter& p, QPointF center_left, QPointF center_right); +    void DrawJoystickProperties(QPainter& p, QPointF center, +                                const Input::AnalogProperties& properties); +    void DrawJoystickDot(QPainter& p, QPointF center, QPointF value,                           const Input::AnalogProperties& properties);      void DrawProJoystick(QPainter& p, QPointF center, QPointF offset, float scalar, bool pressed);      void DrawGCJoystick(QPainter& p, QPointF center, bool pressed); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 9544f0fb0..5940e0cfd 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2814,8 +2814,6 @@ void GMainWindow::OnToggleFilterBar() {  }  void GMainWindow::OnCaptureScreenshot() { -    OnPauseGame(); -      const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();      const auto screenshot_path =          QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::ScreenshotsDir)); @@ -2827,23 +2825,22 @@ void GMainWindow::OnCaptureScreenshot() {                             .arg(date);      if (!Common::FS::CreateDir(screenshot_path.toStdString())) { -        OnStartGame();          return;      }  #ifdef _WIN32      if (UISettings::values.enable_screenshot_save_as) { +        OnPauseGame();          filename = QFileDialog::getSaveFileName(this, tr("Capture Screenshot"), filename,                                                  tr("PNG Image (*.png)")); +        OnStartGame();          if (filename.isEmpty()) { -            OnStartGame();              return;          }      }  #endif      render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor.GetValue(),                                       filename); -    OnStartGame();  }  // TODO: Written 2020-10-01: Remove per-game config migration code when it is irrelevant | 
