| 155 |
|
loadvars(rifname); |
| 156 |
|
/* get any additional assignments */ |
| 157 |
|
for (i++; i < argc; i++) |
| 158 |
< |
setvariable(argv[i]); |
| 158 |
> |
if (setvariable(argv[i], matchvar) < 0) { |
| 159 |
> |
fprintf(stderr, "%s: unknown variable: %s\n", |
| 160 |
> |
progname, argv[i]); |
| 161 |
> |
quit(1); |
| 162 |
> |
} |
| 163 |
|
/* check assignments */ |
| 164 |
|
checkvalues(); |
| 165 |
|
/* check files and dates */ |
| 180 |
|
rview(ropts, popts); |
| 181 |
|
else |
| 182 |
|
rpict(ropts, popts); |
| 183 |
< |
exit(0); |
| 183 |
> |
quit(0); |
| 184 |
|
userr: |
| 185 |
|
fprintf(stderr, |
| 186 |
|
"Usage: %s [-s][-n][-t][-e][-V][-v view][-o dev] rfile [VAR=value ..]\n", |
| 187 |
|
progname); |
| 188 |
< |
exit(1); |
| 188 |
> |
quit(1); |
| 189 |
|
} |
| 190 |
|
|
| 191 |
|
|
| 280 |
|
if (!octreedate & !scenedate & !illumdate) { |
| 281 |
|
fprintf(stderr, "%s: need '%s' or '%s' or '%s'\n", progname, |
| 282 |
|
vnam(OCTREE), vnam(SCENE), vnam(ILLUM)); |
| 283 |
< |
exit(1); |
| 283 |
> |
quit(1); |
| 284 |
|
} |
| 285 |
|
matdate = checklast(vval(MATERIAL)); |
| 286 |
|
} |
| 310 |
|
fprintf(stderr, |
| 311 |
|
"%s: error reading bounding box from getbbox\n", |
| 312 |
|
progname); |
| 313 |
< |
exit(1); |
| 313 |
> |
quit(1); |
| 314 |
|
} |
| 315 |
|
for (i = 0; i < 3; i++) |
| 316 |
|
if (max[i] - min[i] > osiz) |
| 328 |
|
fprintf(stderr, |
| 329 |
|
"%s: error reading bounding cube from getinfo\n", |
| 330 |
|
progname); |
| 331 |
< |
exit(1); |
| 331 |
> |
quit(1); |
| 332 |
|
} |
| 333 |
|
pclose(fp); |
| 334 |
|
} |
| 406 |
|
"%s: error generating octree\n\t%s removed\n", |
| 407 |
|
progname, vval(OCTREE)); |
| 408 |
|
unlink(vval(OCTREE)); |
| 409 |
< |
exit(1); |
| 409 |
> |
quit(1); |
| 410 |
|
} |
| 411 |
|
} |
| 412 |
|
octreedate = time((time_t *)NULL); |
| 437 |
|
"%s: error generating octree\n\t%s removed\n", |
| 438 |
|
progname, oct0name); |
| 439 |
|
unlink(oct0name); |
| 440 |
< |
exit(1); |
| 440 |
> |
quit(1); |
| 441 |
|
} |
| 442 |
|
} |
| 443 |
|
oct0date = time((time_t *)NULL); |
| 457 |
|
fprintf(stderr, "%s: error running mkillum\n", |
| 458 |
|
progname); |
| 459 |
|
unlink(illumtmp); |
| 460 |
< |
exit(1); |
| 460 |
> |
quit(1); |
| 461 |
|
} |
| 462 |
|
/* make octree1 (frozen) */ |
| 463 |
|
if (octreedate) |
| 475 |
|
progname, oct1name); |
| 476 |
|
unlink(oct1name); |
| 477 |
|
unlink(illumtmp); |
| 478 |
< |
exit(1); |
| 478 |
> |
quit(1); |
| 479 |
|
} |
| 480 |
|
rmfile(illumtmp); |
| 481 |
|
} |
| 616 |
|
overture = 0; |
| 617 |
|
switch (vscale(VARIABILITY)) { |
| 618 |
|
case LOW: |
| 619 |
< |
op = addarg(op, "-aa .4 -ad 64"); |
| 619 |
> |
op = addarg(op, "-aw 128 -aa .4 -ad 64"); |
| 620 |
|
break; |
| 621 |
|
case MEDIUM: |
| 622 |
< |
op = addarg(op, "-aa .3 -ad 128"); |
| 622 |
> |
op = addarg(op, "-aw 1024 -aa .3 -ad 128"); |
| 623 |
|
break; |
| 624 |
|
case HIGH: |
| 625 |
|
op = addarg(op, "-aa .25 -ad 256"); |
| 695 |
|
overture = 0; |
| 696 |
|
switch (vscale(VARIABILITY)) { |
| 697 |
|
case LOW: |
| 698 |
< |
op = addarg(op, "-aa .25 -ad 196 -as 0"); |
| 698 |
> |
op = addarg(op, "-aw 128 -aa .25 -ad 196 -as 0"); |
| 699 |
|
break; |
| 700 |
|
case MEDIUM: |
| 701 |
< |
op = addarg(op, "-aa .2 -ad 400 -as 64"); |
| 701 |
> |
op = addarg(op, "-aw 1024 -aa .2 -ad 400 -as 64"); |
| 702 |
|
break; |
| 703 |
|
case HIGH: |
| 704 |
|
op = addarg(op, "-aa .15 -ad 768 -as 196"); |
| 771 |
|
overture = 0; |
| 772 |
|
switch (vscale(VARIABILITY)) { |
| 773 |
|
case LOW: |
| 774 |
< |
op = addarg(op, "-aa .15 -ad 256 -as 0"); |
| 774 |
> |
op = addarg(op, "-aw 128 -aa .15 -ad 256 -as 0"); |
| 775 |
|
break; |
| 776 |
|
case MEDIUM: |
| 777 |
< |
op = addarg(op, "-aa .125 -ad 512 -as 256"); |
| 777 |
> |
op = addarg(op, "-aw 1024 -aa .125 -ad 512 -as 256"); |
| 778 |
|
break; |
| 779 |
|
case HIGH: |
| 780 |
|
op = addarg(op, "-aa .08 -ad 1024 -as 512"); |
| 999 |
|
} |
| 1000 |
|
/* view number? */ |
| 1001 |
|
if (isint(viewselect)) |
| 1002 |
< |
return(specview(nvalue(vv+VIEW, atoi(viewselect)-1))); |
| 1002 |
> |
return(specview(nvalue(VIEW, atoi(viewselect)-1))); |
| 1003 |
|
/* check list */ |
| 1004 |
< |
while ((mv = nvalue(vv+VIEW, n++)) != NULL) |
| 1004 |
> |
while ((mv = nvalue(VIEW, n++)) != NULL) |
| 1005 |
|
if (matchword(viewselect, mv)) |
| 1006 |
|
return(specview(mv)); |
| 1007 |
|
return(specview(viewselect)); /* standard view? */ |
| 1008 |
|
} |
| 1009 |
< |
mv = nvalue(vv+VIEW, n); /* use view n */ |
| 1009 |
> |
mv = nvalue(VIEW, n); /* use view n */ |
| 1010 |
|
if (vn != NULL & mv != NULL) { |
| 1011 |
|
register char *mv2 = mv; |
| 1012 |
|
if (*mv2 != '-') |
| 1093 |
|
strcat(combuf, oct1name); |
| 1094 |
|
if (runcom(combuf)) { /* run it */ |
| 1095 |
|
fprintf(stderr, "%s: error running rview\n", progname); |
| 1096 |
< |
exit(1); |
| 1096 |
> |
quit(1); |
| 1097 |
|
} |
| 1098 |
|
} |
| 1099 |
|
|
| 1190 |
|
fprintf(stderr, |
| 1191 |
|
"%s: error in overture for view %s\n", |
| 1192 |
|
progname, vs); |
| 1193 |
< |
exit(1); |
| 1193 |
> |
quit(1); |
| 1194 |
|
} |
| 1195 |
|
#ifdef NIX |
| 1196 |
|
rmfile(overfile); |
| 1203 |
|
if (runcom(combuf)) { /* run rpict */ |
| 1204 |
|
fprintf(stderr, "%s: error rendering view %s\n", |
| 1205 |
|
progname, vs); |
| 1206 |
< |
exit(1); |
| 1206 |
> |
quit(1); |
| 1207 |
|
} |
| 1208 |
|
if (!vdef(RAWFILE) || strcmp(vval(RAWFILE),vval(PICTURE))) { |
| 1209 |
|
/* build pfilt command */ |
| 1218 |
|
"%s: error filtering view %s\n\t%s removed\n", |
| 1219 |
|
progname, vs, picfile); |
| 1220 |
|
unlink(picfile); |
| 1221 |
< |
exit(1); |
| 1221 |
> |
quit(1); |
| 1222 |
|
} |
| 1223 |
|
} |
| 1224 |
|
/* remove/rename raw file */ |
| 1301 |
|
sprintf(evp, "%s=%s", vname, value); |
| 1302 |
|
if (putenv(evp) != 0) { |
| 1303 |
|
fprintf(stderr, "%s: out of environment space\n", progname); |
| 1304 |
< |
exit(1); |
| 1304 |
> |
quit(1); |
| 1305 |
|
} |
| 1306 |
|
if (!silent) |
| 1307 |
|
printf("set %s\n", evp); |
| 1314 |
|
{ |
| 1315 |
|
fprintf(stderr, "%s: bad value for variable '%s'\n", |
| 1316 |
|
progname, vnam(vc)); |
| 1317 |
< |
exit(1); |
| 1317 |
> |
quit(1); |
| 1318 |
|
} |
| 1319 |
|
|
| 1320 |
|
|
| 1322 |
|
char *s; |
| 1323 |
|
{ |
| 1324 |
|
perror(s); |
| 1325 |
< |
exit(1); |
| 1325 |
> |
quit(1); |
| 1326 |
> |
} |
| 1327 |
> |
|
| 1328 |
> |
|
| 1329 |
> |
quit(ec) /* exit program */ |
| 1330 |
> |
int ec; |
| 1331 |
> |
{ |
| 1332 |
> |
exit(ec); |
| 1333 |
|
} |