13 |
|
#include "platform.h" |
14 |
|
#include "rtprocess.h" /* getpid() */ |
15 |
|
#include "ray.h" |
16 |
+ |
#include "func.h" |
17 |
|
#include "source.h" |
18 |
|
#include "ambient.h" |
19 |
|
#include "random.h" |
19 |
– |
#include "paths.h" |
20 |
|
#include "view.h" |
21 |
|
#include "pmapray.h" |
22 |
|
|
27 |
|
#define PCHILD 3 /* child of normal persist */ |
28 |
|
#endif |
29 |
|
|
30 |
– |
char *progname; /* argv[0] */ |
30 |
|
char *octname; /* octree name */ |
31 |
|
char *sigerr[NSIG]; /* signal error messages */ |
33 |
– |
char *shm_boundary = NULL; /* boundary of shared memory */ |
32 |
|
char *errfile = NULL; /* error output file */ |
33 |
|
|
36 |
– |
extern time_t time(); |
34 |
|
extern time_t tstart; /* start time */ |
35 |
|
|
36 |
|
extern int ralrm; /* seconds between reports */ |
64 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
65 |
|
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
66 |
|
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
67 |
< |
"OutputCS=RGB,XYZ,Y,S,M,prims\n" |
67 |
> |
"OutputCS=RGB,XYZ,prims\n" |
68 |
|
#else |
69 |
|
#define RPICT_FEATURES "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
70 |
|
"ParticipatingMedia=Mist\n" \ |
72 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
73 |
|
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
74 |
|
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
75 |
< |
"OutputCS=RGB,XYZ,Y,S,M,prims\n" |
75 |
> |
"OutputCS=RGB,XYZ,prims\n" |
76 |
|
#endif |
77 |
|
|
78 |
|
|
107 |
|
strcat(RFeatureList, RPICT_FEATURES); |
108 |
|
if (argc > 1 && !strcmp(argv[1], "-features")) |
109 |
|
return feature_status(argc-2, argv+2); |
110 |
+ |
/* initialize calcomp routines */ |
111 |
+ |
initfunc(); |
112 |
|
/* option city */ |
113 |
|
for (i = 1; i < argc; i++) { |
114 |
|
/* expand arguments */ |
241 |
|
check(2,"s"); |
242 |
|
recover = argv[++i]; |
243 |
|
break; |
245 |
– |
case 't': /* timer */ |
246 |
– |
check(2,"i"); |
247 |
– |
ralrm = atoi(argv[++i]); |
248 |
– |
break; |
244 |
|
#ifdef PERSIST |
245 |
|
case 'P': /* persist file */ |
246 |
|
if (argv[i][2] == 'P') { |
253 |
|
persistfile(argv[++i]); |
254 |
|
break; |
255 |
|
#endif |
256 |
+ |
case 't': /* timer */ |
257 |
+ |
check(2,"i"); |
258 |
+ |
ralrm = atoi(argv[++i]); |
259 |
+ |
break; |
260 |
|
case 'w': /* warnings */ |
261 |
|
rval = erract[WARNING].pf != NULL; |
262 |
|
check_bool(2,rval); |
354 |
|
ray_init_pmap(); /* PMAP: set up & load photon maps */ |
355 |
|
|
356 |
|
marksources(); /* find and mark sources */ |
358 |
– |
|
357 |
|
setambient(); /* initialize ambient calculation */ |
358 |
|
|
359 |
|
fflush(stdout); /* in case we're duplicating header */ |
365 |
|
close(duped1); |
366 |
|
} |
367 |
|
if (persist == PARALLEL) { /* multiprocessing */ |
368 |
< |
preload_objs(); /* preload scene */ |
371 |
< |
shm_boundary = (char *)malloc(16); |
372 |
< |
strcpy(shm_boundary, "SHM_BOUNDARY"); |
368 |
> |
cow_memshare(); /* preloads scene */ |
369 |
|
while ((rval=fork()) == 0) { /* keep on forkin' */ |
370 |
|
pflock(1); |
371 |
|
pfhold(); |
431 |
|
) |
432 |
|
{ |
433 |
|
int lasterrno = errno; |
434 |
+ |
if (erract[WARNING].pf == NULL) |
435 |
+ |
return; /* called by calcomp or someone */ |
436 |
|
eputs(s); |
437 |
|
errno = lasterrno; |
438 |
|
} |