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 |
|
*/ |
57 |
|
|
58 |
|
int warnings = 1; /* print warnings? */ |
59 |
|
|
63 |
– |
extern char *fgetline(), *fgetword(), *sskip(), |
64 |
– |
*atos(), *iskip(), *fskip(), *strcpy(); |
65 |
– |
extern FILE *popen(); |
60 |
|
|
67 |
– |
|
61 |
|
main(argc, argv) /* compute illum distributions using rtrace */ |
62 |
|
int argc; |
63 |
|
char *argv[]; |
64 |
|
{ |
72 |
– |
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.) |
444 |
|
if (fgetword(str, MAXSTR, fp) == NULL) |
445 |
|
goto readerr; |
446 |
|
/* is it an alias? */ |
447 |
< |
if (!strcmp(str, ALIASID)) { |
447 |
> |
if (!strcmp(str, ALIASKEY)) { |
448 |
|
if (fgetword(str, MAXSTR, fp) == NULL) |
449 |
|
goto readerr; |
450 |
< |
printf("\n%s %s %s", thisillum.altmat, ALIASID, str); |
450 |
> |
printf("\n%s %s %s", thisillum.altmat, ALIASKEY, str); |
451 |
|
if (fgetword(str, MAXSTR, fp) == NULL) |
452 |
|
goto readerr; |
453 |
|
printf("\t%s\n", str); |