1 /**
2 ** ufcpolyg.c
3 **
4 ** Copyright (C), Michael Goffioul
5 ** [goffioul@emic.ucl.ac.be]
6 **
7 ** This file is part of the GRX graphics library.
8 **
9 ** The GRX graphics library is free software; you can redistribute it
10 ** and/or modify it under some conditions; see the "copying.grx" file
11 ** for details.
12 **
13 ** This library is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 **
17 **/
18
19 #include "libgrx.h"
20 #include "allocate.h"
21 #include "usercord.h"
22
GrUsrFilledConvexPolygon(int numpts,int points[][2],GrColor c)23 void GrUsrFilledConvexPolygon(int numpts,int points[][2],GrColor c)
24 {
25 int pt;
26 int (*tmp)[2];
27 setup_ALLOC();
28 tmp = ALLOC(sizeof(int) * 2 * numpts);
29
30 if (tmp != NULL) {
31 for ( pt = 0; pt < numpts; pt++) {
32 tmp[pt][0] = points[pt][0];
33 tmp[pt][1] = points[pt][1];
34 U2SX(tmp[pt][0],CURC);
35 U2SY(tmp[pt][1],CURC);
36 }
37 GrFilledConvexPolygon(numpts,tmp,c);
38 FREE(tmp);
39 }
40 reset_ALLOC();
41 }
42