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 */ |
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 |
|
} |