17 |
|
#include "paths.h" |
18 |
|
#include "vars.h" |
19 |
|
|
20 |
< |
#ifdef _WIN32 |
20 |
> |
#if defined(_WIN32) || defined(_WIN64) |
21 |
|
#define DELCMD "del" |
22 |
|
#define RENAMECMD "rename" |
23 |
|
#else |
242 |
|
/* load variable values */ |
243 |
|
loadvars(rifname); |
244 |
|
/* get any additional assignments */ |
245 |
< |
for (i++; i < argc; i++) |
246 |
< |
if (setvariable(argv[i], matchvar) < 0) { |
247 |
< |
fprintf(stderr, "%s: unknown variable: %s\n", |
245 |
> |
for (i++; i < argc; i++) { |
246 |
> |
int rv = setvariable(argv[i], matchvar); |
247 |
> |
if (rv < 0) { |
248 |
> |
fprintf(stderr, "%s: unknown setting: %s\n", |
249 |
|
progname, argv[i]); |
250 |
|
quit(1); |
251 |
|
} |
252 |
+ |
if (!rv) |
253 |
+ |
fprintf(stderr, |
254 |
+ |
"%s: bad variable assignment: %s (ignored)\n", |
255 |
+ |
progname, argv[i]); |
256 |
+ |
} |
257 |
|
/* check assignments */ |
258 |
|
checkvalues(); |
259 |
|
/* check files and dates */ |
562 |
|
return; |
563 |
|
/* make octree0 */ |
564 |
|
if ((oct0date < scenedate) | (oct0date < illumdate)) { |
565 |
< |
if (touchonly && oct0date) |
566 |
< |
touch(oct0name); |
567 |
< |
else { /* build command */ |
565 |
> |
if (touchonly && (oct0date || oct1date)) { |
566 |
> |
if (oct0date) |
567 |
> |
touch(oct0name); |
568 |
> |
} else { /* build command */ |
569 |
|
if (octreedate) |
570 |
|
sprintf(combuf, "%s%s -i %s %s > %s", c_oconv, |
571 |
|
ocopts, vval(OCTREE), |
590 |
|
oct0date = octreedate; |
591 |
|
if (oct0date < illumdate) /* ditto */ |
592 |
|
oct0date = illumdate; |
593 |
< |
} |
593 |
> |
} |
594 |
|
if (touchonly && oct1date) |
595 |
|
touch(oct1name); |
596 |
|
else { |
759 |
|
{ |
760 |
|
/* BEWARE: This may be called via setdefaults(), so no assumptions */ |
761 |
|
|
762 |
< |
*mo = '\0'; |
762 |
> |
if (nprocs > 1) |
763 |
> |
sprintf(mo, " -n %d", nprocs); |
764 |
> |
else |
765 |
> |
*mo = '\0'; |
766 |
|
if (!vdef(MKPMAP)) |
767 |
|
return; |
768 |
|
if (vval(MKPMAP)[0] != '-') { |
796 |
|
{ |
797 |
|
if (vdef(EXPOSURE)) { |
798 |
|
if (vval(EXPOSURE)[0] == '+' || vval(EXPOSURE)[0] == '-') |
799 |
< |
return(.5/pow(2.,vflt(EXPOSURE))); |
800 |
< |
return(.5/vflt(EXPOSURE)); |
799 |
> |
return(.18/pow(2.,vflt(EXPOSURE))); |
800 |
> |
return(.18/vflt(EXPOSURE)); |
801 |
|
} |
802 |
|
if (vlet(ZONE) == 'E') |
803 |
|
return(10.); |
817 |
|
char pmapf[256], *bw; |
818 |
|
|
819 |
|
if (vdef(PGMAP)) { |
820 |
+ |
*op = '\0'; |
821 |
|
bw = sskip2(vval(PGMAP), 2); |
822 |
|
atos(pmapf, sizeof(pmapf), vval(PGMAP)); |
823 |
|
op = addarg(addarg(op, "-ap"), pmapf); |
840 |
|
op = addarg(addarg(op, "-ap"), pmapf); |
841 |
|
if (atoi(bw) > 0) op = addarg(op, bw); |
842 |
|
} |
843 |
< |
if (vdef(RENDER)) |
843 |
> |
if (vdef(RENDER)) { |
844 |
|
op = addarg(op, vval(RENDER)); |
845 |
+ |
bw = strstr(vval(RENDER), "-aa "); |
846 |
+ |
if (bw != NULL && atof(bw+4) <= FTINY) |
847 |
+ |
overture = 0; |
848 |
+ |
} |
849 |
|
if (rvdevice != NULL) { |
850 |
|
if (vdef(RVU)) { |
851 |
|
if (vval(RVU)[0] != '-') { |
1088 |
|
} |
1089 |
|
|
1090 |
|
|
1091 |
< |
#ifdef _WIN32 |
1091 |
> |
#if defined(_WIN32) || defined(_WIN64) |
1092 |
|
static void |
1093 |
|
setenv( /* set an environment variable */ |
1094 |
|
char *vname, |
1135 |
|
syserr(vval(OPTFILE)); |
1136 |
|
sprintf(ro, " @%s", vval(OPTFILE)); |
1137 |
|
} |
1138 |
< |
#ifdef _WIN32 |
1138 |
> |
#if defined(_WIN32) || defined(_WIN64) |
1139 |
|
else if (n > 50) { |
1140 |
|
setenv("ROPT", ro+1); |
1141 |
|
strcpy(ro, " $ROPT"); |
1313 |
|
if (cp == viewopts) /* append any additional options */ |
1314 |
|
vs++; /* skip prefixed space if unneeded */ |
1315 |
|
strcpy(cp, vs); |
1316 |
< |
#ifdef _WIN32 |
1316 |
> |
#if defined(_WIN32) || defined(_WIN64) |
1317 |
|
if (strlen(viewopts) > 40) { |
1318 |
|
setenv("VIEW", viewopts); |
1319 |
|
return("$VIEW"); |
1359 |
|
} |
1360 |
|
numview: |
1361 |
|
mv = nvalue(VIEWS, n); /* use view n */ |
1362 |
< |
if ((vn != NULL) & (mv != NULL)) |
1362 |
> |
if ((vn != NULL) & (mv != NULL)) { |
1363 |
|
if (*mv != '-') { |
1364 |
|
char *mv2 = mv; |
1365 |
|
while (*mv2 && !isspace(*mv2)) |
1367 |
|
*vn = '\0'; |
1368 |
|
} else |
1369 |
|
sprintf(vn, "%d", n+1); |
1370 |
< |
|
1370 |
> |
} |
1371 |
|
return(specview(mv)); |
1372 |
|
} |
1373 |
|
|
1381 |
|
VIEW vwr; |
1382 |
|
char buf[128]; |
1383 |
|
char *cp; |
1384 |
< |
#ifdef _WIN32 |
1384 |
> |
#if defined(_WIN32) || defined(_WIN64) |
1385 |
|
/* XXX Should we allow something like this for all platforms? */ |
1386 |
|
/* XXX Or is it still required at all? */ |
1387 |
|
again: |
1388 |
|
#endif |
1389 |
|
if (vopts == NULL) |
1390 |
|
return(-1); |
1391 |
< |
#ifdef _WIN32 |
1391 |
> |
#if defined(_WIN32) || defined(_WIN64) |
1392 |
|
if (vopts[0] == '$') { |
1393 |
|
vopts = getenv(vopts+1); |
1394 |
|
goto again; |
1535 |
|
fprintf(stderr, "%s: cannot create\n", pfile); |
1536 |
|
quit(1); |
1537 |
|
} |
1538 |
+ |
pfile[-5] = '\0'; |
1539 |
|
pfile = NULL; |
1540 |
|
} |
1541 |
|
} |