stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/video linedraw.c


From: Nehal Mistry
Subject: [Stratagus-CVS] stratagus/src/video linedraw.c
Date: Sat, 22 Nov 2003 02:34:37 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Nehal Mistry <address@hidden>   03/11/22 02:34:37

Modified files:
        src/video      : linedraw.c 

Log message:
        fix cirle crashes

Patches:
Index: stratagus/src/video/linedraw.c
diff -u stratagus/src/video/linedraw.c:1.48 stratagus/src/video/linedraw.c:1.49
--- stratagus/src/video/linedraw.c:1.48 Fri Nov 21 22:17:52 2003
+++ stratagus/src/video/linedraw.c      Sat Nov 22 02:34:36 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: linedraw.c,v 1.48 2003/11/22 03:17:52 nehalmistry Exp $
+//     $Id: linedraw.c,v 1.49 2003/11/22 07:34:36 nehalmistry Exp $
 
 //@{
 
@@ -814,8 +814,16 @@
 
 global void VideoDrawCircleClip(SDL_Color color, int x, int y, int r)
 {
-    // FIXME: clip
+    int w;
+    int h;
+
+    w = h = r * 2;
+
+    CLIP_RECTANGLE(x, y, w, h);
     VideoDrawCircle(color, x, y, r);
+
+    r = w / 2;
+    h = w / 2;
 }
 
 global void VideoDrawTransCircleClip(SDL_Color color, int x, int y,
@@ -872,15 +880,31 @@
 
 global void VideoFillCircleClip(SDL_Color color, int x, int y, int r)
 {
-    // FIXME: clip
+    int w;
+    int h;
+
+    w = h = r * 2;
+
+    CLIP_RECTANGLE(x, y, w, h);
     VideoFillCircle(color, x, y, r);
+
+    r = w / 2;
+    h = w / 2;
 }
 
 global void VideoFillTransCircleClip(SDL_Color color, int x, int y,
     int r, unsigned char alpha)
 {
-    // FIXME: clip, trans
+    int w;
+    int h;
+
+    w = h = r * 2;
+
+    CLIP_RECTANGLE(x, y, w, h);
     VideoFillCircle(color, x, y, r);
+
+    r = w / 2;
+    h = w / 2;
 }
 
 global void DebugTestDisplayLines(void)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]