110 |
|
int explicate = 0; /* explicate variables */ |
111 |
|
int silent = 0; /* do work silently */ |
112 |
|
int noaction = 0; /* don't do anything */ |
113 |
< |
int vwonly = 0; /* print view only */ |
113 |
> |
int sayview = 0; /* print view out */ |
114 |
|
char *rvdevice = NULL; /* rview output device */ |
115 |
|
char *viewselect = NULL; /* specific view only */ |
116 |
|
|
117 |
|
int overture = 0; /* overture calculation needed */ |
118 |
|
|
119 |
|
char *progname; /* global argv[0] */ |
120 |
+ |
char *rifname; /* global rad input file name */ |
121 |
|
|
122 |
|
char radname[MAXPATH]; /* root Radiance file name */ |
123 |
|
|
146 |
|
rvdevice = argv[++i]; |
147 |
|
break; |
148 |
|
case 'V': |
149 |
< |
vwonly++; |
150 |
< |
/* fall through */ |
149 |
> |
sayview++; |
150 |
> |
break; |
151 |
|
case 'v': |
152 |
|
viewselect = argv[++i]; |
153 |
|
break; |
156 |
|
} |
157 |
|
if (i >= argc) |
158 |
|
goto userr; |
159 |
+ |
rifname = argv[i]; |
160 |
|
/* assign Radiance root file name */ |
161 |
< |
rootname(radname, argv[i]); |
161 |
> |
rootname(radname, rifname); |
162 |
|
/* load variable values */ |
163 |
< |
load(argv[i]); |
163 |
> |
load(rifname); |
164 |
|
/* get any additional assignments */ |
165 |
|
for (i++; i < argc; i++) |
166 |
|
setvariable(argv[i]); |
173 |
|
/* print all values if requested */ |
174 |
|
if (explicate) |
175 |
|
printvals(); |
174 |
– |
/* print view and exit? */ |
175 |
– |
if (vwonly) |
176 |
– |
exit(printview()==0 ? 0 : 1); |
176 |
|
/* build octree */ |
177 |
|
oconv(); |
178 |
|
/* check date on ambient file */ |
1012 |
|
} |
1013 |
|
|
1014 |
|
|
1015 |
< |
printview() /* print out selected view */ |
1015 |
> |
printview(vopts) /* print out selected view */ |
1016 |
> |
register char *vopts; |
1017 |
|
{ |
1018 |
|
extern char *atos(); |
1019 |
|
char buf[256]; |
1020 |
|
FILE *fp; |
1021 |
< |
register char *vopts, *cp; |
1021 |
> |
register char *cp; |
1022 |
|
|
1023 |
– |
vopts = getview(0, NULL); |
1023 |
|
if (vopts == NULL) |
1024 |
|
return(-1); |
1025 |
|
fputs("VIEW=", stdout); |
1062 |
|
rview(opts) /* run rview with first view */ |
1063 |
|
char *opts; |
1064 |
|
{ |
1065 |
+ |
char *vw; |
1066 |
|
char combuf[512]; |
1067 |
|
/* build command */ |
1068 |
< |
sprintf(combuf, "rview %s%s ", getview(0, NULL), opts); |
1068 |
> |
if ((vw = getview(0, NULL)) == NULL) |
1069 |
> |
return; |
1070 |
> |
if (sayview) |
1071 |
> |
printview(vw); |
1072 |
> |
sprintf(combuf, "rview %s%s -R %s ", vw, opts, rifname); |
1073 |
|
if (rvdevice != NULL) |
1074 |
|
sprintf(combuf+strlen(combuf), "-o %s ", rvdevice); |
1075 |
|
strcat(combuf, vval(OCTREE)); |
1124 |
|
/* do each view */ |
1125 |
|
vn = 0; |
1126 |
|
while ((vw = getview(vn++, vs)) != NULL) { |
1127 |
+ |
if (sayview) |
1128 |
+ |
printview(vw); |
1129 |
|
if (!vs[0]) |
1130 |
|
sprintf(vs, "%d", vn); |
1131 |
|
sprintf(picfile, "%s_%s.pic", vval(PICTURE), vs); |