mirror of https://github.com/libsdl-org/SDL
Remove SDL_SCALEMODE_BEST
Fixes https://github.com/libsdl-org/SDL/issues/10619
This commit is contained in:
parent
4bbf0d45fd
commit
b602c449e5
|
@ -2263,11 +2263,6 @@ symbol SDL_ScaleModeLinear;
|
||||||
- SDL_ScaleModeLinear
|
- SDL_ScaleModeLinear
|
||||||
+ SDL_SCALEMODE_LINEAR
|
+ SDL_SCALEMODE_LINEAR
|
||||||
@@
|
@@
|
||||||
symbol SDL_ScaleModeBest;
|
|
||||||
@@
|
|
||||||
- SDL_ScaleModeBest
|
|
||||||
+ SDL_SCALEMODE_BEST
|
|
||||||
@@
|
|
||||||
@@
|
@@
|
||||||
- SDL_RenderCopy
|
- SDL_RenderCopy
|
||||||
+ SDL_RenderTexture
|
+ SDL_RenderTexture
|
||||||
|
|
|
@ -1407,7 +1407,6 @@ The following enums have been renamed:
|
||||||
* SDL_RendererFlip => SDL_FlipMode - moved to SDL_surface.h
|
* SDL_RendererFlip => SDL_FlipMode - moved to SDL_surface.h
|
||||||
|
|
||||||
The following symbols have been renamed:
|
The following symbols have been renamed:
|
||||||
* SDL_ScaleModeBest => SDL_SCALEMODE_BEST
|
|
||||||
* SDL_ScaleModeLinear => SDL_SCALEMODE_LINEAR
|
* SDL_ScaleModeLinear => SDL_SCALEMODE_LINEAR
|
||||||
* SDL_ScaleModeNearest => SDL_SCALEMODE_NEAREST
|
* SDL_ScaleModeNearest => SDL_SCALEMODE_NEAREST
|
||||||
|
|
||||||
|
@ -1416,6 +1415,7 @@ The following symbols have been removed:
|
||||||
* SDL_RENDERER_PRESENTVSYNC - replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER during renderer creation and SDL_PROP_RENDERER_VSYNC_NUMBER after renderer creation
|
* SDL_RENDERER_PRESENTVSYNC - replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER during renderer creation and SDL_PROP_RENDERER_VSYNC_NUMBER after renderer creation
|
||||||
* SDL_RENDERER_SOFTWARE - you can check whether the name of the renderer is `SDL_SOFTWARE_RENDERER`
|
* SDL_RENDERER_SOFTWARE - you can check whether the name of the renderer is `SDL_SOFTWARE_RENDERER`
|
||||||
* SDL_RENDERER_TARGETTEXTURE - all renderers support target texture functionality
|
* SDL_RENDERER_TARGETTEXTURE - all renderers support target texture functionality
|
||||||
|
* SDL_ScaleModeBest = use SDL_SCALEMODE_LINEAR instead
|
||||||
|
|
||||||
## SDL_rwops.h
|
## SDL_rwops.h
|
||||||
|
|
||||||
|
|
|
@ -523,7 +523,6 @@
|
||||||
#define SDL_RenderSetVSync SDL_SetRenderVSync
|
#define SDL_RenderSetVSync SDL_SetRenderVSync
|
||||||
#define SDL_RenderSetViewport SDL_SetRenderViewport
|
#define SDL_RenderSetViewport SDL_SetRenderViewport
|
||||||
#define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow
|
#define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow
|
||||||
#define SDL_ScaleModeBest SDL_SCALEMODE_BEST
|
|
||||||
#define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR
|
#define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR
|
||||||
#define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST
|
#define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST
|
||||||
|
|
||||||
|
@ -1144,7 +1143,6 @@
|
||||||
#define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync
|
#define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync
|
||||||
#define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport
|
#define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport
|
||||||
#define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow
|
#define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow
|
||||||
#define SDL_ScaleModeBest SDL_ScaleModeBest_renamed_SDL_SCALEMODE_BEST
|
|
||||||
#define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR
|
#define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR
|
||||||
#define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST
|
#define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,7 @@ typedef Uint32 SDL_SurfaceFlags;
|
||||||
typedef enum SDL_ScaleMode
|
typedef enum SDL_ScaleMode
|
||||||
{
|
{
|
||||||
SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
|
SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
|
||||||
SDL_SCALEMODE_LINEAR, /**< linear filtering */
|
SDL_SCALEMODE_LINEAR /**< linear filtering */
|
||||||
SDL_SCALEMODE_BEST /**< anisotropic filtering */
|
|
||||||
} SDL_ScaleMode;
|
} SDL_ScaleMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1135,10 +1135,6 @@ static bool InitSamplers(GPU_RenderData *data)
|
||||||
{ SDL_TEXTURE_ADDRESS_CLAMP, SDL_SCALEMODE_LINEAR },
|
{ SDL_TEXTURE_ADDRESS_CLAMP, SDL_SCALEMODE_LINEAR },
|
||||||
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_LINEAR, SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, 0 },
|
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_LINEAR, SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, 0 },
|
||||||
},
|
},
|
||||||
{
|
|
||||||
{ SDL_TEXTURE_ADDRESS_CLAMP, SDL_SCALEMODE_BEST },
|
|
||||||
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_LINEAR, SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, 16 },
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
{ SDL_TEXTURE_ADDRESS_WRAP, SDL_SCALEMODE_NEAREST },
|
{ SDL_TEXTURE_ADDRESS_WRAP, SDL_SCALEMODE_NEAREST },
|
||||||
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_NEAREST, SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, 0 },
|
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_NEAREST, SDL_GPU_SAMPLERMIPMAPMODE_NEAREST, 0 },
|
||||||
|
@ -1147,10 +1143,6 @@ static bool InitSamplers(GPU_RenderData *data)
|
||||||
{ SDL_TEXTURE_ADDRESS_WRAP, SDL_SCALEMODE_LINEAR },
|
{ SDL_TEXTURE_ADDRESS_WRAP, SDL_SCALEMODE_LINEAR },
|
||||||
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_LINEAR, SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, 0 },
|
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_LINEAR, SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, 0 },
|
||||||
},
|
},
|
||||||
{
|
|
||||||
{ SDL_TEXTURE_ADDRESS_WRAP, SDL_SCALEMODE_BEST },
|
|
||||||
{ SDL_GPU_SAMPLERADDRESSMODE_REPEAT, SDL_GPU_FILTER_LINEAR, SDL_GPU_SAMPLERMIPMAPMODE_LINEAR, 16 },
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (Uint32 i = 0; i < SDL_arraysize(configs); ++i) {
|
for (Uint32 i = 0; i < SDL_arraysize(configs); ++i) {
|
||||||
|
|
|
@ -526,10 +526,6 @@ int SDLTest_CommonArg(SDLTest_CommonState *state, int index)
|
||||||
state->logical_scale_mode = SDL_SCALEMODE_LINEAR;
|
state->logical_scale_mode = SDL_SCALEMODE_LINEAR;
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
if (SDL_strcasecmp(argv[index], "best") == 0) {
|
|
||||||
state->logical_scale_mode = SDL_SCALEMODE_BEST;
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (SDL_strcasecmp(argv[index], "--scale") == 0) {
|
if (SDL_strcasecmp(argv[index], "--scale") == 0) {
|
||||||
|
@ -1049,9 +1045,6 @@ static void SDLTest_PrintScaleMode(char *text, size_t maxlen, SDL_ScaleMode scal
|
||||||
case SDL_SCALEMODE_LINEAR:
|
case SDL_SCALEMODE_LINEAR:
|
||||||
SDL_snprintfcat(text, maxlen, "LINEAR");
|
SDL_snprintfcat(text, maxlen, "LINEAR");
|
||||||
break;
|
break;
|
||||||
case SDL_SCALEMODE_BEST:
|
|
||||||
SDL_snprintfcat(text, maxlen, "BEST");
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
SDL_snprintfcat(text, maxlen, "0x%8.8x", scale_mode);
|
SDL_snprintfcat(text, maxlen, "0x%8.8x", scale_mode);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -80,7 +80,7 @@ bool SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scaleMode != SDL_SCALEMODE_NEAREST && scaleMode != SDL_SCALEMODE_LINEAR && scaleMode != SDL_SCALEMODE_BEST) {
|
if (scaleMode != SDL_SCALEMODE_NEAREST && scaleMode != SDL_SCALEMODE_LINEAR) {
|
||||||
return SDL_InvalidParamError("scaleMode");
|
return SDL_InvalidParamError("scaleMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1093,8 +1093,7 @@ SDL_bool SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Su
|
||||||
} else if ((src->flags & SDL_SURFACE_LOCKED) || (dst->flags & SDL_SURFACE_LOCKED)) {
|
} else if ((src->flags & SDL_SURFACE_LOCKED) || (dst->flags & SDL_SURFACE_LOCKED)) {
|
||||||
return SDL_SetError("Surfaces must not be locked during blit");
|
return SDL_SetError("Surfaces must not be locked during blit");
|
||||||
} else if (scaleMode != SDL_SCALEMODE_NEAREST &&
|
} else if (scaleMode != SDL_SCALEMODE_NEAREST &&
|
||||||
scaleMode != SDL_SCALEMODE_LINEAR &&
|
scaleMode != SDL_SCALEMODE_LINEAR) {
|
||||||
scaleMode != SDL_SCALEMODE_BEST) {
|
|
||||||
return SDL_InvalidParamError("scaleMode");
|
return SDL_InvalidParamError("scaleMode");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue