26 |
|
|
27 |
|
char ourTempDir[TEMPLEN] = ""; /* our temporary directory */ |
28 |
|
|
29 |
< |
const char frpref[] = "frefl"; |
30 |
< |
const char ftpref[] = "ftrans"; |
31 |
< |
const char brpref[] = "brefl"; |
32 |
< |
const char btpref[] = "btrans"; |
29 |
> |
const char frpref[] = "rf"; |
30 |
> |
const char ftpref[] = "tf"; |
31 |
> |
const char brpref[] = "rb"; |
32 |
> |
const char btpref[] = "tb"; |
33 |
|
const char dsuffix[] = ".txt"; |
34 |
|
|
35 |
|
const char sph_fmat[] = "fBSDFmat"; |
381 |
|
printf("\nvoid glow arrow_glow\n0\n0\n4 1 0 1 0\n"); |
382 |
|
printf("\nvoid mixfunc arrow_mat\n4 arrow_glow void 0.25 .\n0\n0\n"); |
383 |
|
|
384 |
– |
if (front_comp & SDsampR) /* front reflection */ |
384 |
|
for (i = 0; i < NINCIDENT; i++) { |
385 |
|
get_ivector(ivec, i); |
386 |
|
nrm[0] = -ivec[0]; nrm[1] = -ivec[1]; nrm[2] = ivec[2]; |
749 |
|
strcpy(bsdf_manuf, myBSDF.makr); |
750 |
|
put_matBSDF(argv[1]); |
751 |
|
} else { |
752 |
< |
FILE *fp; |
752 |
> |
FILE *fp[4]; |
753 |
> |
if (argc > 5) { |
754 |
> |
fprintf(stderr, "%s: too many input files\n", progname); |
755 |
> |
return(1); |
756 |
> |
} |
757 |
|
for (n = 1; n < argc; n++) { |
758 |
< |
fp = fopen(argv[n], "rb"); |
759 |
< |
if (fp == NULL) { |
758 |
> |
fp[n-1] = fopen(argv[n], "rb"); |
759 |
> |
if (fp[n-1] == NULL) { |
760 |
|
fprintf(stderr, "%s: cannot open BSDF interpolant '%s'\n", |
761 |
|
progname, argv[n]); |
762 |
|
return(1); |
763 |
|
} |
764 |
< |
if (getheader(fp, rbf_headline, NULL) < 0) { |
764 |
> |
if (getheader(fp[n-1], rbf_headline, NULL) < 0) { |
765 |
|
fprintf(stderr, "%s: bad BSDF interpolant '%s'\n", |
766 |
|
progname, argv[n]); |
767 |
|
return(1); |
768 |
|
} |
766 |
– |
fclose(fp); |
769 |
|
} |
770 |
|
set_minlog(); |
771 |
|
for (n = 1; n < argc; n++) { |
772 |
< |
fp = fopen(argv[n], "rb"); |
773 |
< |
if (!load_bsdf_rep(fp)) |
772 |
> |
if (fseek(fp[n-1], 0L, SEEK_SET) < 0) { |
773 |
> |
fprintf(stderr, "%s: cannot seek on '%s'\n", |
774 |
> |
progname, argv[n]); |
775 |
|
return(1); |
776 |
< |
fclose(fp); |
776 |
> |
} |
777 |
> |
if (!load_bsdf_rep(fp[n-1])) |
778 |
> |
return(1); |
779 |
> |
fclose(fp[n-1]); |
780 |
|
if (!build_wRBF()) |
781 |
|
return(1); |
782 |
|
} |