| 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 |
|
} |
| 202 |
|
iovec[5] = output_orient * |
| 203 |
|
sqrt(1. - iovec[3]*iovec[3] - iovec[4]*iovec[4]); |
| 204 |
|
if (funame == NULL) |
| 205 |
< |
bsdf = eval_rbfrep(rbf, iovec+3) * |
| 203 |
< |
output_orient/iovec[5]; |
| 205 |
> |
bsdf = eval_rbfrep(rbf, iovec+3); |
| 206 |
|
else { |
| 207 |
|
if (assignD) { |
| 208 |
|
varset("Dx", '=', -iovec[3]); |
| 315 |
|
iovec[5] = output_orient * |
| 316 |
|
sqrt(1. - iovec[3]*iovec[3] - iovec[4]*iovec[4]); |
| 317 |
|
if (funame == NULL) |
| 318 |
< |
bsdf = eval_rbfrep(rbf, iovec+3) * |
| 317 |
< |
output_orient/iovec[5]; |
| 318 |
> |
bsdf = eval_rbfrep(rbf, iovec+3); |
| 319 |
|
else { |
| 320 |
|
if (assignD) { |
| 321 |
|
varset("Dx", '=', -iovec[3]); |