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

Comparing ray/src/cv/pkgBSDF.c (file contents):
Revision 2.1 by greg, Thu Jun 23 18:05:18 2011 UTC vs.
Revision 2.2 by greg, Thu Aug 25 04:32:29 2011 UTC

# Line 5 | Line 5 | static const char RCSid[] = "$Id$";
5   * Take BSDF XML file and generate a referencing Radiance object
6   */
7  
8 + #include "rtio.h"
9   #include "paths.h"
10   #include "bsdf.h"
11  
# Line 82 | Line 83 | geomBSDF(const SDData *bsp)
83  
84   /* Load a BSDF XML file and produce a corresponding Radiance object */
85   static int
86 < cvtBSDF(const char *fname)
86 > cvtBSDF(char *fname)
87   {
88          int     retOK;
89          SDData  myBSDF;
90 <                                        /* load the XML file */
90 >        char    *pname;
91 >                                        /* find and load the XML file */
92          retOK = strlen(fname);
93          if (retOK < 5 || strcmp(fname+retOK-4, ".xml")) {
94                  fprintf(stderr, "%s: input does not end in '.xml'\n", fname);
95                  return(0);
96          }
97 +        pname = getpath(fname, getrlibpath(), R_OK);
98 +        if (pname == NULL) {
99 +                fprintf(stderr, "%s: cannot find BSDF file\n", fname);
100 +                return(0);
101 +        }
102          SDclearBSDF(&myBSDF, fname);
103 <        if (SDreportEnglish(SDloadFile(&myBSDF, fname), stderr))
103 >        if (SDreportEnglish(SDloadFile(&myBSDF, pname), stderr))
104                  return(0);
105          retOK = (myBSDF.dim[0] > FTINY) & (myBSDF.dim[1] > FTINY);
106          if (!retOK) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines