Feat: Better SMAA, make nearest the default filter and change the default store order (#2760)

* Add SMAA screen effect option

* Atualizar o smaa_frag.h

* Atualizar o smaa.frag

* Fix SMAA endpoint and crossing-edge area weights

* Atualizar o smaa.frag

* Fix SMAA diagonal edge blending

* Regenerate SMAA fragment shader header

* Fix SMAA diagonal fallback detection

* Add anti-aliasing translations

* Fix Korean anti-aliasing label

* Change default store tab order

* Put Nearest scaling before Linear

* Make Nearest the default scaling filter

* Improve SMAA diagonal blend weighting

* Improve SMAA diagonal detection and corner protection

* Reduce false positive SMAA diagonal blending

* test: update unknown upscaler fallback expectation
This commit is contained in:
LunaDL authored and GitHub committed 2026-11-18 00:26:32 -05:00
1 parent 8953eea9e0
commit d40c962b37
6 files changed
+429 -410

No files matched your search

@@ -306,6 +306,13 @@ object SessionPrefs {
prefs(context).edit().putStringSet("libraryFavorites", keys.toSet()).apply()
}
fun storesTabOrderCustomized(context: Context): Boolean =
prefs(context).getBoolean("storesTabOrderCustomized", false)
fun setStoresTabOrderCustomized(context: Context, customized: Boolean) {
prefs(context).edit().putBoolean("storesTabOrderCustomized", customized).apply()
}
fun storesTabOrder(context: Context): List<String> = idList(prefs(context).getString("storesTabOrder", null))
fun setStoresTabOrder(context: Context, order: List<String>) {
@@ -1530,7 +1537,7 @@ object SessionPrefs {
}
val upscalerChoices = listOf(
0 to "Linear", 2 to "Nearest", 4 to "AMD FSR 1", 3 to "Snapdragon GSR",
2 to "Nearest", 0 to "Linear", 4 to "AMD FSR 1", 3 to "Snapdragon GSR",
8 to "Snapdragon GSR (quality)", 7 to "NVIDIA NIS", 6 to "Sharpen only",
)
@@ -1545,12 +1552,12 @@ object SessionPrefs {
fun canonicalUpscaler(mode: Int): Int = when (mode) {
1 -> 0
5 -> 4
else -> mode.takeIf { m -> upscalerChoices.any { it.first == m } } ?: 0
else -> mode.takeIf { m -> upscalerChoices.any { it.first == m } } ?: 2
}
fun upscalerHasSharpness(mode: Int): Boolean = canonicalUpscaler(mode) in 3..8
fun upscaler(context: Context): Int = canonicalUpscaler(prefs(context).getInt("upscaler", 0))
fun upscaler(context: Context): Int = canonicalUpscaler(prefs(context).getInt("upscaler", 2))
fun setUpscaler(context: Context, mode: Int) {
prefs(context).edit().putInt("upscaler", canonicalUpscaler(mode)).apply()
@@ -1,16 +1,16 @@
package com.droiddeck.launcher.stores
enum class Store(val id: String, val label: String, val shortLabel: String) {
GOG("gog", "GOG", "GOG"),
EPIC("epic", "Epic Games", "Epic"),
AMAZON("amazon", "Amazon Games", "Amazon"),
XBOX("xbox", "Xbox", "Xbox"),
ITCH("itch", "Itch.io", "Itch.io"),
GAMEJOLT("gamejolt", "Game Jolt", "Game Jolt"),
BATTLENET("battlenet", "Battle.net", "Battle.net"),
UBISOFT("ubisoft", "Ubisoft Connect", "Ubisoft"),
EA("ea", "EA", "EA"),
ROCKSTAR("rockstar", "Rockstar Games", "Rockstar");
XBOX("xbox", "Xbox", "Xbox"),
GOG("gog", "GOG", "GOG"),
ROCKSTAR("rockstar", "Rockstar Games", "Rockstar"),
ITCH("itch", "Itch.io", "Itch.io"),
UBISOFT("ubisoft", "Ubisoft Connect", "Ubisoft"),
AMAZON("amazon", "Amazon Games", "Amazon"),
BATTLENET("battlenet", "Battle.net", "Battle.net"),
GAMEJOLT("gamejolt", "Game Jolt", "Game Jolt");
val folder: String get() = if (this == ITCH) "itch" else shortLabel
@@ -155,22 +155,35 @@ internal fun StoresPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier
val padH = if (narrow) 14.dp else 22.dp
val tabs = remember {
androidx.compose.runtime.mutableStateListOf<StoreTab>().apply {
val savedOrder = SessionPrefs.storesTabOrder(ctx)
if (!SessionPrefs.storesTabOrderCustomized(ctx)) {
val legacyOrder = listOf(
"gog", "epic", "amazon", "xbox", "itch",
"gamejolt", "battlenet", "ubisoft", "ea", "rockstar"
)
if (savedOrder.isNotEmpty() && savedOrder != legacyOrder) {
SessionPrefs.setStoresTabOrderCustomized(ctx, true)
} else {
SessionPrefs.setStoresTabOrder(ctx, Store.entries.map { it.id })
}
}
addAll(arrangeStoreTabs(SessionPrefs.storesTabOrder(ctx), SessionPrefs.storesTabHidden(ctx)))
}
}
var chip by rememberSaveable { mutableStateOf(tabs.firstOrNull { it.shown }?.store?.id ?: Store.GOG.id) }
var arranging by remember { mutableStateOf(false) }
val shownStores = tabs.filter { it.shown }.map { it.store }
fun commitTabs() {
fun commitTabs(markCustomized: Boolean = false) {
SessionPrefs.setStoresTabOrder(ctx, tabs.map { it.store.id })
SessionPrefs.setStoresTabHidden(ctx, tabs.filterNot { it.shown }.map { it.store.id }.toSet())
if (markCustomized) SessionPrefs.setStoresTabOrderCustomized(ctx, true)
}
fun shiftTab(store: Store, delta: Int) {
val from = tabs.indexOfFirst { it.store == store }
val to = from + delta
if (from < 0 || to !in tabs.indices) return
tabs.add(to, tabs.removeAt(from))
commitTabs()
commitTabs(markCustomized = true)
}
fun moveTab(store: Store, to: Int) {
val from = tabs.indexOfFirst { it.store == store }
@@ -178,7 +191,7 @@ internal fun StoresPage(s: FrontEndState, a: FrontEndActions, modifier: Modifier
val target = to.coerceIn(0, tabs.lastIndex)
if (target == from) return
tabs.add(target, tabs.removeAt(from))
commitTabs()
commitTabs(markCustomized = true)
}
fun toggleTab(store: Store) {
val i = tabs.indexOfFirst { it.store == store }