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

Comparing ray/src/cv/bsdf2ttree.c (file contents):
Revision 2.29 by greg, Thu Aug 21 10:33:48 2014 UTC vs.
Revision 2.33 by greg, Tue Feb 2 18:08:32 2016 UTC

# Line 19 | Line 19 | static const char RCSid[] = "$Id$";
19                                  /* global argv[0] */
20   char                    *progname;
21                                  /* percentage to cull (<0 to turn off) */
22 < double                  pctcull = 90.;
22 > static double           pctcull = 90.;
23                                  /* sampling order */
24 < int                     samp_order = 6;
24 > static int              samp_order = 6;
25                                  /* super-sampling threshold */
26   const double            ssamp_thresh = 0.35;
27                                  /* number of super-samples */
# Line 41 | Line 41 | static int             do_prog = 79;
41   static void
42   prog_show(double frac)
43   {
44 <        char    pbar[256];
45 <        int     nchars;
44 >        static unsigned call_cnt = 0;
45 >        static char     lastc[] = "-\\|/";
46 >        char            pbar[256];
47 >        int             nchars;
48  
49 <        if (do_prog <= 0) return;
49 >        if (do_prog <= 1) return;
50          if (do_prog > sizeof(pbar)-2)
51                  do_prog = sizeof(pbar)-2;
52          if (frac < 0) frac = 0;
53 <        else if (frac > 1) frac = 1;
54 <        nchars = do_prog*frac + .5;
53 >        else if (frac >= 1) frac = .9999;
54 >        nchars = do_prog*frac;
55          pbar[0] = '\r';
56          memset(pbar+1, '*', nchars);
57 <        memset(pbar+1+nchars, '-', do_prog-nchars);
57 >        pbar[nchars+1] = lastc[call_cnt++ & 3];
58 >        memset(pbar+2+nchars, '-', do_prog-nchars-1);
59          pbar[do_prog+1] = '\0';
60          fputs(pbar, stderr);
61   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines