mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
feat: cap the frame rate in session for games launched without Steam (#1813)
This commit is contained in:
1 parent
67d391958f
commit
b75060c280
7 files changed
+54
-5
No files matched your search
@@ -247,6 +247,8 @@ class DrawerActions(
|
||||
val onHudReset: () -> Unit = {},
|
||||
val onHudExport: () -> Unit = {},
|
||||
val onFrameGenPick: (FrameGen.Mode) -> Unit,
|
||||
val fpsLimit: Int = 0,
|
||||
val onFpsLimit: (Int) -> Unit = {},
|
||||
val onImportLossless: () -> Unit,
|
||||
val onKeyboard: () -> Unit,
|
||||
val onHardwareKeyboard: () -> Unit,
|
||||
@@ -535,6 +537,7 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
SessionDrawerPage.DISPLAY -> {
|
||||
SettingsGroup(stringResource(R.string.drawer_page_display)) {
|
||||
val fgOpen = host.open == "fg"
|
||||
val offLabel = stringResource(R.string.frame_gen_off)
|
||||
val fgLabel = FrameGen.label(LocalContext.current, a.frameGen)
|
||||
SettingsRow(stringResource(R.string.frame_gen_title), null, highlighted = fgOpen) {
|
||||
Box {
|
||||
@@ -542,6 +545,13 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont
|
||||
FrameGenMenu(host, a.frameGen, a.lossless, a.onFrameGenPick, a.onImportLossless)
|
||||
}
|
||||
}
|
||||
if (a.direct) SliderRow(
|
||||
stringResource(R.string.drawer_frame_limit), stringResource(R.string.drawer_frame_limit_note),
|
||||
a.fpsLimit.takeIf { it > 0 } ?: SessionPrefs.FPS_LIMIT_OFF,
|
||||
SessionPrefs.FPS_LIMIT_OFF..SessionPrefs.FPS_LIMIT_MAX, step = 5,
|
||||
format = { if (it <= SessionPrefs.FPS_LIMIT_OFF) offLabel else it.toString() },
|
||||
modifier = focus.track(page, "fps-limit"),
|
||||
onChange = { a.onFpsLimit(if (it <= SessionPrefs.FPS_LIMIT_OFF) 0 else it) })
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.display_image_scaling)) {
|
||||
ChoiceRow(host, "upscaler", stringResource(R.string.display_filter), null,
|
||||
|
||||
Reference in new issue
Block a user