android: Fix fps counter not showing up

This commit is contained in:
german77 2023-03-25 13:04:36 -06:00 committed by bunnei
parent ec048361af
commit a862c33fc4
4 changed files with 13 additions and 11 deletions

View File

@ -33,6 +33,7 @@ import org.yuzu.yuzu_emu.model.Game
import org.yuzu.yuzu_emu.utils.DirectoryInitialization import org.yuzu.yuzu_emu.utils.DirectoryInitialization
import org.yuzu.yuzu_emu.utils.DirectoryInitialization.DirectoryInitializationState import org.yuzu.yuzu_emu.utils.DirectoryInitialization.DirectoryInitializationState
import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver
import org.yuzu.yuzu_emu.utils.EmulationMenuSettings
import org.yuzu.yuzu_emu.utils.InsetsHelper import org.yuzu.yuzu_emu.utils.InsetsHelper
import org.yuzu.yuzu_emu.utils.Log import org.yuzu.yuzu_emu.utils.Log
import org.yuzu.yuzu_emu.utils.SerializableHelper.parcelable import org.yuzu.yuzu_emu.utils.SerializableHelper.parcelable
@ -221,8 +222,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
} }
private fun updateShowFpsOverlay() { private fun updateShowFpsOverlay() {
// TODO: Create a setting so that this actually works... if (EmulationMenuSettings.showFps) {
if (true) {
val SYSTEM_FPS = 0 val SYSTEM_FPS = 0
val FPS = 1 val FPS = 1
val FRAMETIME = 2 val FRAMETIME = 2
@ -238,6 +238,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback, Choreographer.Fram
} }
} }
perfStatsUpdateHandler.post(perfStatsUpdater!!) perfStatsUpdateHandler.post(perfStatsUpdater!!)
binding.showFpsText.text = resources.getString(R.string.emulation_game_loading)
binding.showFpsText.visibility = View.VISIBLE binding.showFpsText.visibility = View.VISIBLE
} else { } else {
if (perfStatsUpdater != null) { if (perfStatsUpdater != null) {

View File

@ -46,7 +46,7 @@ object EmulationMenuSettings {
.apply() .apply()
} }
var showFps: Boolean var showFps: Boolean
get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, false) get() = preferences.getBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, true)
set(value) { set(value) {
preferences.edit() preferences.edit()
.putBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, value) .putBoolean(Settings.PREF_MENU_SETTINGS_SHOW_FPS, value)

View File

@ -20,6 +20,14 @@
android:focusable="false" android:focusable="false"
android:focusableInTouchMode="false" /> android:focusableInTouchMode="false" />
<!-- This is the onscreen input overlay -->
<org.yuzu.yuzu_emu.overlay.InputOverlay
android:id="@+id/surface_input_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true" />
<TextView <TextView
android:id="@+id/show_fps_text" android:id="@+id/show_fps_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -33,14 +41,6 @@
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="12sp" /> android:textSize="12sp" />
<!-- This is the onscreen input overlay -->
<org.yuzu.yuzu_emu.overlay.InputOverlay
android:id="@+id/surface_input_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true" />
<Button <Button
style="@style/Widget.Material3.Button.ElevatedButton" style="@style/Widget.Material3.Button.ElevatedButton"
android:id="@+id/done_control_config" android:id="@+id/done_control_config"

View File

@ -91,6 +91,7 @@
<string name="emulation_pause">Pause Emulation</string> <string name="emulation_pause">Pause Emulation</string>
<string name="emulation_unpause">Unpause Emulation</string> <string name="emulation_unpause">Unpause Emulation</string>
<string name="emulation_input_overlay">Input Overlay</string> <string name="emulation_input_overlay">Input Overlay</string>
<string name="emulation_game_loading">Game loading…</string>
<string name="load_settings">Loading Settings…</string> <string name="load_settings">Loading Settings…</string>