summaryrefslogtreecommitdiff
path: root/Source/3rdParty/SDL2/src/render/software
diff options
context:
space:
mode:
Diffstat (limited to 'Source/3rdParty/SDL2/src/render/software')
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_blendfillrect.h6
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_blendline.h6
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_blendpoint.h6
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_drawline.h6
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_drawpoint.h6
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_render_sw.c19
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_render_sw_c.h5
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_rotate.c10
-rw-r--r--Source/3rdParty/SDL2/src/render/software/SDL_rotate.h4
9 files changed, 52 insertions, 16 deletions
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_blendfillrect.h b/Source/3rdParty/SDL2/src/render/software/SDL_blendfillrect.h
index 262210f..3cac834 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_blendfillrect.h
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_blendfillrect.h
@@ -18,10 +18,16 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
+
+#ifndef SDL_blendfillrect_h_
+#define SDL_blendfillrect_h_
+
#include "../../SDL_internal.h"
extern int SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern int SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+#endif /* SDL_blendfillrect_h_ */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_blendline.h b/Source/3rdParty/SDL2/src/render/software/SDL_blendline.h
index 82072cb..a48a498 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_blendline.h
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_blendline.h
@@ -18,10 +18,16 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
+
+#ifndef SDL_blendline_h_
+#define SDL_blendline_h_
+
#include "../../SDL_internal.h"
extern int SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern int SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+#endif /* SDL_blendline_h_ */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_blendpoint.h b/Source/3rdParty/SDL2/src/render/software/SDL_blendpoint.h
index dd9e49c..188557c 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_blendpoint.h
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_blendpoint.h
@@ -18,10 +18,16 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
+
+#ifndef SDL_blendpoint_h_
+#define SDL_blendpoint_h_
+
#include "../../SDL_internal.h"
extern int SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
extern int SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
+#endif /* SDL_blendpoint_h_ */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_drawline.h b/Source/3rdParty/SDL2/src/render/software/SDL_drawline.h
index 9395d50..4e8e2bd 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_drawline.h
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_drawline.h
@@ -18,10 +18,16 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
+
+#ifndef SDL_drawline_h_
+#define SDL_drawline_h_
+
#include "../../SDL_internal.h"
extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
+#endif /* SDL_drawline_h_ */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_drawpoint.h b/Source/3rdParty/SDL2/src/render/software/SDL_drawpoint.h
index c366700..454774d 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_drawpoint.h
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_drawpoint.h
@@ -18,10 +18,16 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
+
+#ifndef SDL_drawpoint_h_
+#define SDL_drawpoint_h_
+
#include "../../SDL_internal.h"
extern int SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color);
extern int SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
+#endif /* SDL_drawpoint_h_ */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_render_sw.c b/Source/3rdParty/SDL2/src/render/software/SDL_render_sw.c
index 89e54b8..709dfe8 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_render_sw.c
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_render_sw.c
@@ -588,18 +588,6 @@ SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
}
static int
-GetScaleQuality(void)
-{
- const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
-
- if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
- return 0;
- } else {
- return 1;
- }
-}
-
-static int
SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcrect, const SDL_FRect * dstrect,
const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip)
@@ -669,6 +657,11 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
blitRequired = SDL_TRUE;
}
+ /* srcrect is not selecting the whole src surface, so cropping is needed */
+ if (!(srcrect->w == src->w && srcrect->h == src->h && srcrect->x == 0 && srcrect->y == 0)) {
+ blitRequired = SDL_TRUE;
+ }
+
/* The color and alpha modulation has to be applied before the rotation when using the NONE and MOD blend modes. */
if ((blendmode == SDL_BLENDMODE_NONE || blendmode == SDL_BLENDMODE_MOD) && (alphaMod & rMod & gMod & bMod) != 255) {
applyModulation = SDL_TRUE;
@@ -717,7 +710,7 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Texture * texture,
if (!retval) {
SDLgfx_rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, angle, &dstwidth, &dstheight, &cangle, &sangle);
- src_rotated = SDLgfx_rotateSurface(src_clone, angle, dstwidth/2, dstheight/2, GetScaleQuality(), flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle);
+ src_rotated = SDLgfx_rotateSurface(src_clone, angle, dstwidth/2, dstheight/2, (texture->scaleMode == SDL_ScaleModeNearest) ? 0 : 1, flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL, dstwidth, dstheight, cangle, sangle);
if (src_rotated == NULL) {
retval = -1;
}
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_render_sw_c.h b/Source/3rdParty/SDL2/src/render/software/SDL_render_sw_c.h
index 8f065de..f228517 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_render_sw_c.h
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_render_sw_c.h
@@ -19,6 +19,11 @@
3. This notice may not be removed or altered from any source distribution.
*/
+#ifndef SDL_render_sw_c_h_
+#define SDL_render_sw_c_h_
+
extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface);
+#endif /* SDL_render_sw_c_h_ */
+
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_rotate.c b/Source/3rdParty/SDL2/src/render/software/SDL_rotate.c
index 4476204..09e099c 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_rotate.c
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_rotate.c
@@ -83,7 +83,9 @@ static Uint32
_colorkey(SDL_Surface *src)
{
Uint32 key = 0;
- SDL_GetColorKey(src, &key);
+ if (SDL_HasColorKey(src)) {
+ SDL_GetColorKey(src, &key);
+ }
return key;
}
@@ -424,8 +426,10 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery,
if (src == NULL)
return NULL;
- if (SDL_GetColorKey(src, &colorkey) == 0) {
- colorKeyAvailable = SDL_TRUE;
+ if (SDL_HasColorKey(src)) {
+ if (SDL_GetColorKey(src, &colorkey) == 0) {
+ colorKeyAvailable = SDL_TRUE;
+ }
}
/* This function requires a 32-bit surface or 8-bit surface with a colorkey */
diff --git a/Source/3rdParty/SDL2/src/render/software/SDL_rotate.h b/Source/3rdParty/SDL2/src/render/software/SDL_rotate.h
index 2bf2ea8..54c0927 100644
--- a/Source/3rdParty/SDL2/src/render/software/SDL_rotate.h
+++ b/Source/3rdParty/SDL2/src/render/software/SDL_rotate.h
@@ -19,6 +19,9 @@
3. This notice may not be removed or altered from any source distribution.
*/
+#ifndef SDL_rotate_h_
+#define SDL_rotate_h_
+
#ifndef MIN
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#endif
@@ -26,3 +29,4 @@
extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle);
extern void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle);
+#endif /* SDL_rotate_h_ */