mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +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() },
|
||||
onHudExport = { exportHudDiagnostics() },
|
||||
onUpscaler = { m ->
|
||||
SessionPrefs.setUpscaler(this@SessionActivity, m)
|
||||
val target = effectsEditorTarget ?: screenEffectsTarget
|
||||
val activeProfileId =
|
||||
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
|
||||
upscaler = activeUpscaler
|
||||
}
|
||||
activeEffects.push(activeUpscaler)
|
||||
} else {
|
||||
val profileId = screenEffectsProfileIdForTarget(target)
|
||||
SessionPrefs.setScreenEffectsUpscaler(this@SessionActivity, profileId, m)
|
||||
|
||||
WaylandCompositor.nativeSetUpscaler(activeUpscaler)
|
||||
WaylandCompositor.nativeSetLookName(
|
||||
ScreenEffectLooks.match(activeEffects, activeUpscaler)?.name
|
||||
)
|
||||
activeEffects.push(activeUpscaler)
|
||||
if (target == screenEffectsTarget) {
|
||||
upscaler = m
|
||||
if (screenEffectsUpscalerTargetAppliesToLiveOutput(target)) {
|
||||
val liveProfileId =
|
||||
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 ->
|
||||
val target = effectsEditorTarget ?: screenEffectsTarget
|
||||
|
||||
@@ -1537,8 +1537,11 @@ class SessionService : Service() {
|
||||
return
|
||||
}
|
||||
val accepted = gameId!!
|
||||
pendingSteamPreviousGameId = SessionState.gameId
|
||||
if (pendingSteamGameId != null) Log.i(TAG, "replacing a queued game launch with $accepted")
|
||||
if (pendingSteamGameId == null) {
|
||||
pendingSteamPreviousGameId = SessionState.gameId
|
||||
} else {
|
||||
Log.i(TAG, "replacing queued game ${pendingSteamGameId} with $accepted")
|
||||
}
|
||||
pendingSteamGameExitWatchToken = ++gameExitWatchToken
|
||||
SessionState.gameId = accepted
|
||||
val effectsProfileId = SessionPrefs.screenEffectsProfileId(MODE_STEAM, accepted, null)
|
||||
|
||||
Reference in new issue
Block a user