From 27e64e6855132c434526b110a9970a916a2b0304 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Fri, 6 Jan 2023 21:33:55 -0500 Subject: [PATCH 1/3] Android: Add Performance Sample Window slider --- .../dolphinemu/features/settings/model/IntSetting.java | 2 ++ .../features/settings/ui/SettingsFragmentPresenter.java | 3 +++ Source/Android/app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 7 insertions(+) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java index c7f2b0c54c..69b422ce54 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java @@ -67,6 +67,8 @@ public enum IntSetting implements AbstractIntSetting GFX_STEREO_CONVERGENCE_PERCENTAGE(Settings.FILE_GFX, Settings.SECTION_STEREOSCOPY, "StereoConvergencePercentage", 100), + GFX_PERF_SAMP_WINDOW(Settings.FILE_GFX, Settings.SECTION_GFX_SETTINGS, "PerfSampWindowMS", 1000), + LOGGER_VERBOSITY(Settings.FILE_LOGGER, Settings.SECTION_LOGGER_OPTIONS, "Verbosity", 1), WIIMOTE_1_SOURCE(Settings.FILE_WIIMOTE, "Wiimote1", "Source", 1), diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java index 76d5d8988d..e676f6cdcf 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java @@ -905,6 +905,9 @@ public final class SettingsFragmentPresenter sl.add(new SwitchSetting(mContext, BooleanSetting.GFX_LOG_RENDER_TIME_TO_FILE, R.string.log_render_time_to_file, R.string.log_render_time_to_file_description)); + sl.add(new IntSliderSetting(mContext, IntSetting.GFX_PERF_SAMP_WINDOW, + R.string.performance_sample_window, R.string.performance_sample_window_description, 0, + 10000, "ms")); } private void addAdvancedGraphicsSettings(ArrayList sl) diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index 7d99d030f0..005fd32cc2 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -328,6 +328,8 @@ Shows the average time in ms between each rendered frame alongside the standard deviation. Show Performance Graphs Shows frametime graph along with statistics as a representation of emulation performance. + Performance Sample Window + The amount of time the FPS and VPS counters will sample over. The higher the value, the more stable the FPS/VPS counter will be, but the slower it will be to update. Show % Speed Shows the % speed of emulation compared to full speed. Show Speed Color From e70b57fe8a5b4acddb6cbf98b7af0bcbf8b3caa0 Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Fri, 6 Jan 2023 22:52:46 -0500 Subject: [PATCH 2/3] Android: Adjust width of slider value text view --- Source/Android/app/src/main/res/layout/dialog_slider.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Android/app/src/main/res/layout/dialog_slider.xml b/Source/Android/app/src/main/res/layout/dialog_slider.xml index a83befbb8c..fdb2ffdecb 100644 --- a/Source/Android/app/src/main/res/layout/dialog_slider.xml +++ b/Source/Android/app/src/main/res/layout/dialog_slider.xml @@ -17,7 +17,7 @@ + tools:text="10000" /> Date: Fri, 6 Jan 2023 22:51:58 -0500 Subject: [PATCH 3/3] Android: Change slider step size based on range Credit to JosJuice for the slider formula --- .../features/settings/ui/SettingsAdapter.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index b51d87e5a9..c15c0d4498 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -286,7 +286,18 @@ public final class SettingsAdapter extends RecyclerView.Adapter