Merge SDL-ryan-batching-renderer branch to default.

This commit is contained in:
Ryan C. Gordon
2018-10-31 15:03:41 -04:00
215 changed files with 5146 additions and 2712 deletions

View File

@@ -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: */

View File

@@ -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: */

View File

@@ -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: */

View File

@@ -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: */

View File

@@ -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: */

View File

@@ -377,6 +377,11 @@ SW_RenderCopyEx(SDL_Renderer * renderer, SDL_Surface *surface, SDL_Texture * tex
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;

View File

@@ -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: */

View File

@@ -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 */

View File

@@ -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_ */