1 |
– |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* mx_func.c - routine for mixture functions. |
9 |
– |
* |
10 |
– |
* 11/2/88 |
6 |
|
*/ |
7 |
|
|
8 |
+ |
#include "copyright.h" |
9 |
+ |
|
10 |
|
#include "ray.h" |
11 |
|
|
12 |
|
#include "func.h" |
30 |
|
register OBJREC *m; |
31 |
|
RAY *r; |
32 |
|
{ |
33 |
+ |
OBJECT obj; |
34 |
|
register int i; |
35 |
|
double coef; |
36 |
|
OBJECT mod[2]; |
38 |
|
|
39 |
|
if (m->oargs.nsargs < 4) |
40 |
|
objerror(m, USER, "bad # arguments"); |
41 |
+ |
obj = objndx(m); |
42 |
|
for (i = 0; i < 2; i++) |
43 |
|
if (!strcmp(m->oargs.sarg[i], VOIDID)) |
44 |
|
mod[i] = OVOID; |
45 |
< |
else if ((mod[i] = modifier(m->oargs.sarg[i])) == OVOID) { |
45 |
> |
else if ((mod[i] = lastmod(obj, m->oargs.sarg[i])) == OVOID) { |
46 |
|
sprintf(errmsg, "undefined modifier \"%s\"", |
47 |
|
m->oargs.sarg[i]); |
48 |
|
objerror(m, USER, errmsg); |
51 |
|
setfunc(m, r); |
52 |
|
errno = 0; |
53 |
|
coef = evalue(mf->ep[0]); |
54 |
< |
if (errno) { |
54 |
> |
if (errno == EDOM || errno == ERANGE) { |
55 |
|
objerror(m, WARNING, "compute error"); |
56 |
|
return(0); |
57 |
|
} |