ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/mx_func.c
(Generate patch)

Comparing ray/src/rt/mx_func.c (file contents):
Revision 2.2 by greg, Mon Nov 25 09:50:56 1991 UTC vs.
Revision 2.7 by greg, Wed Mar 5 16:16:53 2003 UTC

# Line 1 | Line 1
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"
# Line 33 | Line 30 | mx_func(m, r)                  /* compute mixture function */
30   register OBJREC  *m;
31   RAY  *r;
32   {
33 +        OBJECT  obj;
34          register int  i;
35          double  coef;
36          OBJECT  mod[2];
# Line 40 | Line 38 | RAY  *r;
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);
# Line 52 | Line 51 | RAY  *r;
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;
56 >                return(0);
57          }
58 <        raymixture(r, mod[0], mod[1], coef);
58 >        if (raymixture(r, mod[0], mod[1], coef)) {
59 >                if (m->omod != OVOID)
60 >                        objerror(m, USER, "inappropriate modifier");
61 >                return(1);
62 >        }
63 >        return(0);
64   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines