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.1 by greg, Tue Nov 12 17:08:33 1991 UTC vs.
Revision 2.2 by greg, Mon Nov 25 09:50:56 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1988 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include  "ray.h"
14  
15 + #include  "func.h"
16 +
17   /*
18   *      A mixture function is specified:
19   *
# Line 31 | Line 33 | mx_func(m, r)                  /* compute mixture function */
33   register OBJREC  *m;
34   RAY  *r;
35   {
34        extern double  varvalue();
35        extern int  errno;
36          register int  i;
37          double  coef;
38          OBJECT  mod[2];
39 <        register char  **sa;
39 >        register MFUNC  *mf;
40  
41        setfunc(m, r);
42
43        sa = m->oargs.sarg;
44
41          if (m->oargs.nsargs < 4)
42                  objerror(m, USER, "bad # arguments");
43          for (i = 0; i < 2; i++)
44 <                if (!strcmp(sa[i], VOIDID))
44 >                if (!strcmp(m->oargs.sarg[i], VOIDID))
45                          mod[i] = OVOID;
46 <                else if ((mod[i] = modifier(sa[i])) == OVOID) {
47 <                        sprintf(errmsg, "undefined modifier \"%s\"", sa[i]);
46 >                else if ((mod[i] = modifier(m->oargs.sarg[i])) == OVOID) {
47 >                        sprintf(errmsg, "undefined modifier \"%s\"",
48 >                                        m->oargs.sarg[i]);
49                          objerror(m, USER, errmsg);
50                  }
51 <        funcfile(sa[3]);
51 >        mf = getfunc(m, 3, 0x4, 0);
52 >        setfunc(m, r);
53          errno = 0;
54 <        coef = varvalue(sa[2]);
54 >        coef = evalue(mf->ep[0]);
55          if (errno) {
56                  objerror(m, WARNING, "compute error");
57                  return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines