1 /* $Id: disc.c,v 1.3 2002-07-17 21:55:19 bradleyb Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
24 int gr_disk(fix xc1,fix yc1,fix r1)
26 int p,x, y, xc, yc, r;
36 if ( (xc+r) < 0 ) return 1;
37 if ( (xc-r) > GWIDTH ) return 1;
38 if ( (yc+r) < 0 ) return 1;
39 if ( (yc-r) > GHEIGHT ) return 1;
43 // Draw the first octant
44 gr_scanline( xc-y, xc+y, yc-x );
45 gr_scanline( xc-y, xc+y, yc+x );
50 // Draw the second octant
51 gr_scanline( xc-x, xc+x, yc-y );
52 gr_scanline( xc-x, xc+x, yc+y );
59 gr_scanline( xc-x, xc+x, yc-y );
60 gr_scanline( xc-x, xc+x, yc+y );
65 int gr_udisk(fix xc1,fix yc1,fix r1)
67 int p,x, y, xc, yc, r;
78 // Draw the first octant
79 gr_uscanline( xc-y, xc+y, yc-x );
80 gr_uscanline( xc-y, xc+y, yc+x );
85 // Draw the second octant
86 gr_uscanline( xc-x, xc+x, yc-y );
87 gr_uscanline( xc-x, xc+x, yc+y );
94 gr_uscanline( xc-x, xc+x, yc-y );
95 gr_uscanline( xc-x, xc+x, yc+y );