10 |
|
#include "copyright.h" |
11 |
|
|
12 |
|
#include "ray.h" |
13 |
+ |
#include "paths.h" |
14 |
|
|
15 |
|
|
16 |
< |
int |
17 |
< |
getrenderopt(ac, av) /* get next render option */ |
18 |
< |
int ac; |
19 |
< |
char *av[]; |
16 |
> |
extern int |
17 |
> |
getrenderopt( /* get next render option */ |
18 |
> |
int ac, |
19 |
> |
char *av[] |
20 |
> |
) |
21 |
|
{ |
22 |
|
#define check(ol,al) if (av[0][ol] || \ |
23 |
|
badarg(ac-1,av+1,al)) \ |
144 |
|
getpath(av[1],getrlibpath(),R_OK)); |
145 |
|
if (rval < 0) { |
146 |
|
sprintf(errmsg, |
147 |
< |
"cannot open ambient include file \"%s\"", av[0]); |
147 |
> |
"cannot open ambient include file \"%s\"", av[1]); |
148 |
|
error(SYSTEM, errmsg); |
149 |
|
} |
150 |
|
amblp += rval; |
151 |
|
} else { |
152 |
< |
*amblp++ = av[1]; |
152 |
> |
*amblp++ = savqstr(av[1]); |
153 |
|
*amblp = NULL; |
154 |
|
} |
155 |
|
return(1); |
165 |
|
getpath(av[1],getrlibpath(),R_OK)); |
166 |
|
if (rval < 0) { |
167 |
|
sprintf(errmsg, |
168 |
< |
"cannot open ambient exclude file \"%s\"", av[0]); |
168 |
> |
"cannot open ambient exclude file \"%s\"", av[1]); |
169 |
|
error(SYSTEM, errmsg); |
170 |
|
} |
171 |
|
amblp += rval; |
172 |
|
} else { |
173 |
< |
*amblp++ = av[1]; |
173 |
> |
*amblp++ = savqstr(av[1]); |
174 |
|
*amblp = NULL; |
175 |
|
} |
176 |
|
return(1); |
177 |
|
case 'f': /* file */ |
178 |
|
check(3,"s"); |
179 |
< |
ambfile= av[1]; |
179 |
> |
ambfile = savqstr(av[1]); |
180 |
|
return(1); |
181 |
|
} |
182 |
|
break; |
212 |
|
} |
213 |
|
|
214 |
|
|
215 |
< |
void |
216 |
< |
print_rdefaults() /* print default render values to stdout */ |
215 |
> |
extern void |
216 |
> |
print_rdefaults(void) /* print default render values to stdout */ |
217 |
|
{ |
216 |
– |
register char *cp; |
217 |
– |
|
218 |
|
printf(do_irrad ? "-i+\t\t\t\t# irradiance calculation on\n" : |
219 |
|
"-i-\t\t\t\t# irradiance calculation off\n"); |
220 |
|
printf(backvis ? "-bv+\t\t\t\t# back face visibility on\n" : |
245 |
|
colval(salbedo,GRN), colval(salbedo,BLU)); |
246 |
|
printf("-mg %f\t\t\t# mist scattering eccentricity\n", seccg); |
247 |
|
printf("-ms %f\t\t\t# mist sampling distance\n", ssampdist); |
248 |
< |
printf("-lr %-9d\t\t\t# limit reflection\n", maxdepth); |
248 |
> |
printf("-lr %-9d\t\t\t# limit reflection%s\n", maxdepth, |
249 |
> |
maxdepth<=0 ? " (Russian roulette)" : ""); |
250 |
|
printf("-lw %f\t\t\t# limit weight\n", minweight); |
251 |
|
} |