2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Graphics/Circle.cpp $
15 * Code to draw circles.
18 * Revision 1.2 2002/06/09 04:41:17 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:09 root
25 * 2 10/07/98 10:52a Dave
28 * 1 10/07/98 10:48a Dave
30 * 9 3/10/98 4:18p John
31 * Cleaned up graphics lib. Took out most unused gr functions. Made D3D
32 * & Glide have popups and print screen. Took out all >8bpp software
33 * support. Made Fred zbuffer. Made zbuffer allocate dynamically to
34 * support Fred. Made zbuffering key off of functions rather than one
37 * 8 11/06/97 11:18a John
38 * fixed bug with some scanlines being drawn twice
40 * 7 11/26/96 6:50p John
41 * Added some more hicolor primitives. Made windowed mode run as current
42 * bpp, if bpp is 8,16,or 32.
44 * 6 11/26/96 4:30p John
45 * Put in some better quality circle_empty code.
47 * 5 11/07/96 6:19p John
48 * Added a bunch of 16bpp primitives so the game sort of runs in 16bpp
51 * 4 10/26/96 1:40p John
52 * Added some now primitives to the 2d library and
53 * cleaned up some old ones.
62 // THIS COULD BE OPTIMIZED BY MOVING THE GR_RECT CODE INTO HERE!!!!!!!!
64 #define circle_fill(x,y,w) gr_rect((x),(y),(w),1)
66 void gr8_circle( int xc, int yc, int d )
76 if ( (xc+r) < gr_screen.clip_left ) return;
77 if ( (xc-r) > gr_screen.clip_right ) return;
78 if ( (yc+r) < gr_screen.clip_top ) return;
79 if ( (yc-r) > gr_screen.clip_bottom ) return;
82 // Draw the first octant
83 circle_fill( xc-y, yc-x, y*2+1 );
85 circle_fill( xc-y, yc+x, y*2+1 );
90 // Draw the second octant
91 circle_fill( xc-x, yc-y, x*2+1 );
93 circle_fill( xc-x, yc+y, x*2+1 );
101 circle_fill( xc-x, yc-y, x*2+1 );
103 circle_fill( xc-x, yc+y, x*2+1 );