home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_08
/
8n08058a
< prev
next >
Wrap
Text File
|
1990-07-18
|
673b
|
35 lines
Listing 2
poly(nverts, poly_list)
int nverts, *poly_list[];
{
int i;
/*
see if vertices list is closed
and close it if not
*/
if (poly_list[0] != poly_list[(nverts*2)-2] ||
poly_list[1] != poly_list[(nverts*2)-1])
{
poly_list[(nverts*2)+0] = poly_list[0];
poly_list[(nverts*2)+1] = poly_list[1];
nverts++;
}
/*
invert the Y axis of each vertice in list
*/
for (i=0; i < nverts; i++)
poly_list[(i * 2)+1] = ydots-poly_list[(i * 2)+1];
/*
then draw it
*/
if (filling)
fill_polygon_a(nverts,poly_list);
else
draw_polyline(nverts,poly_list);
}