7 |
|
|
8 |
|
#include "copyright.h" |
9 |
|
|
10 |
– |
#include <sys/types.h> |
10 |
|
#include <signal.h> |
11 |
|
|
12 |
|
#include "platform.h" |
45 |
|
extern char *tralist[]; /* list of modifers to trace (or no) */ |
46 |
|
extern int traincl; /* include == 1, exclude == 0 */ |
47 |
|
|
48 |
+ |
static int loadflags = ~IO_FILES; /* what to load from octree */ |
49 |
+ |
|
50 |
|
static void onsig(int signo); |
51 |
|
static void sigdie(int signo, char *msg); |
52 |
|
static void printdefaults(void); |
65 |
|
case 'n': case 'N': case 'f': case 'F': \ |
66 |
|
case '-': case '0': var = 0; break; \ |
67 |
|
default: goto badopt; } |
67 |
– |
int loadflags = ~IO_FILES; |
68 |
|
int persist = 0; |
69 |
|
char **tralp; |
70 |
|
int duped1; |
228 |
|
initotypes(); |
229 |
|
/* initialize urand */ |
230 |
|
initurand(2048); |
231 |
+ |
srandom(rand_samp ? (long)time(0) : 0L); |
232 |
|
/* set up signal handling */ |
233 |
|
sigdie(SIGINT, "Interrupt"); |
234 |
|
#ifdef SIGHUP |
274 |
|
openheader(); |
275 |
|
} |
276 |
|
#endif |
276 |
– |
#ifdef _WIN32 |
277 |
|
if (outform != 'a') |
278 |
|
SET_FILE_BINARY(stdout); |
279 |
– |
if (octname == NULL) |
280 |
– |
SET_FILE_BINARY(stdin); |
281 |
– |
#endif |
279 |
|
readoct(octname, loadflags, &thescene, NULL); |
280 |
|
nsceneobjs = nobjects; |
281 |
|
|
420 |
|
|
421 |
|
if (imm_irrad) |
422 |
|
printf("-I+\t\t\t\t# immediate irradiance on\n"); |
423 |
< |
printf("-x %-9d\t\t\t# x resolution\n", hresolu); |
423 |
> |
printf("-x %-9d\t\t\t# x resolution (flush interval)\n", hresolu); |
424 |
|
printf("-y %-9d\t\t\t# y resolution\n", vresolu); |
425 |
|
printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" : |
426 |
|
"-ld-\t\t\t\t# limit distance off\n"); |
427 |
+ |
printf("-h%c\t\t\t\t# %s header\n", loadflags & IO_INFO ? '+' : '-', |
428 |
+ |
loadflags & IO_INFO ? "output" : "no"); |
429 |
|
printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n", |
430 |
|
inform, outform, formstr(inform), formstr(outform)); |
431 |
< |
printf("-o%s\t\t\t\t# output", outvals); |
431 |
> |
printf("-o%-9s\t\t\t# output", outvals); |
432 |
|
for (cp = outvals; *cp; cp++) |
433 |
|
switch (*cp) { |
434 |
< |
case 't': printf(" trace"); break; |
434 |
> |
case 't': case 'T': printf(" trace"); break; |
435 |
|
case 'o': printf(" origin"); break; |
436 |
|
case 'd': printf(" direction"); break; |
437 |
|
case 'v': printf(" value"); break; |
438 |
+ |
case 'V': printf(" contribution"); break; |
439 |
|
case 'l': printf(" length"); break; |
440 |
|
case 'L': printf(" first_length"); break; |
441 |
|
case 'p': printf(" point"); break; |
443 |
|
case 'N': printf(" unperturbed_normal"); break; |
444 |
|
case 's': printf(" surface"); break; |
445 |
|
case 'w': printf(" weight"); break; |
446 |
+ |
case 'W': printf(" coefficient"); break; |
447 |
|
case 'm': printf(" modifier"); break; |
448 |
+ |
case 'M': printf(" material"); break; |
449 |
+ |
case '-': printf(" stroke"); break; |
450 |
|
} |
451 |
|
putchar('\n'); |
452 |
|
printf(erract[WARNING].pf != NULL ? |