Переглянути джерело

Remove SDL_SCALEMODE_BEST

Fixes https://github.com/libsdl-org/SDL/issues/10619
Sam Lantinga 7 місяців тому
батько
коміт
b602c449e5

+ 0 - 5
build-scripts/SDL_migration.cocci

@@ -2263,11 +2263,6 @@ symbol SDL_ScaleModeLinear;
 - SDL_ScaleModeLinear
 + SDL_SCALEMODE_LINEAR
 @@
-symbol SDL_ScaleModeBest;
-@@
-- SDL_ScaleModeBest
-+ SDL_SCALEMODE_BEST
-@@
 @@
 - SDL_RenderCopy
 + SDL_RenderTexture

+ 1 - 1
docs/README-migration.md

@@ -1407,7 +1407,6 @@ The following enums have been renamed:
 * SDL_RendererFlip => SDL_FlipMode - moved to SDL_surface.h
 
 The following symbols have been renamed:
-* SDL_ScaleModeBest => SDL_SCALEMODE_BEST
 * SDL_ScaleModeLinear => SDL_SCALEMODE_LINEAR
 * 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_SOFTWARE - you can check whether the name of the renderer is `SDL_SOFTWARE_RENDERER`
 * SDL_RENDERER_TARGETTEXTURE - all renderers support target texture functionality
+* SDL_ScaleModeBest = use SDL_SCALEMODE_LINEAR instead
 
 ## SDL_rwops.h
 

+ 0 - 2
include/SDL3/SDL_oldnames.h

@@ -523,7 +523,6 @@
 #define SDL_RenderSetVSync SDL_SetRenderVSync
 #define SDL_RenderSetViewport SDL_SetRenderViewport
 #define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow
-#define SDL_ScaleModeBest SDL_SCALEMODE_BEST
 #define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR
 #define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST
 
@@ -1144,7 +1143,6 @@
 #define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync
 #define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport
 #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_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST
 

+ 1 - 2
include/SDL3/SDL_surface.h

@@ -71,8 +71,7 @@ typedef Uint32 SDL_SurfaceFlags;
 typedef enum SDL_ScaleMode
 {
     SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
-    SDL_SCALEMODE_LINEAR,  /**< linear filtering */
-    SDL_SCALEMODE_BEST     /**< anisotropic filtering */
+    SDL_SCALEMODE_LINEAR   /**< linear filtering */
 } SDL_ScaleMode;
 
 /**

+ 0 - 8
src/render/sdlgpu/SDL_render_gpu.c

@@ -1135,10 +1135,6 @@ static bool InitSamplers(GPU_RenderData *data)
             { SDL_TEXTURE_ADDRESS_CLAMP, SDL_SCALEMODE_LINEAR },
             { 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_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_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) {

+ 0 - 7
src/test/SDL_test_common.c

@@ -526,10 +526,6 @@ int SDLTest_CommonArg(SDLTest_CommonState *state, int index)
                 state->logical_scale_mode = SDL_SCALEMODE_LINEAR;
                 return 2;
             }
-            if (SDL_strcasecmp(argv[index], "best") == 0) {
-                state->logical_scale_mode = SDL_SCALEMODE_BEST;
-                return 2;
-            }
             return -1;
         }
         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:
         SDL_snprintfcat(text, maxlen, "LINEAR");
         break;
-    case SDL_SCALEMODE_BEST:
-        SDL_snprintfcat(text, maxlen, "BEST");
-        break;
     default:
         SDL_snprintfcat(text, maxlen, "0x%8.8x", scale_mode);
         break;

+ 1 - 1
src/video/SDL_stretch.c

@@ -80,7 +80,7 @@ bool SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst
         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");
     }
 

+ 1 - 2
src/video/SDL_surface.c

@@ -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)) {
         return SDL_SetError("Surfaces must not be locked during blit");
     } else if (scaleMode != SDL_SCALEMODE_NEAREST &&
-               scaleMode != SDL_SCALEMODE_LINEAR &&
-               scaleMode != SDL_SCALEMODE_BEST) {
+               scaleMode != SDL_SCALEMODE_LINEAR) {
         return SDL_InvalidParamError("scaleMode");
     }