51 |
|
|
52 |
|
int dxsize, dysize; /* page size */ |
53 |
|
|
54 |
+ |
static void settex(int pp); |
55 |
+ |
static void setpen(register int ps); |
56 |
|
|
57 |
|
|
58 |
< |
imInit() /* initialize imagen */ |
58 |
> |
|
59 |
> |
void |
60 |
> |
imInit(void) /* initialize imagen */ |
61 |
|
{ |
62 |
|
|
63 |
|
imout = stdout; |
74 |
|
} |
75 |
|
|
76 |
|
|
77 |
+ |
void |
78 |
+ |
printstr( /* output a string */ |
79 |
+ |
register PRIMITIVE *p |
80 |
+ |
) |
81 |
|
|
74 |
– |
printstr(p) /* output a string */ |
75 |
– |
|
76 |
– |
register PRIMITIVE *p; |
77 |
– |
|
82 |
|
{ |
83 |
|
static int curfont = -1; |
84 |
|
int fn; |
110 |
|
|
111 |
|
|
112 |
|
|
113 |
+ |
void |
114 |
+ |
plotlseg( /* plot a line segment */ |
115 |
+ |
register PRIMITIVE *p |
116 |
+ |
) |
117 |
|
|
110 |
– |
plotlseg(p) /* plot a line segment */ |
111 |
– |
|
112 |
– |
register PRIMITIVE *p; |
113 |
– |
|
118 |
|
{ |
119 |
|
int x1, x2, y1, y2; |
120 |
|
short pp; |
144 |
|
|
145 |
|
|
146 |
|
|
147 |
+ |
void |
148 |
+ |
setfill( /* set filling mode */ |
149 |
+ |
register int a0 |
150 |
+ |
) |
151 |
|
|
144 |
– |
setfill(a0) /* set filling mode */ |
145 |
– |
|
146 |
– |
register int a0; |
147 |
– |
|
152 |
|
{ |
153 |
|
|
154 |
|
settex(pati[(a0 >> 2) & 03]); |
156 |
|
} |
157 |
|
|
158 |
|
|
159 |
+ |
void |
160 |
+ |
setpen( /* set pen size to ps */ |
161 |
+ |
register int ps |
162 |
+ |
) |
163 |
|
|
156 |
– |
setpen(ps) /* set pen size to ps */ |
157 |
– |
|
158 |
– |
register int ps; |
159 |
– |
|
164 |
|
{ |
165 |
|
static int curpsiz = -1; /* current pen size */ |
166 |
|
|
179 |
|
} |
180 |
|
|
181 |
|
|
182 |
+ |
void |
183 |
+ |
settex( /* set texture pattern to pp */ |
184 |
+ |
int pp |
185 |
+ |
) |
186 |
|
|
179 |
– |
settex(pp) /* set texture pattern to pp */ |
180 |
– |
|
181 |
– |
int pp; |
182 |
– |
|
187 |
|
{ |
188 |
|
static int curtex = -1; /* current texture */ |
189 |
|
static short ploaded[NPATS]; /* booleans for loaded patterns */ |
226 |
|
} |
227 |
|
|
228 |
|
|
229 |
+ |
void |
230 |
+ |
fillrect( /* fill a rectangle */ |
231 |
+ |
register PRIMITIVE *p |
232 |
+ |
) |
233 |
|
|
226 |
– |
fillrect(p) /* fill a rectangle */ |
227 |
– |
|
228 |
– |
register PRIMITIVE *p; |
229 |
– |
|
234 |
|
{ |
235 |
|
int left, right, top, bottom; |
236 |
|
|
246 |
|
} |
247 |
|
|
248 |
|
|
249 |
+ |
void |
250 |
+ |
filltri( /* fill a triangle */ |
251 |
+ |
register PRIMITIVE *p |
252 |
+ |
) |
253 |
|
|
246 |
– |
filltri(p) /* fill a triangle */ |
247 |
– |
|
248 |
– |
register PRIMITIVE *p; |
249 |
– |
|
254 |
|
{ |
255 |
|
int left, right, top, bottom; |
256 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
+ |
void |
286 |
+ |
xform( /* transform a point according to p */ |
287 |
+ |
register int *xp, |
288 |
+ |
register int *yp, |
289 |
+ |
register PRIMITIVE *p |
290 |
+ |
) |
291 |
|
|
282 |
– |
xform(xp, yp, p) /* transform a point according to p */ |
283 |
– |
|
284 |
– |
register int *xp, *yp; |
285 |
– |
register PRIMITIVE *p; |
286 |
– |
|
292 |
|
{ |
293 |
< |
int x, y; |
293 |
> |
int x = 0, y = 0; |
294 |
|
|
295 |
|
switch (p->arg0 & 060) { |
296 |
|
case 0: /* right */ |
317 |
|
} |
318 |
|
|
319 |
|
|
320 |
+ |
void |
321 |
+ |
fillpoly( /* fill a polygon */ |
322 |
+ |
register PRIMITIVE *p |
323 |
+ |
) |
324 |
|
|
316 |
– |
fillpoly(p) /* fill a polygon */ |
317 |
– |
|
318 |
– |
register PRIMITIVE *p; |
319 |
– |
|
325 |
|
{ |
326 |
|
int points[128]; |
327 |
|
register int *pp; |
323 |
– |
char *nextscan(); |
328 |
|
register char *s; |
329 |
|
|
330 |
|
pp = points; |
331 |
|
|
332 |
< |
if ((s = nextscan(nextscan(p->args, "%d", pp), "%d", pp+1)) == NULL) |
332 |
> |
if ((s = nextscan(nextscan(p->args,"%d",(char*)pp),"%d",(char*)pp+1))==NULL) |
333 |
|
error(USER, "illegal polygon spec in fillpoly"); |
334 |
|
|
335 |
|
xform(pp, pp+1, p); |
336 |
|
pp[0] = mapx(pp[0]); pp[1] = mapy(pp[1]); |
337 |
|
pp += 2; |
338 |
|
|
339 |
< |
while ((s = nextscan(nextscan(s, "%d", pp), "%d", pp+1)) != NULL) { |
339 |
> |
while ((s = nextscan(nextscan(s,"%d",(char*)pp),"%d",(char*)pp+1))!=NULL) { |
340 |
|
xform(pp, pp+1, p); |
341 |
|
pp[0] = mapx(pp[0]); pp[1] = mapy(pp[1]); |
342 |
|
pp += 2; |