21 #include "../SDL_internal.h"
30 int Amin, Amax, Bmin, Bmax;
77 int Amin, Amax, Bmin, Bmax;
111 result->
w = Amax - Amin;
123 result->
h = Amax - Amin;
131 int Amin, Amax, Bmin, Bmax;
176 result->
w = Amax - Amin;
188 result->
h = Amax - Amin;
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;
223 for (i = 0; i <
count; ++
i) {
233 if (result ==
NULL) {
245 }
else if (x > maxx) {
250 }
else if (y > maxy) {
259 if (result ==
NULL) {
264 minx = maxx = points[0].
x;
265 miny = maxy = points[0].
y;
267 for (i = 1; i <
count; ++
i) {
273 }
else if (x > maxx) {
278 }
else if (y > maxy) {
287 result->
w = (maxx-minx)+1;
288 result->
h = (maxy-miny)+1;
294 #define CODE_BOTTOM 1
305 }
else if (y >= rect->
y + rect->
h) {
310 }
else if (x >= rect->
x + rect->
w) {
328 int outcode1, outcode2;
366 rectx2 = rect->
x + rect->
w - 1;
367 recty2 = rect->
y + rect->
h - 1;
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) {
422 x = x1 + ((x2 -
x1) * (y - y1)) / (y2 - y1);
425 x = x1 + ((x2 -
x1) * (y - y1)) / (y2 - y1);
428 y = y1 + ((y2 -
y1) * (x - x1)) / (x2 - x1);
431 y = y1 + ((y2 -
y1) * (x - x1)) / (x2 - x1);
439 x = x1 + ((x2 -
x1) * (y - y1)) / (y2 - y1);
442 x = x1 + ((x2 -
x1) * (y - y1)) / (y2 - y1);
448 y = y1 + ((y2 -
y1) * (x - x1)) / (x2 - x1);
454 y = y1 + ((y2 -
y1) * (x - x1)) / (x2 - x1);
473 int span_y1, span_y2;
474 int rect_y1, rect_y2;
505 for (i = 0; i < numrects; ++
i) {
506 rect_y1 = rects[
i].
y;
507 rect_y2 = rect_y1 + rects[
i].
h;
512 }
else if (rect_y1 < span_y1) {
515 if (rect_y2 > height) {
517 }
else if (rect_y2 > span_y2) {
521 if (span_y2 > span_y1) {
525 span->
h = (span_y2 - span_y1);