mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Fixed bug 4134 - Render targets lose scale quality after minimizing a fullscreen window
Olli-Samuli Lehmus If one creates a window with the SDL_WINDOW_FULLSCREEN_DESKTOP flag, and creates a render target with SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"), and afterwards sets SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"), after minimizing the window, the scale quality hint is lost on the render target. Textures however do keep their interpolation modes.
This commit is contained in:
@@ -186,18 +186,6 @@ TextureNextPow2(unsigned int w)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
GetScaleQuality(void)
|
||||
{
|
||||
const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
|
||||
|
||||
if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
|
||||
return GU_NEAREST; /* GU_NEAREST good for tile-map */
|
||||
} else {
|
||||
return GU_LINEAR; /* GU_LINEAR good for scaling */
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
PixelFormatToPSPFMT(Uint32 format)
|
||||
{
|
||||
@@ -514,7 +502,7 @@ void
|
||||
TextureActivate(SDL_Texture * texture)
|
||||
{
|
||||
PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata;
|
||||
int scaleMode = GetScaleQuality();
|
||||
int scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? GU_NEAREST : GU_LINEAR;
|
||||
|
||||
/* Swizzling is useless with small textures. */
|
||||
if (texture->w >= 16 || texture->h >= 16)
|
||||
|
Reference in New Issue
Block a user