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.16 by greg, Wed Oct 1 23:32:42 2014 UTC vs.
Revision 2.17 by greg, Tue May 5 22:16:49 2015 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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines