comparison src/video/SDL_drawline.c @ 2909:3da0bb421d83

Added line clipping
author Sam Lantinga <slouken@libsdl.org>
date Tue, 23 Dec 2008 02:23:18 +0000
parents 133601e3b255
children 27d8b12e0e8e
comparison
equal deleted inserted replaced
2908:aa6ba38c1714 2909:3da0bb421d83
32 SDL_SetError("SDL_DrawLine(): Unsupported surface format"); 32 SDL_SetError("SDL_DrawLine(): Unsupported surface format");
33 return (-1); 33 return (-1);
34 } 34 }
35 35
36 /* Perform clipping */ 36 /* Perform clipping */
37 /* FIXME 37 if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &x2, &y1, &y2)) {
38 if (!SDL_IntersectRect(dstrect, &dst->clip_rect, dstrect)) { 38 return (0);
39 return (0); 39 }
40 }
41 */
42 40
43 switch (dst->format->BytesPerPixel) { 41 switch (dst->format->BytesPerPixel) {
44 case 1: 42 case 1:
45 DRAWLINE(x1, y1, x2, y2, DRAW_FASTSETPIXEL1); 43 DRAWLINE(x1, y1, x2, y2, DRAW_FASTSETPIXEL1);
46 break; 44 break;