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.12 by greg, Thu Jan 6 04:40:22 2011 UTC vs.
Revision 2.14 by greg, Fri Feb 11 17:31:25 2011 UTC

# Line 71 | Line 71 | fequal(double a, double b)
71          return((a <= 1e-6) & (a >= -1e-6));
72   }
73  
74 < // returns the name of the given tag
74 > /* Returns the name of the given tag */
75   #ifdef ezxml_name
76   #undef ezxml_name
77   static char *
# Line 83 | Line 83 | ezxml_name(ezxml_t xml)
83   }
84   #endif
85  
86 < // returns the given tag's character content or empty string if none
86 > /* Returns the given tag's character content or empty string if none */
87   #ifdef ezxml_txt
88   #undef ezxml_txt
89   static char *
# Line 542 | Line 542 | load_BSDF(             /* load BSDF data from file */
542          load_geometry(dp, ezxml_child(wtl, "Material"));
543          for (wld = ezxml_child(wtl, "WavelengthData");
544                                  wld != NULL; wld = wld->next) {
545 <                if (strcasecmp(ezxml_txt(ezxml_child(wld,"Wavelength")), "Visible"))
545 >                if (strcasecmp(ezxml_txt(ezxml_child(wld,"Wavelength")),
546 >                                "Visible"))
547                          continue;
548 <                wdb = ezxml_child(wld, "WavelengthDataBlock");
549 <                if (wdb == NULL) continue;
550 <                if (strcasecmp(ezxml_txt(ezxml_child(wdb,"WavelengthDataDirection")),
548 >                for (wdb = ezxml_child(wld, "WavelengthDataBlock");
549 >                                wdb != NULL; wdb = wdb->next)
550 >                        if (!strcasecmp(ezxml_txt(ezxml_child(wdb,
551 >                                        "WavelengthDataDirection")),
552                                          "Transmission Front"))
553 <                        continue;
554 <                load_bsdf_data(dp, wdb);        /* load front BTDF */
555 <                break;                          /* ignore the rest */
553 >                                break;
554 >                if (wdb != NULL) {              /* load front BTDF */
555 >                        load_bsdf_data(dp, wdb);
556 >                        break;                  /* ignore the rest */
557 >                }
558          }
559          ezxml_free(fl);                         /* done with XML file */
560          if (!check_bsdf_data(dp)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines