21#include "../SDL_internal.h"
30 int Amin, Amax, Bmin, Bmax;
77 int Amin, Amax, Bmin, Bmax;
131 int Amin, Amax, Bmin, Bmax;
213 const int clip_minx = clip->
x;
214 const int clip_miny = clip->
y;
215 const int clip_maxx = clip->
x+clip->
w-1;
216 const int clip_maxy = clip->
y+clip->
h-1;
245 }
else if (
x > maxx) {
250 }
else if (
y > maxy) {
264 minx = maxx =
points[0].x;
265 miny = maxy =
points[0].y;
273 }
else if (
x > maxx) {
278 }
else if (
y > maxy) {
287 result->w = (maxx-minx)+1;
288 result->h = (maxy-miny)+1;
328 int outcode1, outcode2;
376 if ((
x1 < rectx1 &&
x2 < rectx1) || (
x1 > rectx2 &&
x2 > rectx2) ||
377 (
y1 < recty1 &&
y2 < recty1) || (
y1 > recty2 &&
y2 > recty2)) {
385 }
else if (
x1 > rectx2) {
390 }
else if (
x2 > rectx2) {
400 }
else if (
y1 > recty2) {
405 }
else if (
y2 > recty2) {
414 while (outcode1 || outcode2) {
415 if (outcode1 & outcode2) {
473 int span_y1, span_y2;
474 int rect_y1, rect_y2;
505 for (
i = 0;
i < numrects; ++
i) {
507 rect_y2 = rect_y1 +
rects[
i].h;
512 }
else if (rect_y1 < span_y1) {
517 }
else if (rect_y2 > span_y2) {
521 if (span_y2 > span_y1) {
525 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).