Added SDL_DrawRect(), SDL_DrawRects(), SDL_BlendRect() and SDL_BlendRects()

Fixed line drawing so when blending a sequence of lines there are no overlapping pixels drawn.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404344
This commit is contained in:
Sam Lantinga 2009-12-18 07:41:59 +00:00
parent e4c73114dc
commit 2b04928c0e
6 changed files with 165 additions and 442 deletions

View file

@ -203,11 +203,6 @@ SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect,
return -1;
}
if (blendMode < SDL_BLENDMODE_BLEND) {
Uint32 color = SDL_MapRGBA(dst->format, r, g, b, a);
return SDL_FillRect(dst, rect, color);
}
/* This function doesn't work on surfaces < 8 bpp */
if (dst->format->BitsPerPixel < 8) {
SDL_SetError("SDL_BlendFillRect(): Unsupported surface format");
@ -281,11 +276,6 @@ SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect ** rects, int count,
return -1;
}
if (blendMode < SDL_BLENDMODE_BLEND) {
Uint32 color = SDL_MapRGBA(dst->format, r, g, b, a);
return SDL_FillRects(dst, rects, color);
}
/* This function doesn't work on surfaces < 8 bpp */
if (dst->format->BitsPerPixel < 8) {
SDL_SetError("SDL_BlendFillRects(): Unsupported surface format");