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

Comparing ray/src/gen/mkillum4.c (file contents):
Revision 2.9 by greg, Fri Jan 25 02:11:13 2008 UTC vs.
Revision 2.10 by greg, Thu Mar 27 01:40:30 2008 UTC

# Line 254 | Line 254 | load_BSDF(             /* load BSDF data from file */
254   )
255   {
256          char                    *path;
257 <        ezxml_t                 fl, wld, wdb;
257 >        ezxml_t                 fl, wtl, wld, wdb;
258          struct BSDF_data        *dp;
259          
260          path = getpath(fname, getrlibpath(), R_OK);
# Line 270 | Line 270 | load_BSDF(             /* load BSDF data from file */
270                  return(NULL);
271          }
272          if (ezxml_error(fl)[0]) {
273 <                sprintf(errmsg, "BSDF \"%s\": %s", path, ezxml_error(fl));
273 >                sprintf(errmsg, "BSDF \"%s\" %s", path, ezxml_error(fl));
274                  error(WARNING, errmsg);
275                  ezxml_free(fl);
276                  return(NULL);
277          }
278 +        if (strcmp(ezxml_name(fl), "WindowElement")) {
279 +                sprintf(errmsg,
280 +                        "BSDF \"%s\": top level node not 'WindowElement'",
281 +                                path);
282 +                error(WARNING, errmsg);
283 +                ezxml_free(fl);
284 +                return(NULL);
285 +        }
286 +        wtl = ezxml_child(ezxml_child(fl, "Optical"), "Layer");
287          dp = (struct BSDF_data *)calloc(1, sizeof(struct BSDF_data));
288 <        for (wld = ezxml_child(fl, "WavelengthData");
288 >        for (wld = ezxml_child(wtl, "WavelengthData");
289                                  wld != NULL; wld = wld->next) {
290                  if (strcmp(ezxml_txt(ezxml_child(wld,"Wavelength")), "Visible"))
291                          continue;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines