浏览代码

Re-added SDL_SoftStretch() to the API

This is needed for sdl2-compat, since a blit is not quite equivalent.
Sam Lantinga 6 月之前
父节点
当前提交
a98a4b8a68
共有 4 个文件被更改,包括 26 次插入0 次删除
  1. 23 0
      include/SDL3/SDL_surface.h
  2. 1 0
      src/dynapi/SDL_dynapi.sym
  3. 1 0
      src/dynapi/SDL_dynapi_overrides.h
  4. 1 0
      src/dynapi/SDL_dynapi_procs.h

+ 23 - 0
include/SDL3/SDL_surface.h

@@ -1173,6 +1173,29 @@ extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const S
  */
 extern SDL_DECLSPEC bool SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
 
+/**
+ * Perform a stretched pixel copy from one surface to another.
+ *
+ * \param src the SDL_Surface structure to be copied from.
+ * \param srcrect the SDL_Rect structure representing the rectangle to be
+ *                copied, may not be NULL.
+ * \param dst the SDL_Surface structure that is the blit target.
+ * \param dstrect the SDL_Rect structure representing the target rectangle in
+ *                the destination surface, may not be NULL.
+ * \param scaleMode the SDL_ScaleMode to be used.
+ * \returns true on success or false on failure; call SDL_GetError() for more
+ *          information.
+ *
+ * \threadsafety The same destination surface should not be used from two
+ *               threads at once. It is safe to use the same source surface
+ *               from multiple threads.
+ *
+ * \since This function is available since SDL 3.2.0.
+ *
+ * \sa SDL_BlitSurfaceScaled
+ */
+extern SDL_DECLSPEC bool SDLCALL SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode);
+
 /**
  * Perform a tiled blit to a destination surface, which may be of a different
  * format.

+ 1 - 0
src/dynapi/SDL_dynapi.sym

@@ -1233,6 +1233,7 @@ SDL3_0.0.0 {
     SDL_AudioStreamDevicePaused;
     SDL_ClickTrayEntry;
     SDL_UpdateTrays;
+    SDL_SoftStretch;
     # extra symbols go here (don't modify this line)
   local: *;
 };

+ 1 - 0
src/dynapi/SDL_dynapi_overrides.h

@@ -1258,3 +1258,4 @@
 #define SDL_AudioStreamDevicePaused SDL_AudioStreamDevicePaused_REAL
 #define SDL_ClickTrayEntry SDL_ClickTrayEntry_REAL
 #define SDL_UpdateTrays SDL_UpdateTrays_REAL
+#define SDL_SoftStretch SDL_SoftStretch_REAL

+ 1 - 0
src/dynapi/SDL_dynapi_procs.h

@@ -1266,3 +1266,4 @@ SDL_DYNAPI_PROC(SDL_ThreadState,SDL_GetThreadState,(SDL_Thread *a),(a),return)
 SDL_DYNAPI_PROC(bool,SDL_AudioStreamDevicePaused,(SDL_AudioStream *a),(a),return)
 SDL_DYNAPI_PROC(void,SDL_ClickTrayEntry,(SDL_TrayEntry *a),(a),)
 SDL_DYNAPI_PROC(void,SDL_UpdateTrays,(void),(),)
+SDL_DYNAPI_PROC(bool,SDL_SoftStretch,(SDL_Surface *a,const SDL_Rect *b,SDL_Surface *c,const SDL_Rect *d,SDL_ScaleMode e),(a,b,c,d,e),return)