1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
5 |
|
#endif |
6 |
|
|
7 |
|
/* |
39 |
|
register OBJREC *m; |
40 |
|
RAY *r; |
41 |
|
{ |
42 |
+ |
OBJECT obj; |
43 |
|
double coef; |
44 |
|
double pt[MAXDIM]; |
45 |
|
DATARRAY *dp; |
49 |
|
|
50 |
|
if (m->oargs.nsargs < 6) |
51 |
|
objerror(m, USER, "bad # arguments"); |
52 |
+ |
obj = objndx(m); |
53 |
|
for (i = 0; i < 2; i++) |
54 |
|
if (!strcmp(m->oargs.sarg[i], VOIDID)) |
55 |
|
mod[i] = OVOID; |
56 |
< |
else if ((mod[i] = modifier(m->oargs.sarg[i])) == OVOID) { |
56 |
> |
else if ((mod[i] = lastmod(obj, m->oargs.sarg[i])) == OVOID) { |
57 |
|
sprintf(errmsg, "undefined modifier \"%s\"", |
58 |
|
m->oargs.sarg[i]); |
59 |
|
objerror(m, USER, errmsg); |
73 |
|
coef = funvalue(m->oargs.sarg[2], 1, &coef); |
74 |
|
if (errno) |
75 |
|
goto computerr; |
76 |
< |
raymixture(r, mod[0], mod[1], coef); |
77 |
< |
return; |
76 |
> |
if (raymixture(r, mod[0], mod[1], coef)) { |
77 |
> |
if (m->omod != OVOID) |
78 |
> |
objerror(m, USER, "inappropriate modifier"); |
79 |
> |
return(1); |
80 |
> |
} |
81 |
> |
return(0); |
82 |
|
computerr: |
83 |
|
objerror(m, WARNING, "compute error"); |
84 |
+ |
return(0); |
85 |
|
} |