| 94 |
|
|
| 95 |
|
#define renderopts (*setqopts[vscale(QUALITY)]) |
| 96 |
|
|
| 97 |
+ |
/* overture calculation file */ |
| 98 |
+ |
#ifdef NIX |
| 99 |
+ |
char overfile[] = "overture.raw"; |
| 100 |
+ |
#else |
| 101 |
+ |
char overfile[] = "/dev/null"; |
| 102 |
+ |
#endif |
| 103 |
+ |
|
| 104 |
|
extern long fdate(), time(); |
| 105 |
|
|
| 106 |
|
long scenedate; /* date of latest scene or object file */ |
| 166 |
|
/* print all values if requested */ |
| 167 |
|
if (explicate) |
| 168 |
|
printvals(); |
| 169 |
< |
/* run simulation */ |
| 169 |
> |
/* build octree */ |
| 170 |
|
oconv(); |
| 171 |
+ |
/* check date on ambient file */ |
| 172 |
+ |
checkambfile(); |
| 173 |
+ |
/* run simulation */ |
| 174 |
|
renderopts(ropts); |
| 175 |
|
xferopts(ropts); |
| 176 |
|
if (rvdevice != NULL) |
| 557 |
|
} |
| 558 |
|
|
| 559 |
|
|
| 560 |
+ |
checkambfile() /* check date on ambient file */ |
| 561 |
+ |
{ |
| 562 |
+ |
long afdate; |
| 563 |
+ |
|
| 564 |
+ |
if (vdef(AMBFILE)) { |
| 565 |
+ |
afdate = fdate(vval(AMBFILE)); |
| 566 |
+ |
if (afdate >= 0 & octreedate > afdate) |
| 567 |
+ |
rmfile(vval(AMBFILE)); |
| 568 |
+ |
} |
| 569 |
+ |
} |
| 570 |
+ |
|
| 571 |
+ |
|
| 572 |
|
double |
| 573 |
|
ambval() /* compute ambient value */ |
| 574 |
|
{ |
| 1044 |
|
else |
| 1045 |
|
badvalue(REPORT); |
| 1046 |
|
} |
| 1025 |
– |
/* check date on ambient file */ |
| 1026 |
– |
if (vdef(AMBFILE)) { |
| 1027 |
– |
long afdate = fdate(vval(AMBFILE)); |
| 1028 |
– |
if (afdate >= 0 & octreedate > afdate) |
| 1029 |
– |
rmfile(vval(AMBFILE)); |
| 1030 |
– |
} |
| 1047 |
|
/* do each view */ |
| 1048 |
|
vn = 0; |
| 1049 |
|
while ((vw = getview(vn++, vs)) != NULL) { |
| 1063 |
|
sprintf(combuf, |
| 1064 |
|
"rpict%s %s%s -x 64 -y 64 -ps 1 %s > %s", |
| 1065 |
|
rep, vw, opts, |
| 1066 |
< |
vval(OCTREE), rawfile); |
| 1066 |
> |
vval(OCTREE), overfile); |
| 1067 |
|
if (runcom(combuf)) { |
| 1068 |
|
fprintf(stderr, |
| 1069 |
< |
"%s: error in overture for view %s\n\t%s removed\n", |
| 1070 |
< |
progname, vs, rawfile); |
| 1055 |
< |
unlink(rawfile); |
| 1069 |
> |
"%s: error in overture for view %s\n", |
| 1070 |
> |
progname, vs); |
| 1071 |
|
exit(1); |
| 1072 |
|
} |
| 1073 |
+ |
#ifdef NIX |
| 1074 |
+ |
rmfile(overfile); |
| 1075 |
+ |
#endif |
| 1076 |
|
} |
| 1077 |
|
sprintf(combuf, "rpict%s %s %s%s %s > %s", |
| 1078 |
|
rep, vw, res, opts, |