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 |
|
{ |
686 |
|
else |
687 |
|
op = addarg(op, "-ds .3"); |
688 |
|
op = addarg(op, "-dt .1 -dc .5 -dr 1 -sj .7 -st .15"); |
689 |
< |
sprintf(op, " -ab %d", overture=vint(INDIRECT)); |
690 |
< |
op += strlen(op); |
689 |
> |
if (overture = vint(INDIRECT)) { |
690 |
> |
sprintf(op, " -ab %d", overture); |
691 |
> |
op += strlen(op); |
692 |
> |
} |
693 |
|
if (vdef(AMBFILE)) { |
694 |
|
sprintf(op, " -af %s", vval(AMBFILE)); |
695 |
|
op += strlen(op); |
1044 |
|
else |
1045 |
|
badvalue(REPORT); |
1046 |
|
} |
1023 |
– |
/* check date on ambient file */ |
1024 |
– |
if (vdef(AMBFILE)) { |
1025 |
– |
long afdate = fdate(vval(AMBFILE)); |
1026 |
– |
if (afdate >= 0 & octreedate > afdate) |
1027 |
– |
rmfile(vval(AMBFILE)); |
1028 |
– |
} |
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); |
1053 |
< |
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, |