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

Comparing ray/src/rt/mx_data.c (file contents):
Revision 2.7 by greg, Tue Feb 25 02:47:22 2003 UTC vs.
Revision 2.9 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 8 | Line 8 | static const char      RCSid[] = "$Id$";
8   #include "copyright.h"
9  
10   #include  "ray.h"
11
11   #include  "data.h"
13
12   #include  "func.h"
13 + #include  "rtotypes.h"
14  
15   /*
16   *  A stored mixture is specified:
# Line 42 | Line 41 | static const char      RCSid[] = "$Id$";
41   */
42  
43  
44 < mx_data(m, r)                   /* interpolate mixture data */
45 < register OBJREC  *m;
46 < RAY  *r;
44 > extern int
45 > mx_data(                        /* interpolate mixture data */
46 >        register OBJREC  *m,
47 >        RAY  *r
48 > )
49   {
50          OBJECT  obj;
51          double  coef;
# Line 72 | Line 73 | RAY  *r;
73          errno = 0;
74          for (i = 0; i < dp->nd; i++) {
75                  pt[i] = evalue(mf->ep[i]);
76 <                if (errno)
76 >                if (errno == EDOM || errno == ERANGE)
77                          goto computerr;
78          }
79          coef = datavalue(dp, pt);
80          errno = 0;
81          coef = funvalue(m->oargs.sarg[2], 1, &coef);
82 <        if (errno)
82 >        if (errno == EDOM || errno == ERANGE)
83                  goto computerr;
84          if (raymixture(r, mod[0], mod[1], coef)) {
85                  if (m->omod != OVOID)
# Line 92 | Line 93 | computerr:
93   }
94  
95  
96 < mx_pdata(m, r)                  /* interpolate mixture picture */
97 < register OBJREC  *m;
98 < RAY  *r;
96 > extern int
97 > mx_pdata(                       /* interpolate mixture picture */
98 >        register OBJREC  *m,
99 >        RAY  *r
100 > )
101   {
102          OBJECT  obj;
103          double  col[3], coef;
# Line 121 | Line 124 | RAY  *r;
124          errno = 0;
125          pt[1] = evalue(mf->ep[0]);      /* y major ordering */
126          pt[0] = evalue(mf->ep[1]);
127 <        if (errno)
127 >        if (errno == EDOM || errno == ERANGE)
128                  goto computerr;
129          for (i = 0; i < 3; i++)         /* get pixel from picture */
130                  col[i] = datavalue(dp+i, pt);
131          errno = 0;                      /* evaluate function on pixel */
132          coef = funvalue(m->oargs.sarg[2], 3, col);
133 <        if (errno)
133 >        if (errno == EDOM || errno == ERANGE)
134                  goto computerr;
135          if (raymixture(r, mod[0], mod[1], coef)) {
136                  if (m->omod != OVOID)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines