--- ray/src/cv/bsdf2ttree.c 2016/02/04 00:45:47 2.35 +++ ray/src/cv/bsdf2ttree.c 2016/10/13 16:59:29 2.39 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: bsdf2ttree.c,v 2.35 2016/02/04 00:45:47 greg Exp $"; +static const char RCSid[] = "$Id: bsdf2ttree.c,v 2.39 2016/10/13 16:59:29 greg Exp $"; #endif /* * Load measured BSDF interpolant and write out as XML file with tensor tree. @@ -27,7 +27,7 @@ static int samp_order = 6; const double ssamp_thresh = 0.35; /* number of super-samples */ #ifndef NSSAMP -#define NSSAMP 100 +#define NSSAMP 64 #endif /* limit on number of RBF lobes */ static int lobe_lim = 15000; @@ -38,7 +38,7 @@ static int do_prog = 79; static char *wrapBSDF[MAXCARG] = {"wrapBSDF", "-U"}; static int wbsdfac = 2; -/* Add argument to wrapBSDF, allocating space if isstatic */ +/* Add argument to wrapBSDF, allocating space if !isstatic */ static void add_wbsdf(const char *arg, int isstatic) { @@ -250,14 +250,14 @@ eval_isotropic(char *funame) #endif } if (pctcull >= 0) - fwrite(&bsdf, sizeof(bsdf), 1, ofp); + putbinary(&bsdf, sizeof(bsdf), 1, ofp); else fprintf(ofp, "\t%.3e\n", bsdf); if (rbf_colorimetry == RBCtristimulus) { if (pctcull >= 0) { - fwrite(&uv[0], sizeof(*uv), 1, uvfp[0]); - fwrite(&uv[1], sizeof(*uv), 1, uvfp[1]); + putbinary(&uv[0], sizeof(*uv), 1, uvfp[0]); + putbinary(&uv[1], sizeof(*uv), 1, uvfp[1]); } else { fprintf(uvfp[0], "\t%.3e\n", uv[0]); fprintf(uvfp[1], "\t%.3e\n", uv[1]); @@ -443,14 +443,14 @@ eval_anisotropic(char *funame) #endif } if (pctcull >= 0) - fwrite(&bsdf, sizeof(bsdf), 1, ofp); + putbinary(&bsdf, sizeof(bsdf), 1, ofp); else fprintf(ofp, "\t%.3e\n", bsdf); if (rbf_colorimetry == RBCtristimulus) { if (pctcull >= 0) { - fwrite(&uv[0], sizeof(*uv), 1, uvfp[0]); - fwrite(&uv[1], sizeof(*uv), 1, uvfp[1]); + putbinary(&uv[0], sizeof(*uv), 1, uvfp[0]); + putbinary(&uv[1], sizeof(*uv), 1, uvfp[1]); } else { fprintf(uvfp[0], "\t%.3e\n", uv[0]); fprintf(uvfp[1], "\t%.3e\n", uv[1]); @@ -495,7 +495,7 @@ eval_anisotropic(char *funame) } } -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) /* Execute wrapBSDF command (may never return) */ static int wrap_up(void)