21 #include "../../SDL_internal.h" 23 #if !SDL_RENDER_DISABLED 40 length = draw_end ? (x2-x1+1) : (x2-
x1);
46 length = draw_end ? (x1-x2+1) : (x1-x2);
49 }
else if (x1 == x2) {
51 }
else if (
ABS(x1 - x2) ==
ABS(y1 - y2)) {
64 }
else if (x1 == x2) {
66 }
else if (
ABS(x1 - x2) ==
ABS(y1 - y2)) {
72 if (fmt->
Rmask == 0x7C00) {
76 }
else if (fmt->
Rmask == 0xF800) {
94 }
else if (x1 == x2) {
96 }
else if (
ABS(x1 - x2) ==
ABS(y1 - y2)) {
102 if (fmt->
Rmask == 0x00FF0000) {
147 return SDL_SetError(
"SDL_DrawLine(): Passed NULL destination surface");
152 return SDL_SetError(
"SDL_DrawLine(): Unsupported surface format");
176 return SDL_SetError(
"SDL_DrawLines(): Passed NULL destination surface");
181 return SDL_SetError(
"SDL_DrawLines(): Unsupported surface format");
184 for (i = 1; i <
count; ++
i) {
197 draw_end = (x2 != points[
i].
x || y2 != points[
i].
y);
199 func(dst, x1, y1, x2, y2, color, draw_end);
201 if (points[0].
x != points[count-1].
x || points[0].
y != points[count-1].
y) {
int SDL_DrawLines(SDL_Surface *dst, const SDL_Point *points, int count, Uint32 color)
static void SDL_DrawLine4(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, SDL_bool draw_end)
GLuint GLfloat GLfloat GLfloat x1
GLint GLint GLint GLint GLint x
#define BLINE(x1, y1, x2, y2, op, draw_end)
GLuint GLuint GLsizei count
#define DRAW_FASTSETPIXELXY1(x, y)
#define DRAW_FASTSETPIXELXY4(x, y)
GLfixed GLfixed GLfixed y2
#define DRAW_SETPIXELXY2_BLEND_RGB(x, y)
#define VLINE(type, op, draw_end)
The structure that defines a point.
A collection of pixels used in software blitting.
#define DLINE(type, op, draw_end)
#define HLINE(type, op, draw_end)
static void SDL_DrawLine2(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, SDL_bool draw_end)
void(* DrawLineFunc)(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, SDL_bool draw_end)
GLfixed GLfixed GLint GLint GLfixed points
#define DRAW_FASTSETPIXEL1
#define DRAW_SETPIXELXY_BLEND_RGB888(x, y)
#define DRAW_SETPIXELXY_BLEND_RGB555(x, y)
GLint GLint GLint GLint GLint GLint y
#define DRAW_SETPIXELXY4_BLEND_RGB(x, y)
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
#define DRAW_FASTSETPIXEL4
#define DRAW_FASTSETPIXELXY2(x, y)
#define AALINE(x1, y1, x2, y2, opaque_op, blend_op, draw_end)
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
static DrawLineFunc SDL_CalculateDrawLineFunc(const SDL_PixelFormat *fmt)
#define DRAW_SETPIXELXY_BLEND_RGB565(x, y)
#define DRAW_FASTSETPIXEL2
int SDL_DrawLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color)
#define SDL_IntersectRectAndLine
GLuint GLsizei GLsizei * length
#define DRAW_SETPIXELXY_BLEND_ARGB8888(x, y)
int SDL_DrawPoint(SDL_Surface *dst, int x, int y, Uint32 color)
static void SDL_DrawLine1(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, SDL_bool draw_end)