45 |
|
int hresolu = 0; /* horizontal (scan) size */ |
46 |
|
int vresolu = 0; /* vertical resolution */ |
47 |
|
|
48 |
< |
int castonly = 0; /* only doing ray-casting? */ |
48 |
> |
extern int castonly; /* only doing ray-casting? */ |
49 |
|
|
50 |
|
int imm_irrad = 0; /* compute immediate irradiance? */ |
51 |
|
int lim_dist = 0; /* limit distance? */ |
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\n" \ |
73 |
+ |
"AmbientValueSharing\nAdaptiveShadowTesting\n" |
74 |
+ |
#else |
75 |
+ |
#define RTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \ |
76 |
+ |
"HessianAmbientCache\nAmbientAveraging\n" \ |
77 |
+ |
"AmbientValueSharing\nAdaptiveShadowTesting\n" |
78 |
+ |
#endif |
79 |
|
|
80 |
+ |
|
81 |
|
int |
82 |
|
main(int argc, char *argv[]) |
83 |
|
{ |
100 |
|
int i; |
101 |
|
/* global program name */ |
102 |
|
progname = argv[0] = fixargv0(argv[0]); |
103 |
+ |
/* feature check only? */ |
104 |
+ |
strcat(RFeatureList, RTRACE_FEATURES); |
105 |
+ |
if (!strcmp(argv[1], "-features")) |
106 |
+ |
return feature_status(argc-2, argv+2); |
107 |
|
/* add trace notify function */ |
108 |
|
for (i = 0; addobjnotify[i] != NULL; i++) |
109 |
|
; |
266 |
|
goto badopt; |
267 |
|
} |
268 |
|
} |
269 |
< |
if (nproc > 1) { |
270 |
< |
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 |
< |
} |
269 |
> |
if (nproc > 1 && persist) |
270 |
> |
error(USER, "multiprocessing incompatible with persist file"); |
271 |
|
/* initialize object types */ |
272 |
|
initotypes(); |
273 |
|
/* initialize urand */ |
348 |
|
marksources(); /* find and mark sources */ |
349 |
|
|
350 |
|
setambient(); /* initialize ambient calculation */ |
351 |
< |
} |
351 |
> |
} else |
352 |
> |
distantsources(); /* else mark only distant sources */ |
353 |
> |
|
354 |
> |
fflush(stdout); /* in case we're duplicating header */ |
355 |
> |
|
356 |
|
#ifdef PERSIST |
357 |
|
if (persist) { |
345 |
– |
fflush(stdout); |
358 |
|
/* reconnect stdout */ |
359 |
|
dup2(duped1, fileno(stdout)); |
360 |
|
close(duped1); |
425 |
|
|
426 |
|
void |
427 |
|
eputs( /* put string to stderr */ |
428 |
< |
register char *s |
428 |
> |
char *s |
429 |
|
) |
430 |
|
{ |
431 |
|
static int midline = 0; |
480 |
|
static void |
481 |
|
printdefaults(void) /* print default values to stdout */ |
482 |
|
{ |
483 |
< |
register char *cp; |
483 |
> |
char *cp; |
484 |
|
|
485 |
|
if (imm_irrad) |
486 |
|
printf("-I+\t\t\t\t# immediate irradiance on\n"); |
516 |
|
case 'W': printf(" coefficient"); break; |
517 |
|
case 'm': printf(" modifier"); break; |
518 |
|
case 'M': printf(" material"); break; |
519 |
< |
case '-': printf(" stroke"); break; |
519 |
> |
case '~': printf(" tilde"); break; |
520 |
|
} |
521 |
|
putchar('\n'); |
522 |
|
printf(erract[WARNING].pf != NULL ? |