From 2b1654ad9bbd8af53f22434d350704a1a1d0a285 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Tue, 3 May 2016 00:07:17 -0600 Subject: Support additional screen layouts. Allows users to choose a single screen layout or a large screen layout. Adds a configuration option to change the prominent screen. --- src/citra/config.cpp | 4 ++++ src/citra/default_ini.h | 10 ++++++++++ src/citra/emu_window/emu_window_sdl2.cpp | 5 +---- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/citra') diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 05eabfa3d..305e3ba53 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -72,6 +72,10 @@ 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(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() { -- cgit v1.2.3