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.30 by greg, Tue May 5 22:16:49 2015 UTC

# 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