| 66 |
|
static void sigdie(int signo, char *msg); |
| 67 |
|
static void printdefaults(void); |
| 68 |
|
|
| 69 |
+ |
#ifdef PERSIST |
| 70 |
+ |
#define RTRACE_FEATURES "Persist\nParallelPersist\nMultiProcessing\n" \ |
| 71 |
+ |
"IrradianceCalc\nImmediateIrradiance\nDistanceLimiting\n" \ |
| 72 |
+ |
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" |
| 73 |
+ |
#else |
| 74 |
+ |
#define RTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \ |
| 75 |
+ |
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" |
| 76 |
+ |
#endif |
| 77 |
|
|
| 78 |
+ |
|
| 79 |
|
int |
| 80 |
|
main(int argc, char *argv[]) |
| 81 |
|
{ |
| 98 |
|
int i; |
| 99 |
|
/* global program name */ |
| 100 |
|
progname = argv[0] = fixargv0(argv[0]); |
| 101 |
+ |
/* feature check only? */ |
| 102 |
+ |
strcat(RFeatureList, RTRACE_FEATURES); |
| 103 |
+ |
if (!strcmp(argv[1], "-features")) |
| 104 |
+ |
return feature_status(argc-2, argv+2); |
| 105 |
|
/* add trace notify function */ |
| 106 |
|
for (i = 0; addobjnotify[i] != NULL; i++) |
| 107 |
|
; |
| 264 |
|
goto badopt; |
| 265 |
|
} |
| 266 |
|
} |
| 267 |
< |
if (nproc > 1) { |
| 268 |
< |
if (persist) |
| 256 |
< |
error(USER, "multiprocessing incompatible with persist file"); |
| 257 |
< |
if (!vresolu && hresolu > 0 && hresolu < nproc) |
| 258 |
< |
error(WARNING, "number of cores should not exceed horizontal resolution"); |
| 259 |
< |
if (trace != NULL) |
| 260 |
< |
error(WARNING, "multiprocessing does not work properly with trace mode"); |
| 261 |
< |
} |
| 267 |
> |
if (nproc > 1 && persist) |
| 268 |
> |
error(USER, "multiprocessing incompatible with persist file"); |
| 269 |
|
/* initialize object types */ |
| 270 |
|
initotypes(); |
| 271 |
|
/* initialize urand */ |
| 348 |
|
setambient(); /* initialize ambient calculation */ |
| 349 |
|
} else |
| 350 |
|
distantsources(); /* else mark only distant sources */ |
| 351 |
+ |
|
| 352 |
+ |
fflush(stdout); /* in case we're duplicating header */ |
| 353 |
+ |
|
| 354 |
|
#ifdef PERSIST |
| 355 |
|
if (persist) { |
| 346 |
– |
fflush(stdout); |
| 356 |
|
/* reconnect stdout */ |
| 357 |
|
dup2(duped1, fileno(stdout)); |
| 358 |
|
close(duped1); |
| 423 |
|
|
| 424 |
|
void |
| 425 |
|
eputs( /* put string to stderr */ |
| 426 |
< |
register char *s |
| 426 |
> |
char *s |
| 427 |
|
) |
| 428 |
|
{ |
| 429 |
|
static int midline = 0; |
| 478 |
|
static void |
| 479 |
|
printdefaults(void) /* print default values to stdout */ |
| 480 |
|
{ |
| 481 |
< |
register char *cp; |
| 481 |
> |
char *cp; |
| 482 |
|
|
| 483 |
|
if (imm_irrad) |
| 484 |
|
printf("-I+\t\t\t\t# immediate irradiance on\n"); |
| 514 |
|
case 'W': printf(" coefficient"); break; |
| 515 |
|
case 'm': printf(" modifier"); break; |
| 516 |
|
case 'M': printf(" material"); break; |
| 517 |
< |
case '-': printf(" stroke"); break; |
| 517 |
> |
case '~': printf(" tilde"); break; |
| 518 |
|
} |
| 519 |
|
putchar('\n'); |
| 520 |
|
printf(erract[WARNING].pf != NULL ? |