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

Comparing ray/src/rt/p_func.c (file contents):
Revision 2.1 by greg, Tue Nov 12 17:08:40 1991 UTC vs.
Revision 2.2 by greg, Mon Nov 25 09:50:57 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 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 procedural pattern can either be a brightness or a
19   *  color function.  A brightness function is given as:
# Line 36 | Line 38 | static char SCCSid[] = "$SunId$ LBL";
38  
39  
40   p_bfunc(m, r)                   /* compute brightness pattern */
41 < register OBJREC  *m;
41 > OBJREC  *m;
42   RAY  *r;
43   {
42        extern double  varvalue();
43        extern int  errno;
44          double  bval;
45 <        register char  **sa;
45 >        register MFUNC  *mf;
46  
47        setfunc(m, r);
48
49        sa = m->oargs.sarg;
50
47          if (m->oargs.nsargs < 2)
48                  objerror(m, USER, "bad # arguments");
49 <        funcfile(sa[1]);
49 >        mf = getfunc(m, 1, 0x1, 0);
50 >        setfunc(m, r);
51          errno = 0;
52 <        bval = varvalue(sa[0]);
52 >        bval = evalue(mf->ep[0]);
53          if (errno) {
54                  objerror(m, WARNING, "compute error");
55                  return;
# Line 62 | Line 59 | RAY  *r;
59  
60  
61   p_cfunc(m, r)                   /* compute color pattern */
62 < register OBJREC  *m;
62 > OBJREC  *m;
63   RAY  *r;
64   {
68        extern double  varvalue();
69        extern int  errno;
65          COLOR  cval;
66 <        register char  **sa;
66 >        register MFUNC  *mf;
67  
73        setfunc(m, r);
74
75        sa = m->oargs.sarg;
76
68          if (m->oargs.nsargs < 4)
69                  objerror(m, USER, "bad # arguments");
70 <        funcfile(sa[3]);
70 >        mf = getfunc(m, 3, 0x7, 0);
71 >        setfunc(m, r);
72          errno = 0;
73 <        setcolor(cval, varvalue(sa[0]),
74 <                        varvalue(sa[1]),
75 <                        varvalue(sa[2]));
73 >        setcolor(cval, evalue(mf->ep[0]),
74 >                        evalue(mf->ep[1]),
75 >                        evalue(mf->ep[2]));
76          if (errno) {
77                  objerror(m, WARNING, "compute error");
78                  return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines