diff options
author | bunnei <bunneidev@gmail.com> | 2023-01-24 01:44:05 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:28 +0200 |
commit | 6cc21a56d96ce2ace61369dbff77ebbe682b2b05 (patch) | |
tree | 89b7a9b57ec355d86906a2d1336b9217476dbd8d /src | |
parent | android: Integrate settings frontend with yuzu & remove unused code. (diff) | |
download | yuzu-6cc21a56d96ce2ace61369dbff77ebbe682b2b05.tar yuzu-6cc21a56d96ce2ace61369dbff77ebbe682b2b05.tar.gz yuzu-6cc21a56d96ce2ace61369dbff77ebbe682b2b05.tar.bz2 yuzu-6cc21a56d96ce2ace61369dbff77ebbe682b2b05.tar.lz yuzu-6cc21a56d96ce2ace61369dbff77ebbe682b2b05.tar.xz yuzu-6cc21a56d96ce2ace61369dbff77ebbe682b2b05.tar.zst yuzu-6cc21a56d96ce2ace61369dbff77ebbe682b2b05.zip |
Diffstat (limited to '')
7 files changed, 25 insertions, 2 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.java index c84467c16..b6176e504 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.java +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.java @@ -159,11 +159,13 @@ public final class SettingsFragmentPresenter { Setting rendererBackend = rendererSection.getSetting(SettingsFile.KEY_RENDERER_BACKEND); Setting rendererAccuracy = rendererSection.getSetting(SettingsFile.KEY_RENDERER_ACCURACY); Setting rendererReolution = rendererSection.getSetting(SettingsFile.KEY_RENDERER_RESOLUTION); + Setting rendererAspectRation = rendererSection.getSetting(SettingsFile.KEY_RENDERER_ASPECT_RATIO); Setting rendererAsynchronousShaders = rendererSection.getSetting(SettingsFile.KEY_RENDERER_ASYNCHRONOUS_SHADERS); sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_BACKEND, Settings.SECTION_RENDERER, R.string.renderer_api, 0, R.array.rendererApiNames, R.array.rendererApiValues, 0, rendererBackend)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_ACCURACY, Settings.SECTION_RENDERER, R.string.renderer_accuracy, 0, R.array.rendererAccuracyNames, R.array.rendererAccuracyValues, 1, rendererAccuracy)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_RESOLUTION, Settings.SECTION_RENDERER, R.string.renderer_resolution, 0, R.array.rendererResolutionNames, R.array.rendererResolutionValues, 2, rendererReolution)); + sl.add(new SingleChoiceSetting(SettingsFile.KEY_RENDERER_ASPECT_RATIO, Settings.SECTION_RENDERER, R.string.renderer_aspect_ratio, 0, R.array.rendererAspectRatioNames, R.array.rendererAspectRatioValues, 0, rendererAspectRation)); sl.add(new CheckBoxSetting(SettingsFile.KEY_RENDERER_ASYNCHRONOUS_SHADERS, Settings.SECTION_RENDERER, R.string.renderer_asynchronous_shaders, R.string.renderer_asynchronous_shaders_description, false, rendererAsynchronousShaders)); } diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.java index 6526f9139..392c2e62d 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.java +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/utils/SettingsFile.java @@ -44,6 +44,7 @@ public final class SettingsFile { public static final String KEY_RENDERER_BACKEND = "backend"; // Renderer public static final String KEY_RENDERER_RESOLUTION = "resolution_setup"; + public static final String KEY_RENDERER_ASPECT_RATIO = "aspect_ratio"; public static final String KEY_RENDERER_ACCURACY = "gpu_accuracy"; public static final String KEY_RENDERER_ASYNCHRONOUS_SHADERS = "use_asynchronous_shaders"; public static final String KEY_RENDERER_USE_SPEED_LIMIT = "use_speed_limit"; diff --git a/src/android/app/src/main/jni/default_ini.h b/src/android/app/src/main/jni/default_ini.h index 60db951c8..eecda4756 100644 --- a/src/android/app/src/main/jni/default_ini.h +++ b/src/android/app/src/main/jni/default_ini.h @@ -294,7 +294,7 @@ anti_aliasing = fullscreen_mode = # Aspect ratio -# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window +# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Force 16:10, 4: Stretch to Window aspect_ratio = # Anisotropic filtering diff --git a/src/android/app/src/main/jni/emu_window/emu_window.cpp b/src/android/app/src/main/jni/emu_window/emu_window.cpp index 9062c0ae3..cef296037 100644 --- a/src/android/app/src/main/jni/emu_window/emu_window.cpp +++ b/src/android/app/src/main/jni/emu_window/emu_window.cpp @@ -46,6 +46,9 @@ EmuWindow_Android::EmuWindow_Android(InputCommon::InputSubsystem* input_subsyste window_width = ANativeWindow_getWidth(surface_); window_height = ANativeWindow_getHeight(surface_); + // Ensures that we emulate with the correct aspect ratio. + UpdateCurrentFramebufferLayout(window_width, window_height); + host_window = surface_; window_info.type = Core::Frontend::WindowSystemType::Android; window_info.render_surface = reinterpret_cast<void*>(host_window); diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index bf9922be8..53c4765b1 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -140,6 +140,22 @@ <item>5</item> </integer-array> + <string-array name="rendererAspectRatioNames"> + <item>Default (16:9)</item> + <item>Force 4:3</item> + <item>Force 21:9</item> + <item>Force 16:10</item> + <item>Stretch to Window</item> + </string-array> + + <integer-array name="rendererAspectRatioValues"> + <item>0</item> + <item>1</item> + <item>2</item> + <item>3</item> + <item>4</item> + </integer-array> + <string-array name="cpuAccuracyNames"> <item>Auto</item> <item>Accurate</item> diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 239fde48d..cc84f700e 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -28,6 +28,7 @@ <string name="renderer_api">API</string> <string name="renderer_accuracy">Accuracy level</string> <string name="renderer_resolution">Resolution</string> + <string name="renderer_aspect_ratio">Aspect Ratio</string> <string name="renderer_asynchronous_shaders">Use asynchronous shaders</string> <string name="renderer_asynchronous_shaders_description">Compiles shaders asynchronously, which will reduce stutter but may introduce glitches.</string> diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 644a30e59..911d461e4 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -318,7 +318,7 @@ anti_aliasing = fullscreen_mode = # Aspect ratio -# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window +# 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Force 16:10, 4: Stretch to Window aspect_ratio = # Anisotropic filtering |