From 1aa9c2d564a4c345cc5ca6a3afd1f322d2427e6a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 23 Aug 2024 15:18:55 +1000 Subject: [PATCH] GameDatabase: Add DisableSpriteTextureFiltering trait --- src/core/game_database.cpp | 12 ++++++++++++ src/core/game_database.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/core/game_database.cpp b/src/core/game_database.cpp index 10a978179..5da98803a 100644 --- a/src/core/game_database.cpp +++ b/src/core/game_database.cpp @@ -72,6 +72,7 @@ static constexpr const std::array(GameDatabase::Tr "DisableTrueColor", "DisableUpscaling", "DisableTextureFiltering", + "DisableSpriteTextureFiltering", "DisableScaledDithering", "DisableForceNTSCTimings", "DisableWidescreen", @@ -101,6 +102,7 @@ static constexpr const std::array(GameDatabase::Tr TRANSLATE_NOOP("GameDatabase", "Disable True Color"), TRANSLATE_NOOP("GameDatabase", "Disable Upscaling"), TRANSLATE_NOOP("GameDatabase", "Disable Texture Filtering"), + TRANSLATE_NOOP("GameDatabase", "Disable Sprite Texture Filtering"), TRANSLATE_NOOP("GameDatabase", "Disable Scaled Dithering"), TRANSLATE_NOOP("GameDatabase", "Disable Force NTSC Timings"), TRANSLATE_NOOP("GameDatabase", "Disable Widescreen"), @@ -561,6 +563,16 @@ void GameDatabase::Entry::ApplySettings(Settings& settings, bool display_osd_mes settings.gpu_sprite_texture_filter = GPUTextureFilter::Nearest; } + if (HasTrait(Trait::DisableSpriteTextureFiltering)) + { + if (display_osd_messages && g_settings.gpu_sprite_texture_filter != GPUTextureFilter::Nearest) + { + APPEND_MESSAGE(TRANSLATE_SV("GameDatabase", "Sprite texture filtering disabled.")); + } + + settings.gpu_sprite_texture_filter = GPUTextureFilter::Nearest; + } + if (HasTrait(Trait::DisableScaledDithering)) { if (display_osd_messages && settings.gpu_scaled_dithering) diff --git a/src/core/game_database.h b/src/core/game_database.h index b0661b2a1..768817351 100644 --- a/src/core/game_database.h +++ b/src/core/game_database.h @@ -38,6 +38,7 @@ enum class Trait : u32 DisableTrueColor, DisableUpscaling, DisableTextureFiltering, + DisableSpriteTextureFiltering, DisableScaledDithering, DisableForceNTSCTimings, DisableWidescreen,