[Android] Add the option to show the on-screen FPS counter.

This commit is contained in:
Lioncash 2013-09-01 03:07:16 -04:00
parent b03ff7a86b
commit 440ae412b0
4 changed files with 40 additions and 26 deletions

View File

@ -80,6 +80,8 @@
<string name="opengl_es3">OpenGL ES 3</string> <string name="opengl_es3">OpenGL ES 3</string>
<string name="video_backend">ビデオレンダラ</string> <string name="video_backend">ビデオレンダラ</string>
<string name="video_backend_to_use">使用するビデオレンダラー</string> <string name="video_backend_to_use">使用するビデオレンダラー</string>
<string name="show_fps">FPSを表示</string>
<string name="show_fps_descrip">エミュレーション速度の指標として、画面左上に毎秒レンダリングされた フレーム数を表示します。</string>
<string name="draw_onscreen_controls">画面上のコントロールを描画</string> <string name="draw_onscreen_controls">画面上のコントロールを描画</string>
<string name="enhancements">画質向上の設定</string> <string name="enhancements">画質向上の設定</string>

View File

@ -80,6 +80,8 @@
<string name="opengl_es3">OpenGL ES 3</string> <string name="opengl_es3">OpenGL ES 3</string>
<string name="video_backend">Video Backend</string> <string name="video_backend">Video Backend</string>
<string name="video_backend_to_use">Video backend to use</string> <string name="video_backend_to_use">Video backend to use</string>
<string name="show_fps">Show FPS</string>
<string name="show_fps_descrip">Show the number of frames rendered per second as a measure of emulation speed.</string>
<string name="draw_onscreen_controls">Draw on-screen controls</string> <string name="draw_onscreen_controls">Draw on-screen controls</string>
<string name="enhancements">Enhancements</string> <string name="enhancements">Enhancements</string>

View File

@ -3,66 +3,66 @@
<!-- Video Settings --> <!-- Video Settings -->
<!-- Video Enhancements --> <!-- Video Enhancements -->
<PreferenceScreen android:title="@string/enhancements"> <PreferenceScreen android:title="@string/enhancements">
<ListPreference <ListPreference
android:entries="@array/internalResolutionEntries" android:entries="@array/internalResolutionEntries"
android:entryValues="@array/internalResolutionValues" android:entryValues="@array/internalResolutionValues"
android:key="internalResolution" android:key="internalResolution"
android:summary="@string/internal_resolution_descrip" android:summary="@string/internal_resolution_descrip"
android:title="@string/internal_resolution"/> android:title="@string/internal_resolution"/>
<ListPreference <ListPreference
android:entries="@array/anisotropicFilteringEntries" android:entries="@array/anisotropicFilteringEntries"
android:entryValues="@array/anisotropicFilteringValues" android:entryValues="@array/anisotropicFilteringValues"
android:key="anisotropicFiltering" android:key="anisotropicFiltering"
android:summary="@string/anisotropic_filtering_descrip" android:summary="@string/anisotropic_filtering_descrip"
android:title="@string/anisotropic_filtering"/> android:title="@string/anisotropic_filtering"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="true" android:defaultValue="true"
android:key="scaledEFBCopy" android:key="scaledEFBCopy"
android:summary="@string/scaled_efb_copy_descrip" android:summary="@string/scaled_efb_copy_descrip"
android:title="@string/scaled_efb_copy"/> android:title="@string/scaled_efb_copy"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="perPixelLighting" android:key="perPixelLighting"
android:summary="@string/per_pixel_lighting_descrip" android:summary="@string/per_pixel_lighting_descrip"
android:title="@string/per_pixel_lighting"/> android:title="@string/per_pixel_lighting"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="forceTextureFiltering" android:key="forceTextureFiltering"
android:summary="@string/force_texture_filtering_descrip" android:summary="@string/force_texture_filtering_descrip"
android:title="@string/force_texture_filtering"/> android:title="@string/force_texture_filtering"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="disableFog" android:key="disableFog"
android:summary="@string/disable_fog_descrip" android:summary="@string/disable_fog_descrip"
android:title="@string/disable_fog"/> android:title="@string/disable_fog"/>
</PreferenceScreen> </PreferenceScreen>
<!-- Video Hacks --> <!-- Video Hacks -->
<PreferenceScreen android:title="@string/hacks"> <PreferenceScreen android:title="@string/hacks">
<PreferenceCategory android:title="@string/embedded_frame_buffer"> <PreferenceCategory android:title="@string/embedded_frame_buffer">
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="skipEFBAccess" android:key="skipEFBAccess"
android:summary="@string/skip_efb_access_descrip" android:summary="@string/skip_efb_access_descrip"
android:title="@string/skip_efb_access"/> android:title="@string/skip_efb_access"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="true" android:defaultValue="true"
android:key="ignoreFormatChanges" android:key="ignoreFormatChanges"
android:summary="@string/ignore_format_changes_descrip" android:summary="@string/ignore_format_changes_descrip"
android:title="@string/ignore_format_changes"/> android:title="@string/ignore_format_changes"/>
<ListPreference <ListPreference
android:defaultValue="Texture" android:defaultValue="Texture"
android:entries="@array/efbCopyMethodEntries" android:entries="@array/efbCopyMethodEntries"
@ -70,9 +70,9 @@
android:key="efbCopyMethod" android:key="efbCopyMethod"
android:summary="@string/efb_copy_method_descrip" android:summary="@string/efb_copy_method_descrip"
android:title="@string/efb_copy_method"/> android:title="@string/efb_copy_method"/>
</PreferenceCategory> </PreferenceCategory>
<!-- Texture Cache --> <!-- Texture Cache -->
<PreferenceCategory android:title="@string/texture_cache"> <PreferenceCategory android:title="@string/texture_cache">
<ListPreference <ListPreference
@ -83,7 +83,7 @@
android:summary="@string/texture_cache_accuracy_descrip" android:summary="@string/texture_cache_accuracy_descrip"
android:title="@string/texture_cache_accuracy"/> android:title="@string/texture_cache_accuracy"/>
</PreferenceCategory> </PreferenceCategory>
<!-- External Frame Buffer --> <!-- External Frame Buffer -->
<PreferenceCategory android:title="@string/external_frame_buffer"> <PreferenceCategory android:title="@string/external_frame_buffer">
<ListPreference <ListPreference
@ -94,36 +94,41 @@
android:summary="@string/external_frame_buffer_descrip" android:summary="@string/external_frame_buffer_descrip"
android:title="@string/external_frame_buffer"/> android:title="@string/external_frame_buffer"/>
</PreferenceCategory> </PreferenceCategory>
<!-- Other Hacks --> <!-- Other Hacks -->
<PreferenceCategory android:title="@string/other"> <PreferenceCategory android:title="@string/other">
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="cacheDisplayLists" android:key="cacheDisplayLists"
android:summary="@string/cache_display_lists_descrip" android:summary="@string/cache_display_lists_descrip"
android:title="@string/cache_display_lists"/> android:title="@string/cache_display_lists"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="disableDestinationAlpha" android:key="disableDestinationAlpha"
android:summary="@string/disable_destination_alpha_descrip" android:summary="@string/disable_destination_alpha_descrip"
android:title="@string/disable_destination_alpha"/> android:title="@string/disable_destination_alpha"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="true" android:defaultValue="true"
android:key="fastDepthCalculation" android:key="fastDepthCalculation"
android:summary="@string/fast_depth_calculation_descrip" android:summary="@string/fast_depth_calculation_descrip"
android:title="@string/fast_depth_calculation"/> android:title="@string/fast_depth_calculation"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>
<ListPreference <ListPreference
android:key="gpuPref" android:key="gpuPref"
android:summary="@string/video_backend_to_use" android:summary="@string/video_backend_to_use"
android:title="@string/video_backend" /> android:title="@string/video_backend" />
<CheckBoxPreference
android:key="showFPS"
android:summary="@string/show_fps_descrip"
android:title="@string/show_fps"/>
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="true" android:defaultValue="true"

View File

@ -37,7 +37,8 @@ public final class UserPreferences
editor.putString("cpuCorePref", getConfig("Dolphin.ini", "Core", "CPUCore", "3")); editor.putString("cpuCorePref", getConfig("Dolphin.ini", "Core", "CPUCore", "3"));
editor.putBoolean("dualCorePref", getConfig("Dolphin.ini", "Core", "CPUThread", "False").equals("True")); editor.putBoolean("dualCorePref", getConfig("Dolphin.ini", "Core", "CPUThread", "False").equals("True"));
editor.putString("gpuPref", getConfig("Dolphin.ini", "Core", "GFXBackend ", "Software Renderer")); editor.putString("gpuPref", getConfig("Dolphin.ini", "Core", "GFXBackend ", "Software Renderer"));
editor.putBoolean("showFPS", getConfig("gfx_opengl.ini", "Settings", "ShowFPS", "False").equals("True"));
editor.putBoolean("drawOnscreenControls", getConfig("Dolphin.ini", "Android", "ScreenControls", "True").equals("True")); editor.putBoolean("drawOnscreenControls", getConfig("Dolphin.ini", "Android", "ScreenControls", "True").equals("True"));
editor.putString("internalResolution", getConfig("gfx_opengl.ini", "Settings", "EFBScale", "2") ); editor.putString("internalResolution", getConfig("gfx_opengl.ini", "Settings", "EFBScale", "2") );
@ -120,6 +121,9 @@ public final class UserPreferences
// Current video backend being used. Falls back to software rendering upon error. // Current video backend being used. Falls back to software rendering upon error.
String currentVideoBackend = prefs.getString("gpuPref", "Software Rendering"); String currentVideoBackend = prefs.getString("gpuPref", "Software Rendering");
// Whether or not FPS will be displayed on-screen.
boolean showingFPS = prefs.getBoolean("showFPS", false);
// Whether or not to draw on-screen controls. // Whether or not to draw on-screen controls.
boolean drawingOnscreenControls = prefs.getBoolean("drawOnscreenControls", true); boolean drawingOnscreenControls = prefs.getBoolean("drawOnscreenControls", true);
@ -172,6 +176,7 @@ public final class UserPreferences
// General Video Settings // General Video Settings
NativeLibrary.SetConfig("Dolphin.ini", "Core", "GFXBackend", currentVideoBackend); NativeLibrary.SetConfig("Dolphin.ini", "Core", "GFXBackend", currentVideoBackend);
NativeLibrary.SetConfig("gfx_opengl.ini", "Settings", "ShowFPS", showingFPS ? "True" : "False");
NativeLibrary.SetConfig("Dolphin.ini", "Android", "ScreenControls", drawingOnscreenControls ? "True" : "False"); NativeLibrary.SetConfig("Dolphin.ini", "Android", "ScreenControls", drawingOnscreenControls ? "True" : "False");
// Video Hack Settings // Video Hack Settings