1 /**
2  ** upfcpoly.c
3  **
4  ** Copyright (C) 1997, 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 
GrUsrPatternFilledConvexPolygon(int numpts,int points[][2],GrPattern * p)23 void GrUsrPatternFilledConvexPolygon(int numpts,int points[][2],GrPattern *p)
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 	  GrPatternFilledConvexPolygon(numpts,tmp,p);
38 	  FREE(tmp);
39 	}
40 	reset_ALLOC();
41 }
42