1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* text.c - functions for text patterns and mixtures. |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include "ray.h" |
11 |
|
|
12 |
|
#include "otypes.h" |
76 |
|
TLINE tl; /* line list */ |
77 |
|
} TEXT; |
78 |
|
|
80 |
– |
extern char *getlibpath(); |
81 |
– |
|
82 |
– |
extern char *fgetword(); |
83 |
– |
|
79 |
|
TEXT *gettext(); |
80 |
|
|
81 |
|
TLINE *tlalloc(); |
134 |
|
tlalloc(s) /* allocate and assign text line */ |
135 |
|
char *s; |
136 |
|
{ |
142 |
– |
extern char *strcpy(); |
137 |
|
register int siz; |
138 |
|
register TLINE *tl; |
139 |
|
|
153 |
|
{ |
154 |
|
#define R (tm->oargs.farg+3) |
155 |
|
#define D (tm->oargs.farg+6) |
162 |
– |
extern char *strcpy(); |
156 |
|
FVECT DxR; |
157 |
|
double d; |
158 |
|
FILE *fp; |
196 |
|
tlp = tlp->next; |
197 |
|
} else { /* text file */ |
198 |
|
if ((s = getpath(tm->oargs.sarg[tndx(tm)], |
199 |
< |
getlibpath(), R_OK)) == NULL) { |
199 |
> |
getrlibpath(), R_OK)) == NULL) { |
200 |
|
sprintf(errmsg, "cannot find text file \"%s\"", |
201 |
|
tm->oargs.sarg[tndx(tm)]); |
202 |
|
error(USER, errmsg); |
251 |
|
return; |
252 |
|
while ((tlp = tp->tl.next) != NULL) { |
253 |
|
tp->tl.next = tlp->next; |
254 |
< |
free((char *)tlp->spc); |
255 |
< |
free((char *)tlp); |
254 |
> |
free((void *)tlp->spc); |
255 |
> |
free((void *)tlp); |
256 |
|
} |
257 |
< |
free((char *)tp); |
257 |
> |
freefont(tp->f); /* release font reference */ |
258 |
> |
free((void *)tp); |
259 |
|
m->os = NULL; |
260 |
|
} |
261 |
|
|
325 |
|
/* positive x axis cross test */ |
326 |
|
while (n--) { |
327 |
|
if ((p0[1]<<1 > ylb) ^ (p1[1]<<1 > ylb)) { |
328 |
< |
tv = p0[0]<<1 > xlb | (p1[0]<<1 > xlb) << 1; |
328 |
> |
tv = (p0[0]<<1 > xlb) | ((p1[0]<<1 > xlb) << 1); |
329 |
|
if (tv == 03) |
330 |
|
ncross++; |
331 |
|
else if (tv) |