2 * $Logfile: /Freespace2/code/Graphics/Circle.cpp $
7 * Code to draw circles.
10 * Revision 1.1 2002/05/03 03:28:09 root
14 * 2 10/07/98 10:52a Dave
17 * 1 10/07/98 10:48a Dave
19 * 9 3/10/98 4:18p John
20 * Cleaned up graphics lib. Took out most unused gr functions. Made D3D
21 * & Glide have popups and print screen. Took out all >8bpp software
22 * support. Made Fred zbuffer. Made zbuffer allocate dynamically to
23 * support Fred. Made zbuffering key off of functions rather than one
26 * 8 11/06/97 11:18a John
27 * fixed bug with some scanlines being drawn twice
29 * 7 11/26/96 6:50p John
30 * Added some more hicolor primitives. Made windowed mode run as current
31 * bpp, if bpp is 8,16,or 32.
33 * 6 11/26/96 4:30p John
34 * Put in some better quality circle_empty code.
36 * 5 11/07/96 6:19p John
37 * Added a bunch of 16bpp primitives so the game sort of runs in 16bpp
40 * 4 10/26/96 1:40p John
41 * Added some now primitives to the 2d library and
42 * cleaned up some old ones.
51 // THIS COULD BE OPTIMIZED BY MOVING THE GR_RECT CODE INTO HERE!!!!!!!!
53 #define circle_fill(x,y,w) gr_rect((x),(y),(w),1)
55 void gr8_circle( int xc, int yc, int d )
65 if ( (xc+r) < gr_screen.clip_left ) return;
66 if ( (xc-r) > gr_screen.clip_right ) return;
67 if ( (yc+r) < gr_screen.clip_top ) return;
68 if ( (yc-r) > gr_screen.clip_bottom ) return;
71 // Draw the first octant
72 circle_fill( xc-y, yc-x, y*2+1 );
74 circle_fill( xc-y, yc+x, y*2+1 );
79 // Draw the second octant
80 circle_fill( xc-x, yc-y, x*2+1 );
82 circle_fill( xc-x, yc+y, x*2+1 );
90 circle_fill( xc-x, yc-y, x*2+1 );
92 circle_fill( xc-x, yc+y, x*2+1 );