--- ray/src/util/rad.c 2015/08/02 01:32:15 2.120 +++ ray/src/util/rad.c 2020/04/07 00:49:09 2.127 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.120 2015/08/02 01:32:15 greg Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.127 2020/04/07 00:49:09 greg Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -17,7 +17,7 @@ static const char RCSid[] = "$Id: rad.c,v 2.120 2015/0 #include "paths.h" #include "vars.h" -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) #define DELCMD "del" #define RENAMECMD "rename" #else @@ -556,9 +556,10 @@ oconv(void) /* run oconv and mkillum if necessary * return; /* make octree0 */ if ((oct0date < scenedate) | (oct0date < illumdate)) { - if (touchonly && oct0date) - touch(oct0name); - else { /* build command */ + if (touchonly && (oct0date || oct1date)) { + if (oct0date) + touch(oct0name); + } else { /* build command */ if (octreedate) sprintf(combuf, "%s%s -i %s %s > %s", c_oconv, ocopts, vval(OCTREE), @@ -583,7 +584,7 @@ oconv(void) /* run oconv and mkillum if necessary * oct0date = octreedate; if (oct0date < illumdate) /* ditto */ oct0date = illumdate; - } + } if (touchonly && oct1date) touch(oct1name); else { @@ -752,7 +753,10 @@ mkpmapopts( /* get mkpmap options */ { /* BEWARE: This may be called via setdefaults(), so no assumptions */ - *mo = '\0'; + if (nprocs > 1) + sprintf(mo, " -n %d", nprocs); + else + *mo = '\0'; if (!vdef(MKPMAP)) return; if (vval(MKPMAP)[0] != '-') { @@ -806,6 +810,13 @@ renderopts( /* set rendering options */ { char pmapf[256], *bw; + if (vdef(PGMAP)) { + *op = '\0'; + bw = sskip2(vval(PGMAP), 2); + atos(pmapf, sizeof(pmapf), vval(PGMAP)); + op = addarg(addarg(op, "-ap"), pmapf); + if (atoi(bw) > 0) op = addarg(op, bw); + } switch(vscale(QUALITY)) { case LOW: lowqopts(op, po); @@ -817,20 +828,18 @@ renderopts( /* set rendering options */ hiqopts(op, po); break; } - if (vdef(PGMAP)) { - bw = sskip2(vval(PGMAP), 2); - atos(pmapf, sizeof(pmapf), vval(PGMAP)); - op = addarg(addarg(op, "-ap"), pmapf); - if (atoi(bw) > 0) op = addarg(op, bw); - } if (vdef(PCMAP)) { bw = sskip2(vval(PCMAP), 2); atos(pmapf, sizeof(pmapf), vval(PCMAP)); op = addarg(addarg(op, "-ap"), pmapf); if (atoi(bw) > 0) op = addarg(op, bw); } - if (vdef(RENDER)) + if (vdef(RENDER)) { op = addarg(op, vval(RENDER)); + bw = strstr(vval(RENDER), "-aa "); + if (bw != NULL && atof(bw+4) <= FTINY) + overture = 0; + } if (rvdevice != NULL) { if (vdef(RVU)) { if (vval(RVU)[0] != '-') { @@ -1073,7 +1082,7 @@ hiqopts( /* high quality rendering options */ } -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) static void setenv( /* set an environment variable */ char *vname, @@ -1120,7 +1129,7 @@ xferopts( /* transfer options if indicated */ syserr(vval(OPTFILE)); sprintf(ro, " @%s", vval(OPTFILE)); } -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) else if (n > 50) { setenv("ROPT", ro+1); strcpy(ro, " $ROPT"); @@ -1298,7 +1307,7 @@ specview( /* get proper view spec from vs */ if (cp == viewopts) /* append any additional options */ vs++; /* skip prefixed space if unneeded */ strcpy(cp, vs); -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) if (strlen(viewopts) > 40) { setenv("VIEW", viewopts); return("$VIEW"); @@ -1344,7 +1353,7 @@ getview( /* get view n, or NULL if none */ } numview: mv = nvalue(VIEWS, n); /* use view n */ - if ((vn != NULL) & (mv != NULL)) + if ((vn != NULL) & (mv != NULL)) { if (*mv != '-') { char *mv2 = mv; while (*mv2 && !isspace(*mv2)) @@ -1352,7 +1361,7 @@ numview: *vn = '\0'; } else sprintf(vn, "%d", n+1); - + } return(specview(mv)); } @@ -1366,14 +1375,14 @@ myprintview( /* print out selected view */ VIEW vwr; char buf[128]; char *cp; -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) /* XXX Should we allow something like this for all platforms? */ /* XXX Or is it still required at all? */ again: #endif if (vopts == NULL) return(-1); -#ifdef _WIN32 +#if defined(_WIN32) || defined(_WIN64) if (vopts[0] == '$') { vopts = getenv(vopts+1); goto again; @@ -1520,6 +1529,7 @@ rpict( /* run rpict and pfilt for each view */ fprintf(stderr, "%s: cannot create\n", pfile); quit(1); } + pfile[-5] = '\0'; pfile = NULL; } }