Fix regression: Linear filter persistence

This fixes #1013 by axing the use of SDL_HINT_RENDER_SCALE_QUALITY and
instead using SDL_SetTextureScaleMode.

The hint is unwieldy to use, and since #923, has resulted in a
regression where starting the game in filtered mode then switching to
nearest results in scaled textures still being filtered.

The proper solution is to use SDL_SetTextureScaleMode on the two
textures that are drawn to the final screen: gameTexture and
tempShakeTexture.
This commit is contained in:
Misa
2023-09-09 20:00:05 -07:00
parent 5467dbe3d8
commit 1bf0d11c9e
2 changed files with 37 additions and 10 deletions

View File

@@ -194,6 +194,16 @@ void Graphics::create_buffers(void)
#undef CREATE_SCROLL_TEXTURE
#undef CREATE_TEXTURE
#undef CREATE_TEXTURE_WITH_DIMENSIONS
SDL_SetTextureScaleMode(
gameTexture,
gameScreen.isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest
);
SDL_SetTextureScaleMode(
tempShakeTexture,
gameScreen.isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest
);
}
void Graphics::destroy_buffers(void)