diff options
| author | 2017-03-21 22:57:31 -0400 | |
|---|---|---|
| committer | 2017-03-21 22:57:31 -0400 | |
| commit | ccc3985cc0efe520bf4f53d4fcac7bfe1abdc82c (patch) | |
| tree | 38120c3cf4e7af72dc8122f9f278b77aa52b663b /src/core | |
| parent | Removed a linebreak from the README. (diff) | |
| parent | Add custom layout settings. (diff) | |
| download | yuzu-ccc3985cc0efe520bf4f53d4fcac7bfe1abdc82c.tar.gz yuzu-ccc3985cc0efe520bf4f53d4fcac7bfe1abdc82c.tar.xz yuzu-ccc3985cc0efe520bf4f53d4fcac7bfe1abdc82c.zip | |
Merge pull request #2512 from SonofUgly/custom-layout
Add custom layout settings.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/frontend/emu_window.cpp | 26 | ||||
| -rw-r--r-- | src/core/settings.h | 10 |
2 files changed, 24 insertions, 12 deletions
diff --git a/src/core/frontend/emu_window.cpp b/src/core/frontend/emu_window.cpp index 73a44bfe7..5fdb3a7e8 100644 --- a/src/core/frontend/emu_window.cpp +++ b/src/core/frontend/emu_window.cpp | |||
| @@ -89,17 +89,21 @@ void EmuWindow::GyroscopeChanged(float x, float y, float z) { | |||
| 89 | 89 | ||
| 90 | void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { | 90 | void EmuWindow::UpdateCurrentFramebufferLayout(unsigned width, unsigned height) { |
| 91 | Layout::FramebufferLayout layout; | 91 | Layout::FramebufferLayout layout; |
| 92 | switch (Settings::values.layout_option) { | 92 | if (Settings::values.custom_layout == true) { |
| 93 | case Settings::LayoutOption::SingleScreen: | 93 | layout = Layout::CustomFrameLayout(width, height); |
| 94 | layout = Layout::SingleFrameLayout(width, height, Settings::values.swap_screen); | 94 | } else { |
| 95 | break; | 95 | switch (Settings::values.layout_option) { |
| 96 | case Settings::LayoutOption::LargeScreen: | 96 | case Settings::LayoutOption::SingleScreen: |
| 97 | layout = Layout::LargeFrameLayout(width, height, Settings::values.swap_screen); | 97 | layout = Layout::SingleFrameLayout(width, height, Settings::values.swap_screen); |
| 98 | break; | 98 | break; |
| 99 | case Settings::LayoutOption::Default: | 99 | case Settings::LayoutOption::LargeScreen: |
| 100 | default: | 100 | layout = Layout::LargeFrameLayout(width, height, Settings::values.swap_screen); |
| 101 | layout = Layout::DefaultFrameLayout(width, height, Settings::values.swap_screen); | 101 | break; |
| 102 | break; | 102 | case Settings::LayoutOption::Default: |
| 103 | default: | ||
| 104 | layout = Layout::DefaultFrameLayout(width, height, Settings::values.swap_screen); | ||
| 105 | break; | ||
| 106 | } | ||
| 103 | } | 107 | } |
| 104 | NotifyFramebufferLayoutChanged(layout); | 108 | NotifyFramebufferLayoutChanged(layout); |
| 105 | } | 109 | } |
diff --git a/src/core/settings.h b/src/core/settings.h index d1a9f0da8..03c64c94c 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -15,7 +15,6 @@ enum class LayoutOption { | |||
| 15 | Default, | 15 | Default, |
| 16 | SingleScreen, | 16 | SingleScreen, |
| 17 | LargeScreen, | 17 | LargeScreen, |
| 18 | Custom, | ||
| 19 | }; | 18 | }; |
| 20 | 19 | ||
| 21 | namespace NativeButton { | 20 | namespace NativeButton { |
| @@ -99,6 +98,15 @@ struct Values { | |||
| 99 | 98 | ||
| 100 | LayoutOption layout_option; | 99 | LayoutOption layout_option; |
| 101 | bool swap_screen; | 100 | bool swap_screen; |
| 101 | bool custom_layout; | ||
| 102 | u16 custom_top_left; | ||
| 103 | u16 custom_top_top; | ||
| 104 | u16 custom_top_right; | ||
| 105 | u16 custom_top_bottom; | ||
| 106 | u16 custom_bottom_left; | ||
| 107 | u16 custom_bottom_top; | ||
| 108 | u16 custom_bottom_right; | ||
| 109 | u16 custom_bottom_bottom; | ||
| 102 | 110 | ||
| 103 | float bg_red; | 111 | float bg_red; |
| 104 | float bg_green; | 112 | float bg_green; |