1 |
– |
/* Copyright (c) 1995 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Make illum sources for optimizing rendering process |
6 |
|
*/ |
27 |
|
"-ab", "2", "-ad", "256", "-as", "128", "-aa", ".15", }; |
28 |
|
int rtargc = 14; |
29 |
|
/* overriding rtrace options */ |
30 |
< |
char *myrtopts[] = { "-I-", "-i-", "-ov", "-h-", "-fff", "-y", "0", NULL }; |
30 |
> |
char *myrtopts[] = { "-I-", "-i-", "-ld-", "-ov", "-h-", |
31 |
> |
"-fff", "-y", "0", NULL }; |
32 |
|
|
33 |
|
struct rtproc rt; /* our rtrace process */ |
34 |
|
|
57 |
|
|
58 |
|
int warnings = 1; /* print warnings? */ |
59 |
|
|
62 |
– |
extern char *fgetline(), *fgetword(), *sskip(), |
63 |
– |
*atos(), *iskip(), *fskip(), *strcpy(); |
64 |
– |
extern FILE *popen(); |
60 |
|
|
66 |
– |
|
61 |
|
main(argc, argv) /* compute illum distributions using rtrace */ |
62 |
|
int argc; |
63 |
|
char *argv[]; |
64 |
|
{ |
71 |
– |
extern char *getenv(), *getpath(); |
65 |
|
char *rtpath; |
66 |
|
FILE *fp; |
67 |
|
register int i; |
130 |
|
} |
131 |
|
|
132 |
|
|
133 |
+ |
void |
134 |
|
quit(status) /* exit with status */ |
135 |
|
int status; |
136 |
|
{ |
178 |
|
} |
179 |
|
|
180 |
|
|
181 |
+ |
void |
182 |
|
eputs(s) /* put string to stderr */ |
183 |
|
register char *s; |
184 |
|
{ |
194 |
|
} |
195 |
|
|
196 |
|
|
197 |
+ |
void |
198 |
|
wputs(s) /* print warning if enabled */ |
199 |
|
char *s; |
200 |
|
{ |
254 |
|
case ' ': |
255 |
|
case '\t': |
256 |
|
case '\n': |
257 |
+ |
case '\r': |
258 |
+ |
case '\f': |
259 |
|
cp++; |
260 |
|
continue; |
261 |
|
case 'm': /* material name */ |
323 |
|
case 'd': /* point sample density */ |
324 |
|
if (*++cp != '=') |
325 |
|
break; |
326 |
< |
if (!isintd(++cp, " \t\n")) |
326 |
> |
if (!isintd(++cp, " \t\n\r")) |
327 |
|
break; |
328 |
|
thisillum.sampdens = atoi(cp); |
329 |
|
cp = sskip(cp); |
331 |
|
case 's': /* point super-samples */ |
332 |
|
if (*++cp != '=') |
333 |
|
break; |
334 |
< |
if (!isintd(++cp, " \t\n")) |
334 |
> |
if (!isintd(++cp, " \t\n\r")) |
335 |
|
break; |
336 |
|
thisillum.nsamps = atoi(cp); |
337 |
|
cp = sskip(cp); |
349 |
|
case 'b': /* brightness */ |
350 |
|
if (*++cp != '=') |
351 |
|
break; |
352 |
< |
if (!isfltd(++cp, " \t\n")) |
352 |
> |
if (!isfltd(++cp, " \t\n\r")) |
353 |
|
break; |
354 |
|
thisillum.minbrt = atof(cp); |
355 |
|
if (thisillum.minbrt < 0.) |