diff src/video/SDL_video.c @ 2909:3da0bb421d83

Added line clipping
author Sam Lantinga <slouken@libsdl.org>
date Tue, 23 Dec 2008 02:23:18 +0000
parents aa6ba38c1714
children 27d8b12e0e8e
line wrap: on
line diff
--- a/src/video/SDL_video.c	Tue Dec 23 01:28:06 2008 +0000
+++ b/src/video/SDL_video.c	Tue Dec 23 02:23:18 2008 +0000
@@ -2119,19 +2119,15 @@
         SDL_Unsupported();
         return -1;
     }
-#if 0
-    //FIXME: Need line intersect routine
     window = SDL_GetWindowFromID(renderer->window);
+
     real_rect.x = 0;
     real_rect.y = 0;
     real_rect.w = window->w;
     real_rect.h = window->h;
-    if (rect) {
-        if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) {
-            return 0;
-        }
+    if (!SDL_IntersectRectAndLine(&real_rect, &x1, &x2, &y1, &y2)) {
+        return (0);
     }
-#endif
     return renderer->RenderLine(renderer, x1, y1, x2, y2);
 }