diff options
author | bunnei <bunneidev@gmail.com> | 2016-11-16 01:57:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 01:57:08 +0100 |
commit | 5a31552764dc8970253e642f4b829a8b785375c6 (patch) | |
tree | 8186a82c37ae04c17bd1d6250c524fc097f9671c /src/citra | |
parent | Merge pull request #2171 from jroweboy/fix-mac-build (diff) | |
parent | Round the rectangle size to prevent float to int casting issues (diff) | |
download | yuzu-5a31552764dc8970253e642f4b829a8b785375c6.tar yuzu-5a31552764dc8970253e642f4b829a8b785375c6.tar.gz yuzu-5a31552764dc8970253e642f4b829a8b785375c6.tar.bz2 yuzu-5a31552764dc8970253e642f4b829a8b785375c6.tar.lz yuzu-5a31552764dc8970253e642f4b829a8b785375c6.tar.xz yuzu-5a31552764dc8970253e642f4b829a8b785375c6.tar.zst yuzu-5a31552764dc8970253e642f4b829a8b785375c6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/citra/config.cpp | 5 | ||||
-rw-r--r-- | src/citra/default_ini.h | 10 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 5 | ||||
-rw-r--r-- | src/citra_qt/bootmanager.cpp | 4 | ||||
-rw-r--r-- | src/citra_qt/config.cpp | 11 | ||||
-rw-r--r-- | src/citra_qt/configure_dialog.cpp | 1 | ||||
-rw-r--r-- | src/citra_qt/configure_graphics.cpp | 5 | ||||
-rw-r--r-- | src/citra_qt/configure_graphics.ui | 115 | ||||
-rw-r--r-- | src/citra_qt/main.cpp | 8 | ||||
-rw-r--r-- | src/citra_qt/main.h | 1 |
10 files changed, 117 insertions, 48 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 05eabfa3d..fd30bfc85 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -72,6 +72,11 @@ void Config::ReadValues() { Settings::values.bg_green = (float)sdl2_config->GetReal("Renderer", "bg_green", 1.0); Settings::values.bg_blue = (float)sdl2_config->GetReal("Renderer", "bg_blue", 1.0); + // Layout + Settings::values.layout_option = + static_cast<Settings::LayoutOption>(sdl2_config->GetInteger("Layout", "layout_option", 0)); + Settings::values.swap_screen = sdl2_config->GetBoolean("Layout", "swap_screen", false); + // Audio Settings::values.sink_id = sdl2_config->Get("Audio", "output_engine", "auto"); Settings::values.enable_audio_stretching = diff --git a/src/citra/default_ini.h b/src/citra/default_ini.h index 0b49e0230..b22627a2f 100644 --- a/src/citra/default_ini.h +++ b/src/citra/default_ini.h @@ -63,6 +63,16 @@ use_scaled_resolution = # 0 (default): Off, 1: On use_vsync = +[Layout] +# Layout for the screen inside the render window. +# 0 (default): Default Top Bottom Screen, 1: Single Screen Only, 2: Large Screen Small Screen +layout_option = + +# Swaps the prominent screen with the other screen. +# For example, if Single Screen is chosen, setting this to 1 will display the bottom screen instead of the top screen. +# 0 (default): Top Screen is prominent, 1: Bottom Screen is prominent +swap_screen = + # The clear color for the renderer. What shows up on the sides of the bottom screen. # Must be in range of 0.0-1.0. Defaults to 1.0 for all. bg_red = diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 7df054208..8abe48984 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -46,11 +46,8 @@ bool EmuWindow_SDL2::IsOpen() const { void EmuWindow_SDL2::OnResize() { int width, height; - SDL_GetWindowSize(render_window, &width, &height); - - NotifyFramebufferLayoutChanged( - EmuWindow::FramebufferLayout::DefaultScreenLayout(width, height)); + UpdateCurrentFramebufferLayout(width, height); } EmuWindow_SDL2::EmuWindow_SDL2() { diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 0abae86c3..7699ca8d0 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -161,9 +161,7 @@ void GRenderWindow::OnFramebufferSizeChanged() { qreal pixelRatio = windowPixelRatio(); unsigned width = child->QPaintDevice::width() * pixelRatio; unsigned height = child->QPaintDevice::height() * pixelRatio; - - NotifyFramebufferLayoutChanged( - EmuWindow::FramebufferLayout::DefaultScreenLayout(width, height)); + UpdateCurrentFramebufferLayout(width, height); } void GRenderWindow::BackupGeometry() { diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index 0b46ca6bb..3d2312619 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -54,6 +54,12 @@ void Config::ReadValues() { Settings::values.bg_blue = qt_config->value("bg_blue", 1.0).toFloat(); qt_config->endGroup(); + qt_config->beginGroup("Layout"); + Settings::values.layout_option = + static_cast<Settings::LayoutOption>(qt_config->value("layout_option").toInt()); + Settings::values.swap_screen = qt_config->value("swap_screen", false).toBool(); + qt_config->endGroup(); + qt_config->beginGroup("Audio"); Settings::values.sink_id = qt_config->value("output_engine", "auto").toString().toStdString(); Settings::values.enable_audio_stretching = @@ -155,6 +161,11 @@ void Config::SaveValues() { qt_config->setValue("bg_blue", (double)Settings::values.bg_blue); qt_config->endGroup(); + qt_config->beginGroup("Layout"); + qt_config->setValue("layout_option", static_cast<int>(Settings::values.layout_option)); + qt_config->setValue("swap_screen", Settings::values.swap_screen); + qt_config->endGroup(); + qt_config->beginGroup("Audio"); qt_config->setValue("output_engine", QString::fromStdString(Settings::values.sink_id)); qt_config->setValue("enable_audio_stretching", Settings::values.enable_audio_stretching); diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp index 446ad04a1..525a7cc4e 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configure_dialog.cpp @@ -23,4 +23,5 @@ void ConfigureDialog::applyConfiguration() { ui->graphicsTab->applyConfiguration(); ui->audioTab->applyConfiguration(); ui->debugTab->applyConfiguration(); + Settings::Apply(); } diff --git a/src/citra_qt/configure_graphics.cpp b/src/citra_qt/configure_graphics.cpp index 19c1f75c2..29834e11b 100644 --- a/src/citra_qt/configure_graphics.cpp +++ b/src/citra_qt/configure_graphics.cpp @@ -23,6 +23,8 @@ void ConfigureGraphics::setConfiguration() { ui->toggle_shader_jit->setChecked(Settings::values.use_shader_jit); ui->toggle_scaled_resolution->setChecked(Settings::values.use_scaled_resolution); ui->toggle_vsync->setChecked(Settings::values.use_vsync); + ui->layout_combobox->setCurrentIndex(static_cast<int>(Settings::values.layout_option)); + ui->swap_screen->setChecked(Settings::values.swap_screen); } void ConfigureGraphics::applyConfiguration() { @@ -30,5 +32,8 @@ void ConfigureGraphics::applyConfiguration() { Settings::values.use_shader_jit = ui->toggle_shader_jit->isChecked(); Settings::values.use_scaled_resolution = ui->toggle_scaled_resolution->isChecked(); Settings::values.use_vsync = ui->toggle_vsync->isChecked(); + Settings::values.layout_option = + static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex()); + Settings::values.swap_screen = ui->swap_screen->isChecked(); Settings::Apply(); } diff --git a/src/citra_qt/configure_graphics.ui b/src/citra_qt/configure_graphics.ui index da6e19ce1..af16a4292 100644 --- a/src/citra_qt/configure_graphics.ui +++ b/src/citra_qt/configure_graphics.ui @@ -22,38 +22,88 @@ <string>Graphics</string> </property> <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QCheckBox" name="toggle_hw_renderer"> - <property name="text"> - <string>Enable hardware renderer</string> - </property> + <item> + <widget class="QCheckBox" name="toggle_hw_renderer"> + <property name="text"> + <string>Enable hardware renderer</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="toggle_shader_jit"> + <property name="text"> + <string>Enable shader JIT</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="toggle_scaled_resolution"> + <property name="text"> + <string>Enable scaled resolution</string> + </property> + </widget> + </item> + <item> + <widget class="QCheckBox" name="toggle_vsync"> + <property name="text"> + <string>Enable V-Sync</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QGroupBox" name="groupBox2"> + <property name="title"> + <string>Layout</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="label1"> + <property name="text"> + <string>Screen Layout:</string> + </property> </widget> - </item> - <item> - <widget class="QCheckBox" name="toggle_shader_jit"> + </item> + <item> + <widget class="QComboBox" name="layout_combobox"> + <item> <property name="text"> - <string>Enable shader JIT</string> + <string notr="true">Default</string> </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="toggle_scaled_resolution"> + </item> + <item> <property name="text"> - <string>Enable scaled resolution</string> + <string notr="true">Single Screen</string> </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="toggle_vsync"> + </item> + <item> <property name="text"> - <string>Enable V-Sync</string> + <string notr="true">Large Screen</string> </property> + </item> </widget> - </item> + </item> + </layout> + </item> + <item> + <widget class="QCheckBox" name="swap_screen"> + <property name="text"> + <string>Swap Screens</string> + </property> + </widget> + </item> </layout> - </widget> - </item> - </layout> + </item> + </layout> + </widget> </item> <item> <spacer name="verticalSpacer"> @@ -71,22 +121,5 @@ </layout> </widget> <resources/> - <connections> - <connection> - <sender>toggle_gdbstub</sender> - <signal>toggled(bool)</signal> - <receiver>gdbport_spinbox</receiver> - <slot>setEnabled(bool)</slot> - <hints> - <hint type="sourcelabel"> - <x>84</x> - <y>157</y> - </hint> - <hint type="destinationlabel"> - <x>342</x> - <y>158</y> - </hint> - </hints> - </connection> - </connections> + <connections/> </ui> diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index b904fec16..bcf2a706f 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -196,6 +196,7 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { // Setup hotkeys RegisterHotkey("Main Window", "Load File", QKeySequence::Open); + RegisterHotkey("Main Window", "Swap Screens", QKeySequence::NextChild); RegisterHotkey("Main Window", "Start Emulation"); LoadHotkeys(); @@ -203,6 +204,8 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { SLOT(OnMenuLoadFile())); connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, SLOT(OnStartGame())); + connect(GetHotkey("Main Window", "Swap Screens", this), SIGNAL(activated()), this, + SLOT(OnSwapScreens())); std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc); @@ -550,6 +553,11 @@ void GMainWindow::OnConfigure() { } } +void GMainWindow::OnSwapScreens() { + Settings::values.swap_screen = !Settings::values.swap_screen; + Settings::Apply(); +} + void GMainWindow::OnCreateGraphicsSurfaceViewer() { auto graphicsSurfaceViewerWidget = new GraphicsSurfaceWidget(Pica::g_debug_context, this); addDockWidget(Qt::RightDockWidgetArea, graphicsSurfaceViewerWidget); diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 2cf308d80..82eb90aae 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -105,6 +105,7 @@ private slots: /// Called whenever a user selects the "File->Select Game List Root" menu item void OnMenuSelectGameListRoot(); void OnMenuRecentFile(); + void OnSwapScreens(); void OnConfigure(); void OnDisplayTitleBars(bool); void ToggleWindowMode(); |