Mercurial > sdl-ios-xcode
diff src/video/SDL_drawline.c @ 2901:133601e3b255
Added RenderPiont() API
Merged the drawing tests into a single test program
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 21 Dec 2008 17:39:41 +0000 |
parents | 3a9636c83849 |
children | 3da0bb421d83 |
line wrap: on
line diff
--- a/src/video/SDL_drawline.c Sun Dec 21 08:59:56 2008 +0000 +++ b/src/video/SDL_drawline.c Sun Dec 21 17:39:41 2008 +0000 @@ -23,13 +23,8 @@ #include "SDL_draw.h" -#define SETPIXEL(x, y, type, bpp, color) \ - *(type *)(dst->pixels + y * dst->pitch + x * bpp) = (type) color -#define SETPIXEL1(x, y) SETPIXEL(x, y, Uint8, 1, color); -#define SETPIXEL2(x, y) SETPIXEL(x, y, Uint16, 2, color); -#define SETPIXEL4(x, y) SETPIXEL(x, y, Uint32, 4, color); - +int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color) { /* This function doesn't work on surfaces < 8 bpp */ @@ -47,16 +42,16 @@ switch (dst->format->BytesPerPixel) { case 1: - DRAWLINE(x1, y1, x2, y2, SETPIXEL1); + DRAWLINE(x1, y1, x2, y2, DRAW_FASTSETPIXEL1); break; case 2: - DRAWLINE(x1, y1, x2, y2, SETPIXEL2); + DRAWLINE(x1, y1, x2, y2, DRAW_FASTSETPIXEL2); break; case 3: SDL_Unsupported(); return -1; case 4: - DRAWLINE(x1, y1, x2, y2, SETPIXEL4); + DRAWLINE(x1, y1, x2, y2, DRAW_FASTSETPIXEL4); break; } return 0;