Skip to content

Commit

Permalink
GameDatabase: Add DisableSpriteTextureFiltering trait
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Aug 23, 2024
1 parent 3578572 commit 1aa9c2d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/game_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ static constexpr const std::array<const char*, static_cast<u32>(GameDatabase::Tr
"DisableTrueColor",
"DisableUpscaling",
"DisableTextureFiltering",
"DisableSpriteTextureFiltering",
"DisableScaledDithering",
"DisableForceNTSCTimings",
"DisableWidescreen",
Expand Down Expand Up @@ -101,6 +102,7 @@ static constexpr const std::array<const char*, static_cast<u32>(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"),
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/core/game_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ enum class Trait : u32
DisableTrueColor,
DisableUpscaling,
DisableTextureFiltering,
DisableSpriteTextureFiltering,
DisableScaledDithering,
DisableForceNTSCTimings,
DisableWidescreen,
Expand Down

0 comments on commit 1aa9c2d

Please sign in to comment.