21 #include "../SDL_internal.h"
29 int Amin, Amax, Bmin, Bmax;
76 int Amin, Amax, Bmin, Bmax;
130 int Amin, Amax, Bmin, Bmax;
212 const int clip_minx = clip->
x;
213 const int clip_miny = clip->
y;
214 const int clip_maxx = clip->
x+clip->
w-1;
215 const int clip_maxy = clip->
y+clip->
h-1;
244 }
else if (
x > maxx) {
249 }
else if (
y > maxy) {
263 minx = maxx =
points[0].x;
264 miny = maxy =
points[0].y;
272 }
else if (
x > maxx) {
277 }
else if (
y > maxy) {
286 result->w = (maxx-minx)+1;
287 result->h = (maxy-miny)+1;
293 #define CODE_BOTTOM 1
327 int outcode1, outcode2;
375 if ((
x1 < rectx1 &&
x2 < rectx1) || (
x1 > rectx2 &&
x2 > rectx2) ||
376 (
y1 < recty1 &&
y2 < recty1) || (
y1 > recty2 &&
y2 > recty2)) {
384 }
else if (
x1 > rectx2) {
389 }
else if (
x2 > rectx2) {
399 }
else if (
y1 > recty2) {
404 }
else if (
y2 > recty2) {
413 while (outcode1 || outcode2) {
414 if (outcode1 & outcode2) {
472 int span_y1, span_y2;
473 int rect_y1, rect_y2;
504 for (
i = 0;
i < numrects; ++
i) {
506 rect_y2 = rect_y1 +
rects[
i].h;
511 }
else if (rect_y1 < span_y1) {
516 }
else if (rect_y2 > span_y2) {
520 if (span_y2 > span_y1) {
524 span->h = (span_y2 - span_y1);
#define SDL_assert(condition)
#define SDL_InvalidParamError(param)
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei width
GLint GLint GLint GLint GLint x
GLint GLint GLsizei GLsizei height
GLfixed GLfixed GLint GLint GLfixed points
GLfixed GLfixed GLfixed y2
GLuint GLfloat GLfloat GLfloat x1
GLenum GLenum void void void * span
static int ComputeOutCode(const SDL_Rect *rect, int x, int y)
SDL_bool SDL_IntersectRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result)
Calculate the intersection of two rectangles.
SDL_bool SDL_EnclosePoints(const SDL_Point *points, int count, const SDL_Rect *clip, SDL_Rect *result)
Calculate a minimal rectangle enclosing a set of points.
SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect *rects, SDL_Rect *span)
SDL_bool SDL_HasIntersection(const SDL_Rect *A, const SDL_Rect *B)
Determine whether two rectangles intersect.
void SDL_UnionRect(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result)
Calculate the union of two rectangles.
SDL_bool SDL_IntersectRectAndLine(const SDL_Rect *rect, int *X1, int *Y1, int *X2, int *Y2)
Calculate the intersection of a rectangle and line segment.
SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r)
Returns true if the rectangle has no area.
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)
EGLSurface EGLint * rects
The structure that defines a point (integer)
A rectangle, with the origin at the upper left (integer).