1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
109 |
|
sprintf(errmsg, "undefined modifier \"%s\"", modname); |
110 |
|
objerror(m, USER, errmsg); |
111 |
|
} |
112 |
< |
raytexture(r, omod); |
113 |
< |
} else if (m->otype == PAT_BTEXT) { |
112 |
> |
if (rayshade(r, omod)) { |
113 |
> |
if (m->omod != OVOID) |
114 |
> |
objerror(m, USER, "inappropriate modifier"); |
115 |
> |
return(1); |
116 |
> |
} |
117 |
> |
} |
118 |
> |
if (m->otype == PAT_BTEXT) { |
119 |
|
if (foreground) |
120 |
|
scalecolor(r->pcol, m->oargs.farg[9]); |
121 |
|
else |
132 |
|
m->oargs.farg[14]); |
133 |
|
multcolor(r->pcol, cval); |
134 |
|
} |
135 |
+ |
return(0); |
136 |
|
} |
137 |
|
|
138 |
|
|
148 |
|
if ((tl=(TLINE *)malloc(sizeof(TLINE)+siz)) == NULL || |
149 |
|
(tl->spc=(short *)malloc(siz*sizeof(short))) == NULL) |
150 |
|
error(SYSTEM, "out of memory in tlalloc"); |
145 |
– |
tl->spc = NULL; |
151 |
|
tl->next = NULL; |
152 |
|
strcpy(TLSTR(tl), s); |
153 |
|
return(tl); |
160 |
|
{ |
161 |
|
#define R (tm->oargs.farg+3) |
162 |
|
#define D (tm->oargs.farg+6) |
163 |
< |
extern char *strcpy(), *fgets(); |
163 |
> |
extern char *strcpy(); |
164 |
|
FVECT DxR; |
165 |
|
double d; |
166 |
|
FILE *fp; |
176 |
|
if (tm->oargs.nsargs - tndx(tm) < 1 || tm->oargs.nfargs < sndx(tm)) |
177 |
|
objerror(tm, USER, "bad # arguments"); |
178 |
|
if ((t = (TEXT *)malloc(sizeof(TEXT))) == NULL) |
179 |
< |
goto memerr; |
179 |
> |
error(SYSTEM, "out of memory in gettext"); |
180 |
|
/* compute vectors */ |
181 |
|
fcross(DxR, D, R); |
182 |
|
fcross(t->right, DxR, D); |
228 |
|
i = d * 256.0; |
229 |
|
t->tl.width = 0; |
230 |
|
for (tlp = t->tl.next; tlp != NULL; tlp = tlp->next) { |
226 |
– |
if ((tlp->spc = (short *)malloc( |
227 |
– |
(strlen(TLSTR(tlp))+1)*sizeof(short))) == NULL) |
228 |
– |
goto memerr; |
231 |
|
if (i < 0) |
232 |
|
tlp->width = squeeztext(tlp->spc, TLSTR(tlp), t->f, -i); |
233 |
|
else if (i > 0) |
240 |
|
/* we're done */ |
241 |
|
tm->os = (char *)t; |
242 |
|
return(t); |
241 |
– |
memerr: |
242 |
– |
error(SYSTEM, "out of memory in gettext"); |
243 |
|
#undef R |
244 |
|
#undef D |
245 |
|
} |
248 |
|
freetext(m) /* free text structures associated with m */ |
249 |
|
OBJREC *m; |
250 |
|
{ |
251 |
< |
TEXT *tp; |
252 |
< |
register TLINE *tlp, *tln; |
251 |
> |
register TEXT *tp; |
252 |
> |
register TLINE *tlp; |
253 |
|
|
254 |
|
tp = (TEXT *)m->os; |
255 |
|
if (tp == NULL) |
256 |
|
return; |
257 |
< |
for (tlp = tp->tl.next; tlp != NULL; tlp = tln) { |
258 |
< |
tln = tlp->next; |
257 |
> |
while ((tlp = tp->tl.next) != NULL) { |
258 |
> |
tp->tl.next = tlp->next; |
259 |
|
free((char *)tlp->spc); |
260 |
|
free((char *)tlp); |
261 |
|
} |