diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/fs/path_util.cpp | 27 | ||||
| -rw-r--r-- | src/core/hle/service/am/applets/applet_web_browser.cpp | 10 | ||||
| -rw-r--r-- | src/input_common/sdl/sdl_impl.cpp | 7 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/h264.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input_player_widget.cpp | 4 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_tas.ui | 8 | ||||
| -rw-r--r-- | src/yuzu/debugger/profiler.cpp | 12 | ||||
| -rw-r--r-- | src/yuzu/game_list.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 39 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 48 |
11 files changed, 99 insertions, 68 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index 43b79bd6d..1bcb897b5 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp | |||
| @@ -82,32 +82,35 @@ public: | |||
| 82 | 82 | ||
| 83 | private: | 83 | private: |
| 84 | PathManagerImpl() { | 84 | PathManagerImpl() { |
| 85 | fs::path yuzu_path; | ||
| 86 | fs::path yuzu_path_cache; | ||
| 87 | fs::path yuzu_path_config; | ||
| 88 | |||
| 85 | #ifdef _WIN32 | 89 | #ifdef _WIN32 |
| 86 | auto yuzu_path = GetExeDirectory() / PORTABLE_DIR; | 90 | yuzu_path = GetExeDirectory() / PORTABLE_DIR; |
| 87 | 91 | ||
| 88 | if (!IsDir(yuzu_path)) { | 92 | if (!IsDir(yuzu_path)) { |
| 89 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; | 93 | yuzu_path = GetAppDataRoamingDirectory() / YUZU_DIR; |
| 90 | } | 94 | } |
| 91 | 95 | ||
| 92 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 96 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 93 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); | 97 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 94 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR); | ||
| 95 | #else | 98 | #else |
| 96 | auto yuzu_path = GetCurrentDir() / PORTABLE_DIR; | 99 | yuzu_path = GetCurrentDir() / PORTABLE_DIR; |
| 97 | 100 | ||
| 98 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { | 101 | if (Exists(yuzu_path) && IsDir(yuzu_path)) { |
| 99 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 102 | yuzu_path_cache = yuzu_path / CACHE_DIR; |
| 100 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path / CACHE_DIR); | 103 | yuzu_path_config = yuzu_path / CONFIG_DIR; |
| 101 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path / CONFIG_DIR); | ||
| 102 | } else { | 104 | } else { |
| 103 | yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; | 105 | yuzu_path = GetDataDirectory("XDG_DATA_HOME") / YUZU_DIR; |
| 104 | 106 | yuzu_path_cache = GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR; | |
| 105 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | 107 | yuzu_path_config = GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR; |
| 106 | GenerateYuzuPath(YuzuPath::CacheDir, GetDataDirectory("XDG_CACHE_HOME") / YUZU_DIR); | ||
| 107 | GenerateYuzuPath(YuzuPath::ConfigDir, GetDataDirectory("XDG_CONFIG_HOME") / YUZU_DIR); | ||
| 108 | } | 108 | } |
| 109 | #endif | 109 | #endif |
| 110 | 110 | ||
| 111 | GenerateYuzuPath(YuzuPath::YuzuDir, yuzu_path); | ||
| 112 | GenerateYuzuPath(YuzuPath::CacheDir, yuzu_path_cache); | ||
| 113 | GenerateYuzuPath(YuzuPath::ConfigDir, yuzu_path_config); | ||
| 111 | GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); | 114 | GenerateYuzuPath(YuzuPath::DumpDir, yuzu_path / DUMP_DIR); |
| 112 | GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); | 115 | GenerateYuzuPath(YuzuPath::KeysDir, yuzu_path / KEYS_DIR); |
| 113 | GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); | 116 | GenerateYuzuPath(YuzuPath::LoadDir, yuzu_path / LOAD_DIR); |
diff --git a/src/core/hle/service/am/applets/applet_web_browser.cpp b/src/core/hle/service/am/applets/applet_web_browser.cpp index 35f194961..927eeefff 100644 --- a/src/core/hle/service/am/applets/applet_web_browser.cpp +++ b/src/core/hle/service/am/applets/applet_web_browser.cpp | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include "core/hle/service/am/applets/applet_web_browser.h" | 24 | #include "core/hle/service/am/applets/applet_web_browser.h" |
| 25 | #include "core/hle/service/filesystem/filesystem.h" | 25 | #include "core/hle/service/filesystem/filesystem.h" |
| 26 | #include "core/hle/service/ns/pl_u.h" | 26 | #include "core/hle/service/ns/pl_u.h" |
| 27 | #include "core/loader/loader.h" | ||
| 27 | 28 | ||
| 28 | namespace Service::AM::Applets { | 29 | namespace Service::AM::Applets { |
| 29 | 30 | ||
| @@ -122,6 +123,15 @@ FileSys::VirtualFile GetOfflineRomFS(Core::System& system, u64 title_id, | |||
| 122 | const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); | 123 | const auto nca = system.GetContentProvider().GetEntry(title_id, nca_type); |
| 123 | 124 | ||
| 124 | if (nca == nullptr) { | 125 | if (nca == nullptr) { |
| 126 | if (nca_type == FileSys::ContentRecordType::HtmlDocument) { | ||
| 127 | LOG_WARNING(Service_AM, "Falling back to AppLoader to get the RomFS."); | ||
| 128 | FileSys::VirtualFile romfs; | ||
| 129 | system.GetAppLoader().ReadManualRomFS(romfs); | ||
| 130 | if (romfs != nullptr) { | ||
| 131 | return romfs; | ||
| 132 | } | ||
| 133 | } | ||
| 134 | |||
| 125 | LOG_ERROR(Service_AM, | 135 | LOG_ERROR(Service_AM, |
| 126 | "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", | 136 | "NCA of type={} with title_id={:016X} is not found in the ContentProvider!", |
| 127 | nca_type, title_id); | 137 | nca_type, title_id); |
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index ab6211b29..ecb00d428 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -170,7 +170,8 @@ public: | |||
| 170 | float GetAxis(int axis, float range, float offset) const { | 170 | float GetAxis(int axis, float range, float offset) const { |
| 171 | std::lock_guard lock{mutex}; | 171 | std::lock_guard lock{mutex}; |
| 172 | const float value = static_cast<float>(state.axes.at(axis)) / 32767.0f; | 172 | const float value = static_cast<float>(state.axes.at(axis)) / 32767.0f; |
| 173 | return (value + offset) / range; | 173 | const float offset_scale = (value + offset) > 0.0f ? 1.0f + offset : 1.0f - offset; |
| 174 | return (value + offset) / range / offset_scale; | ||
| 174 | } | 175 | } |
| 175 | 176 | ||
| 176 | bool RumblePlay(u16 amp_low, u16 amp_high) { | 177 | bool RumblePlay(u16 amp_low, u16 amp_high) { |
| @@ -789,8 +790,8 @@ public: | |||
| 789 | const std::string invert_y_value = params.Get("invert_y", "+"); | 790 | const std::string invert_y_value = params.Get("invert_y", "+"); |
| 790 | const bool invert_x = invert_x_value == "-"; | 791 | const bool invert_x = invert_x_value == "-"; |
| 791 | const bool invert_y = invert_y_value == "-"; | 792 | const bool invert_y = invert_y_value == "-"; |
| 792 | const float offset_x = params.Get("offset_x", 0.0f); | 793 | const float offset_x = std::clamp(params.Get("offset_x", 0.0f), -0.99f, 0.99f); |
| 793 | const float offset_y = params.Get("offset_y", 0.0f); | 794 | const float offset_y = std::clamp(params.Get("offset_y", 0.0f), -0.99f, 0.99f); |
| 794 | auto joystick = state.GetSDLJoystickByGUID(guid, port); | 795 | auto joystick = state.GetSDLJoystickByGUID(guid, port); |
| 795 | 796 | ||
| 796 | // This is necessary so accessing GetAxis with axis_x and axis_y won't crash | 797 | // This is necessary so accessing GetAxis with axis_x and axis_y won't crash |
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp index 51ee14c13..5519c4705 100644 --- a/src/video_core/command_classes/codecs/h264.cpp +++ b/src/video_core/command_classes/codecs/h264.cpp | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | 20 | ||
| 21 | #include <array> | 21 | #include <array> |
| 22 | #include <bit> | 22 | #include <bit> |
| 23 | |||
| 24 | #include "common/settings.h" | ||
| 23 | #include "video_core/command_classes/codecs/h264.h" | 25 | #include "video_core/command_classes/codecs/h264.h" |
| 24 | #include "video_core/gpu.h" | 26 | #include "video_core/gpu.h" |
| 25 | #include "video_core/memory_manager.h" | 27 | #include "video_core/memory_manager.h" |
| @@ -96,7 +98,10 @@ const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegister | |||
| 96 | (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); | 98 | (context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2); |
| 97 | 99 | ||
| 98 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream | 100 | // TODO (ameerj): Where do we get this number, it seems to be particular for each stream |
| 99 | writer.WriteUe(6); // Max number of reference frames | 101 | const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue(); |
| 102 | const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU; | ||
| 103 | const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u; | ||
| 104 | writer.WriteUe(max_num_ref_frames); | ||
| 100 | writer.WriteBit(false); | 105 | writer.WriteBit(false); |
| 101 | writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); | 106 | writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1); |
| 102 | writer.WriteUe(pic_height - 1); | 107 | writer.WriteUe(pic_height - 1); |
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index da328d904..f31f86339 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -1837,7 +1837,7 @@ void PlayerControlPreview::DrawLeftBody(QPainter& p, const QPointF center) { | |||
| 1837 | const float led_size = 5.0f; | 1837 | const float led_size = 5.0f; |
| 1838 | const QPointF led_position = sideview_center + QPointF(0, -36); | 1838 | const QPointF led_position = sideview_center + QPointF(0, -36); |
| 1839 | int led_count = 0; | 1839 | int led_count = 0; |
| 1840 | for (const auto color : led_color) { | 1840 | for (const auto& color : led_color) { |
| 1841 | p.setBrush(color); | 1841 | p.setBrush(color); |
| 1842 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); | 1842 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); |
| 1843 | } | 1843 | } |
| @@ -1933,7 +1933,7 @@ void PlayerControlPreview::DrawRightBody(QPainter& p, const QPointF center) { | |||
| 1933 | const float led_size = 5.0f; | 1933 | const float led_size = 5.0f; |
| 1934 | const QPointF led_position = sideview_center + QPointF(0, -36); | 1934 | const QPointF led_position = sideview_center + QPointF(0, -36); |
| 1935 | int led_count = 0; | 1935 | int led_count = 0; |
| 1936 | for (const auto color : led_color) { | 1936 | for (const auto& color : led_color) { |
| 1937 | p.setBrush(color); | 1937 | p.setBrush(color); |
| 1938 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); | 1938 | DrawRectangle(p, led_position + QPointF(0, 12 * led_count++), led_size, led_size); |
| 1939 | } | 1939 | } |
diff --git a/src/yuzu/configuration/configure_tas.ui b/src/yuzu/configuration/configure_tas.ui index 3972f9083..6caa19031 100644 --- a/src/yuzu/configuration/configure_tas.ui +++ b/src/yuzu/configuration/configure_tas.ui | |||
| @@ -2,14 +2,6 @@ | |||
| 2 | <ui version="4.0"> | 2 | <ui version="4.0"> |
| 3 | <class>ConfigureTas</class> | 3 | <class>ConfigureTas</class> |
| 4 | <widget class="QDialog" name="ConfigureTas"> | 4 | <widget class="QDialog" name="ConfigureTas"> |
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>337</width> | ||
| 10 | <height>316</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <layout class="QVBoxLayout" name="verticalLayout_1"> | 5 | <layout class="QVBoxLayout" name="verticalLayout_1"> |
| 14 | <item> | 6 | <item> |
| 15 | <layout class="QHBoxLayout" name="horizontalLayout_1"> | 7 | <layout class="QHBoxLayout" name="horizontalLayout_1"> |
diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp index 7a6f84d96..33110685a 100644 --- a/src/yuzu/debugger/profiler.cpp +++ b/src/yuzu/debugger/profiler.cpp | |||
| @@ -143,24 +143,28 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) { | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { | 145 | void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { |
| 146 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 146 | const auto mouse_position = ev->pos(); |
| 147 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 147 | ev->accept(); | 148 | ev->accept(); |
| 148 | } | 149 | } |
| 149 | 150 | ||
| 150 | void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { | 151 | void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { |
| 151 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 152 | const auto mouse_position = ev->pos(); |
| 153 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 152 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); | 154 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); |
| 153 | ev->accept(); | 155 | ev->accept(); |
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { | 158 | void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { |
| 157 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); | 159 | const auto mouse_position = ev->pos(); |
| 160 | MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); | ||
| 158 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); | 161 | MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); |
| 159 | ev->accept(); | 162 | ev->accept(); |
| 160 | } | 163 | } |
| 161 | 164 | ||
| 162 | void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { | 165 | void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { |
| 163 | MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, | 166 | const auto wheel_position = ev->position().toPoint(); |
| 167 | MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale, | ||
| 164 | ev->angleDelta().y() / 120); | 168 | ev->angleDelta().y() / 120); |
| 165 | ev->accept(); | 169 | ev->accept(); |
| 166 | } | 170 | } |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index f9d949e75..ba54423ff 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -159,8 +159,7 @@ GameListSearchField::GameListSearchField(GameList* parent) : QWidget{parent} { | |||
| 159 | * @return true if the haystack contains all words of userinput | 159 | * @return true if the haystack contains all words of userinput |
| 160 | */ | 160 | */ |
| 161 | static bool ContainsAllWords(const QString& haystack, const QString& userinput) { | 161 | static bool ContainsAllWords(const QString& haystack, const QString& userinput) { |
| 162 | const QStringList userinput_split = | 162 | const QStringList userinput_split = userinput.split(QLatin1Char{' '}, Qt::SkipEmptyParts); |
| 163 | userinput.split(QLatin1Char{' '}, QString::SplitBehavior::SkipEmptyParts); | ||
| 164 | 163 | ||
| 165 | return std::all_of(userinput_split.begin(), userinput_split.end(), | 164 | return std::all_of(userinput_split.begin(), userinput_split.end(), |
| 166 | [&haystack](const QString& s) { return haystack.contains(s); }); | 165 | [&haystack](const QString& s) { return haystack.contains(s); }); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 552c2cc63..3eea61354 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1172,10 +1172,16 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 1172 | &GMainWindow::OnDisplayTitleBars); | 1172 | &GMainWindow::OnDisplayTitleBars); |
| 1173 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); | 1173 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); |
| 1174 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); | 1174 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); |
| 1175 | |||
| 1175 | connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this, | 1176 | connect(ui.action_Reset_Window_Size_720, &QAction::triggered, this, |
| 1176 | &GMainWindow::ResetWindowSize720); | 1177 | &GMainWindow::ResetWindowSize720); |
| 1178 | connect(ui.action_Reset_Window_Size_900, &QAction::triggered, this, | ||
| 1179 | &GMainWindow::ResetWindowSize900); | ||
| 1177 | connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this, | 1180 | connect(ui.action_Reset_Window_Size_1080, &QAction::triggered, this, |
| 1178 | &GMainWindow::ResetWindowSize1080); | 1181 | &GMainWindow::ResetWindowSize1080); |
| 1182 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_720); | ||
| 1183 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_900); | ||
| 1184 | ui.menu_Reset_Window_Size->addAction(ui.action_Reset_Window_Size_1080); | ||
| 1179 | 1185 | ||
| 1180 | // Fullscreen | 1186 | // Fullscreen |
| 1181 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); | 1187 | connect(ui.action_Fullscreen, &QAction::triggered, this, &GMainWindow::ToggleFullscreen); |
| @@ -2621,32 +2627,29 @@ void GMainWindow::ToggleWindowMode() { | |||
| 2621 | } | 2627 | } |
| 2622 | } | 2628 | } |
| 2623 | 2629 | ||
| 2624 | void GMainWindow::ResetWindowSize720() { | 2630 | void GMainWindow::ResetWindowSize(u32 width, u32 height) { |
| 2625 | const auto aspect_ratio = Layout::EmulationAspectRatio( | 2631 | const auto aspect_ratio = Layout::EmulationAspectRatio( |
| 2626 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), | 2632 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), |
| 2627 | static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width); | 2633 | static_cast<float>(height) / width); |
| 2628 | if (!ui.action_Single_Window_Mode->isChecked()) { | 2634 | if (!ui.action_Single_Window_Mode->isChecked()) { |
| 2629 | render_window->resize(Layout::ScreenUndocked::Height / aspect_ratio, | 2635 | render_window->resize(height / aspect_ratio, height); |
| 2630 | Layout::ScreenUndocked::Height); | ||
| 2631 | } else { | 2636 | } else { |
| 2632 | resize(Layout::ScreenUndocked::Height / aspect_ratio, | 2637 | const bool show_status_bar = ui.action_Show_Status_Bar->isChecked(); |
| 2633 | Layout::ScreenUndocked::Height + menuBar()->height() + | 2638 | const auto status_bar_height = show_status_bar ? statusBar()->height() : 0; |
| 2634 | (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); | 2639 | resize(height / aspect_ratio, height + menuBar()->height() + status_bar_height); |
| 2635 | } | 2640 | } |
| 2636 | } | 2641 | } |
| 2637 | 2642 | ||
| 2643 | void GMainWindow::ResetWindowSize720() { | ||
| 2644 | ResetWindowSize(Layout::ScreenUndocked::Width, Layout::ScreenUndocked::Height); | ||
| 2645 | } | ||
| 2646 | |||
| 2647 | void GMainWindow::ResetWindowSize900() { | ||
| 2648 | ResetWindowSize(1600U, 900U); | ||
| 2649 | } | ||
| 2650 | |||
| 2638 | void GMainWindow::ResetWindowSize1080() { | 2651 | void GMainWindow::ResetWindowSize1080() { |
| 2639 | const auto aspect_ratio = Layout::EmulationAspectRatio( | 2652 | ResetWindowSize(Layout::ScreenDocked::Width, Layout::ScreenDocked::Height); |
| 2640 | static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio.GetValue()), | ||
| 2641 | static_cast<float>(Layout::ScreenDocked::Height) / Layout::ScreenDocked::Width); | ||
| 2642 | if (!ui.action_Single_Window_Mode->isChecked()) { | ||
| 2643 | render_window->resize(Layout::ScreenDocked::Height / aspect_ratio, | ||
| 2644 | Layout::ScreenDocked::Height); | ||
| 2645 | } else { | ||
| 2646 | resize(Layout::ScreenDocked::Height / aspect_ratio, | ||
| 2647 | Layout::ScreenDocked::Height + menuBar()->height() + | ||
| 2648 | (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); | ||
| 2649 | } | ||
| 2650 | } | 2653 | } |
| 2651 | 2654 | ||
| 2652 | void GMainWindow::OnConfigure() { | 2655 | void GMainWindow::OnConfigure() { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 60ce01471..5df2c9422 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -272,7 +272,9 @@ private slots: | |||
| 272 | void ShowFullscreen(); | 272 | void ShowFullscreen(); |
| 273 | void HideFullscreen(); | 273 | void HideFullscreen(); |
| 274 | void ToggleWindowMode(); | 274 | void ToggleWindowMode(); |
| 275 | void ResetWindowSize(u32 width, u32 height); | ||
| 275 | void ResetWindowSize720(); | 276 | void ResetWindowSize720(); |
| 277 | void ResetWindowSize900(); | ||
| 276 | void ResetWindowSize1080(); | 278 | void ResetWindowSize1080(); |
| 277 | void OnCaptureScreenshot(); | 279 | void OnCaptureScreenshot(); |
| 278 | void OnCoreError(Core::System::ResultStatus, std::string); | 280 | void OnCoreError(Core::System::ResultStatus, std::string); |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index 653c010d8..a62e39a06 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -78,6 +78,35 @@ | |||
| 78 | <property name="title"> | 78 | <property name="title"> |
| 79 | <string>&View</string> | 79 | <string>&View</string> |
| 80 | </property> | 80 | </property> |
| 81 | <widget class="QMenu" name="menu_Reset_Window_Size"> | ||
| 82 | <property name="title"> | ||
| 83 | <string>&Reset Window Size</string> | ||
| 84 | </property> | ||
| 85 | </widget> | ||
| 86 | <action name="action_Reset_Window_Size_720"> | ||
| 87 | <property name="text"> | ||
| 88 | <string>Reset Window Size to &720p</string> | ||
| 89 | </property> | ||
| 90 | <property name="iconText"> | ||
| 91 | <string>Reset Window Size to 720p</string> | ||
| 92 | </property> | ||
| 93 | </action> | ||
| 94 | <action name="action_Reset_Window_Size_900"> | ||
| 95 | <property name="text"> | ||
| 96 | <string>Reset Window Size to &900p</string> | ||
| 97 | </property> | ||
| 98 | <property name="iconText"> | ||
| 99 | <string>Reset Window Size to 900p</string> | ||
| 100 | </property> | ||
| 101 | </action> | ||
| 102 | <action name="action_Reset_Window_Size_1080"> | ||
| 103 | <property name="text"> | ||
| 104 | <string>Reset Window Size to &1080p</string> | ||
| 105 | </property> | ||
| 106 | <property name="iconText"> | ||
| 107 | <string>Reset Window Size to 1080p</string> | ||
| 108 | </property> | ||
| 109 | </action> | ||
| 81 | <widget class="QMenu" name="menu_View_Debugging"> | 110 | <widget class="QMenu" name="menu_View_Debugging"> |
| 82 | <property name="title"> | 111 | <property name="title"> |
| 83 | <string>&Debugging</string> | 112 | <string>&Debugging</string> |
| @@ -88,9 +117,8 @@ | |||
| 88 | <addaction name="action_Display_Dock_Widget_Headers"/> | 117 | <addaction name="action_Display_Dock_Widget_Headers"/> |
| 89 | <addaction name="action_Show_Filter_Bar"/> | 118 | <addaction name="action_Show_Filter_Bar"/> |
| 90 | <addaction name="action_Show_Status_Bar"/> | 119 | <addaction name="action_Show_Status_Bar"/> |
| 91 | <addaction name="action_Reset_Window_Size_720"/> | ||
| 92 | <addaction name="action_Reset_Window_Size_1080"/> | ||
| 93 | <addaction name="separator"/> | 120 | <addaction name="separator"/> |
| 121 | <addaction name="menu_Reset_Window_Size"/> | ||
| 94 | <addaction name="menu_View_Debugging"/> | 122 | <addaction name="menu_View_Debugging"/> |
| 95 | </widget> | 123 | </widget> |
| 96 | <widget class="QMenu" name="menu_Tools"> | 124 | <widget class="QMenu" name="menu_Tools"> |
| @@ -216,22 +244,6 @@ | |||
| 216 | <string>Show Status Bar</string> | 244 | <string>Show Status Bar</string> |
| 217 | </property> | 245 | </property> |
| 218 | </action> | 246 | </action> |
| 219 | <action name="action_Reset_Window_Size_720"> | ||
| 220 | <property name="text"> | ||
| 221 | <string>Reset Window Size to &720p</string> | ||
| 222 | </property> | ||
| 223 | <property name="iconText"> | ||
| 224 | <string>Reset Window Size to 720p</string> | ||
| 225 | </property> | ||
| 226 | </action> | ||
| 227 | <action name="action_Reset_Window_Size_1080"> | ||
| 228 | <property name="text"> | ||
| 229 | <string>Reset Window Size to &1080p</string> | ||
| 230 | </property> | ||
| 231 | <property name="iconText"> | ||
| 232 | <string>Reset Window Size to 1080p</string> | ||
| 233 | </property> | ||
| 234 | </action> | ||
| 235 | <action name="action_Fullscreen"> | 247 | <action name="action_Fullscreen"> |
| 236 | <property name="checkable"> | 248 | <property name="checkable"> |
| 237 | <bool>true</bool> | 249 | <bool>true</bool> |