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

Comparing ray/src/cv/pabopto2bsdf.c (file contents):
Revision 2.4 by greg, Sun Jun 30 14:46:29 2013 UTC vs.
Revision 2.5 by greg, Thu Sep 12 16:09:31 2013 UTC

# Line 62 | Line 62 | init_pabopto_inp(const int i, const char *fname)
62          inpfile[i].theta = inpfile[i].phi = -10001.;
63                                  /* read header information */
64          while ((c = getc(fp)) == '#' || c == EOF) {
65 +                char    typ[32];
66                  if (fgets(buf, sizeof(buf), fp) == NULL) {
67                          fputs(fname, stderr);
68                          fputs(": unexpected EOF\n", stderr);
69                          fclose(fp);
70                          return(0);
71                  }
72 <                if (!strcmp(buf, "format: theta phi DSF\n")) {
73 <                        inpfile[i].isDSF = 1;
74 <                        continue;
75 <                }
76 <                if (!strcmp(buf, "format: theta phi BSDF\n")) {
77 <                        inpfile[i].isDSF = 0;
78 <                        continue;
72 >                if (sscanf(buf, "format: theta phi %s", typ) == 1) {
73 >                        if (!strcasecmp(typ, "DSF")) {
74 >                                inpfile[i].isDSF = 1;
75 >                                continue;
76 >                        }
77 >                        if (!strcasecmp(typ, "BSDF")) {
78 >                                inpfile[i].isDSF = 0;
79 >                                continue;
80 >                        }
81                  }
82                  if (sscanf(buf, "intheta %lf", &inpfile[i].theta) == 1)
83                          continue;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines