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

Comparing ray/src/cv/bsdf2klems.c (file contents):
Revision 2.15 by greg, Thu Aug 21 10:33:48 2014 UTC vs.
Revision 2.19 by greg, Sun Jan 24 14:28:51 2016 UTC

# Line 38 | Line 38 | static int             do_prog = 79;
38   static void
39   prog_show(double frac)
40   {
41 <        char    pbar[256];
42 <        int     nchars;
41 >        static unsigned call_cnt = 0;
42 >        static char     lastc[] = "-\\|/";
43 >        char            pbar[256];
44 >        int             nchars;
45  
46          if (do_prog <= 1) return;
47          if (do_prog > sizeof(pbar)-2)
48                  do_prog = sizeof(pbar)-2;
49          if (frac < 0) frac = 0;
50 <        else if (frac > 1) frac = 1;
51 <        nchars = do_prog*frac + .5;
50 >        else if (frac >= 1) frac = .9999;
51 >        nchars = do_prog*frac;
52          pbar[0] = '\r';
53          memset(pbar+1, '*', nchars);
54 <        memset(pbar+1+nchars, '-', do_prog-nchars);
54 >        pbar[nchars+1] = lastc[call_cnt++ & 3];
55 >        memset(pbar+2+nchars, '-', do_prog-nchars-1);
56          pbar[do_prog+1] = '\0';
57          fputs(pbar, stderr);
58   }
# Line 204 | Line 207 | eval_bsdf(const char *fname)
207          double          sum;
208          int             i, j, n;
209  
210 +        initurand(npsamps);
211          SDclearBSDF(&bsd, fname);               /* load BSDF file */
212          if ((ec = SDloadFile(&bsd, fname)) != SDEnone)
213                  goto err;
# Line 376 | Line 380 | eval_rbf(void)
380  
381                      sum += eval_rbfrep(rbf, vout);
382                  }
379                fo_getvec(vout, j+.5, abp);     /* use centered secant */
383                  bsdfarr[j*abp->nangles + i] = sum / (double)npsamps;
384              }
385              if (rbf != NULL)
# Line 443 | Line 446 | main(int argc, char *argv[])
446                          goto userr;
447                  }
448          if (single_plane_incident >= 0) {       /* function-based BSDF? */
449 <                if (i != argc-1 || fundefined(argv[i]) != 6) {
449 >                if (i != argc-1 || fundefined(argv[i]) < 3) {
450                          fprintf(stderr,
451          "%s: need single function with 6 arguments: bsdf(ix,iy,iz,ox,oy,oz)\n",
452                                          progname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines