mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
Fix per-game screen effects and queued launches
This commit is contained in:
1 parent
5f098df52c
commit
effc46675b
2 files changed
+33
-14
No files matched your search
@@ -1388,24 +1388,40 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
|||||||
onHudReset = { hudConfig = DroidDeckHudConfig.reset(this@SessionActivity); hud.applyConfig() },
|
onHudReset = { hudConfig = DroidDeckHudConfig.reset(this@SessionActivity); hud.applyConfig() },
|
||||||
onHudExport = { exportHudDiagnostics() },
|
onHudExport = { exportHudDiagnostics() },
|
||||||
onUpscaler = { m ->
|
onUpscaler = { m ->
|
||||||
SessionPrefs.setUpscaler(this@SessionActivity, m)
|
val target = effectsEditorTarget ?: screenEffectsTarget
|
||||||
val activeProfileId =
|
val activeProfileId =
|
||||||
SessionPrefs.activeScreenEffectsProfileId(this@SessionActivity)
|
SessionPrefs.activeScreenEffectsProfileId(this@SessionActivity)
|
||||||
val activeEffects =
|
|
||||||
SessionPrefs.screenEffects(this@SessionActivity, activeProfileId)
|
|
||||||
val activeUpscaler =
|
|
||||||
SessionPrefs.screenEffectsUpscaler(this@SessionActivity, activeProfileId)
|
|
||||||
|
|
||||||
if ((effectsEditorTarget ?: screenEffectsTarget) == SCREEN_EFFECTS_TARGET_AUTO) {
|
if (target == SCREEN_EFFECTS_TARGET_AUTO &&
|
||||||
|
activeProfileId != effectsEditorProfileId) {
|
||||||
|
Log.w(TAG, "Screen effects profile changed while editing; discarding stale upscaler edit")
|
||||||
|
observedScreenEffectsProfileId = activeProfileId
|
||||||
|
val activeEffects = SessionPrefs.screenEffects(this@SessionActivity, activeProfileId)
|
||||||
|
val activeUpscaler = SessionPrefs.screenEffectsUpscaler(this@SessionActivity, activeProfileId)
|
||||||
effects = activeEffects
|
effects = activeEffects
|
||||||
upscaler = activeUpscaler
|
upscaler = activeUpscaler
|
||||||
}
|
activeEffects.push(activeUpscaler)
|
||||||
|
} else {
|
||||||
|
val profileId = screenEffectsProfileIdForTarget(target)
|
||||||
|
SessionPrefs.setScreenEffectsUpscaler(this@SessionActivity, profileId, m)
|
||||||
|
|
||||||
WaylandCompositor.nativeSetUpscaler(activeUpscaler)
|
if (target == screenEffectsTarget) {
|
||||||
WaylandCompositor.nativeSetLookName(
|
upscaler = m
|
||||||
ScreenEffectLooks.match(activeEffects, activeUpscaler)?.name
|
if (screenEffectsUpscalerTargetAppliesToLiveOutput(target)) {
|
||||||
)
|
val liveProfileId =
|
||||||
activeEffects.push(activeUpscaler)
|
SessionPrefs.activeScreenEffectsProfileId(this@SessionActivity)
|
||||||
|
val liveUpscaler =
|
||||||
|
SessionPrefs.screenEffectsUpscaler(this@SessionActivity, liveProfileId)
|
||||||
|
val liveEffects =
|
||||||
|
SessionPrefs.screenEffects(this@SessionActivity, liveProfileId)
|
||||||
|
WaylandCompositor.nativeSetUpscaler(liveUpscaler)
|
||||||
|
WaylandCompositor.nativeSetLookName(
|
||||||
|
ScreenEffectLooks.match(liveEffects, liveUpscaler)?.name
|
||||||
|
)
|
||||||
|
liveEffects.push(liveUpscaler)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onPresetUpscaler = { m ->
|
onPresetUpscaler = { m ->
|
||||||
val target = effectsEditorTarget ?: screenEffectsTarget
|
val target = effectsEditorTarget ?: screenEffectsTarget
|
||||||
|
|||||||
@@ -1537,8 +1537,11 @@ class SessionService : Service() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
val accepted = gameId!!
|
val accepted = gameId!!
|
||||||
pendingSteamPreviousGameId = SessionState.gameId
|
if (pendingSteamGameId == null) {
|
||||||
if (pendingSteamGameId != null) Log.i(TAG, "replacing a queued game launch with $accepted")
|
pendingSteamPreviousGameId = SessionState.gameId
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "replacing queued game ${pendingSteamGameId} with $accepted")
|
||||||
|
}
|
||||||
pendingSteamGameExitWatchToken = ++gameExitWatchToken
|
pendingSteamGameExitWatchToken = ++gameExitWatchToken
|
||||||
SessionState.gameId = accepted
|
SessionState.gameId = accepted
|
||||||
val effectsProfileId = SessionPrefs.screenEffectsProfileId(MODE_STEAM, accepted, null)
|
val effectsProfileId = SessionPrefs.screenEffectsProfileId(MODE_STEAM, accepted, null)
|
||||||
|
|||||||
Reference in new issue
Block a user