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

Comparing ray/src/common/bsdf.c (file contents):
Revision 2.3 by greg, Sat Jul 3 02:50:22 2010 UTC vs.
Revision 2.4 by greg, Sat Jul 3 05:28:05 2010 UTC

# Line 23 | Line 23 | typedef struct {
23          }       lat[MAXLATS+1];         /* latitudes */
24   } ANGLE_BASIS;
25  
26 < #define MAXABASES       5               /* limit on defined bases */
26 > #define MAXABASES       7               /* limit on defined bases */
27  
28   static ANGLE_BASIS      abase_list[MAXABASES] = {
29          {
# Line 200 | Line 200 | ab_getndxR(            /* get index corresponding to the reverse
200  
201  
202   static void
203 < load_angle_basis(       /* load BSDF angle basis */
203 > load_angle_basis(       /* load custom BSDF angle basis */
204          ezxml_t wab
205   )
206   {
# Line 208 | Line 208 | load_angle_basis(      /* load BSDF angle basis */
208          ezxml_t wbb;
209          int     i;
210          
211 <        if (abname == NULL || !*abname)
211 >        if (!abname || !*abname)
212                  return;
213          for (i = nabases; i--; )
214                  if (!strcmp(abname, abase_list[i].name))
215 <                        return;         /* XXX assume it's the same */
215 >                        return;         /* assume it's the same */
216          if (nabases >= MAXABASES)
217                  error(INTERNAL, "too many angle bases");
218          strcpy(abase_list[nabases].name, abname);
# Line 250 | Line 250 | load_bsdf_data(                /* load BSDF distribution for this wa
250          char  *sdata;
251          int  i;
252          
253 <        if ((cbasis == NULL || !*cbasis) | (rbasis == NULL || !*rbasis)) {
253 >        if ((!cbasis || !*cbasis) | (!rbasis || !*rbasis)) {
254                  error(WARNING, "missing column/row basis for BSDF");
255                  return;
256          }
257        /* XXX need to add routines for loading in foreign bases */
257          for (i = nabases; i--; )
258                  if (!strcmp(cbasis, abase_list[i].name)) {
259                          dp->ninc = abase_list[i].nangles;
# Line 265 | Line 264 | load_bsdf_data(                /* load BSDF distribution for this wa
264                          break;
265                  }
266          if (i < 0) {
267 <                sprintf(errmsg, "unsupported ColumnAngleBasis '%s'", cbasis);
267 >                sprintf(errmsg, "undefined ColumnAngleBasis '%s'", cbasis);
268                  error(WARNING, errmsg);
269                  return;
270          }
# Line 279 | Line 278 | load_bsdf_data(                /* load BSDF distribution for this wa
278                          break;
279                  }
280          if (i < 0) {
281 <                sprintf(errmsg, "unsupported RowAngleBasis '%s'", cbasis);
281 >                sprintf(errmsg, "undefined RowAngleBasis '%s'", cbasis);
282                  error(WARNING, errmsg);
283                  return;
284          }
285                                  /* read BSDF data */
286          sdata  = ezxml_txt(ezxml_child(wdb,"ScatteringData"));
287 <        if (sdata == NULL || !*sdata) {
287 >        if (!sdata || !*sdata) {
288                  error(WARNING, "missing BSDF ScatteringData");
289                  return;
290          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines