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.18 by greg, Wed Mar 19 00:19:11 2014 UTC vs.
Revision 2.19 by greg, Wed Mar 19 19:48:57 2014 UTC

# Line 114 | Line 114 | init_pabopto_inp(const int i, const char *fname)
114   static int
115   add_pabopto_inp(const int i)
116   {
117 <        FILE    *fp = fopen(inpfile[i].fname, "r");
118 <        double  theta_out, phi_out, val;
119 <        int     n, c;
117 >        static int      lastnew = -1;
118 >        FILE            *fp = fopen(inpfile[i].fname, "r");
119 >        double          theta_out, phi_out, val;
120 >        int             n, c;
121          
122          if (fp == NULL || fseek(fp, inpfile[i].dstart, 0) == EOF) {
123                  fputs(inpfile[i].fname, stderr);
# Line 125 | Line 126 | add_pabopto_inp(const int i)
126          }
127                                          /* prepare input grid */
128          angle_eps = 180./2./GRIDRES;
129 <        if (!i || cmp_inang(&inpfile[i-1], &inpfile[i])) {
130 <                if (i)                  /* need to process previous incidence */
129 >        if (lastnew < 0 || cmp_inang(&inpfile[lastnew], &inpfile[i])) {
130 >                if (lastnew >= 0)       /* need to process previous incidence */
131                          make_rbfrep();
132   #ifdef DEBUG
133                  fprintf(stderr, "New incident (theta,phi)=(%f,%f)\n",
134                                          inpfile[i].theta, inpfile[i].phi);
135   #endif
136                  new_bsdf_data(inpfile[i].theta, inpfile[i].phi);
137 +                lastnew = i;
138          }
139   #ifdef DEBUG
140          fprintf(stderr, "Loading measurements from '%s'...\n", inpfile[i].fname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines