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" |
31 |
|
char *progname; /* argv[0] */ |
32 |
|
char *octname; /* octree name */ |
33 |
|
char *sigerr[NSIG]; /* signal error messages */ |
33 |
– |
char *shm_boundary = NULL; /* boundary of shared memory */ |
34 |
|
char *errfile = NULL; /* error output file */ |
35 |
|
|
36 |
– |
extern time_t time(); |
36 |
|
extern time_t tstart; /* start time */ |
37 |
|
|
38 |
|
extern int ralrm; /* seconds between reports */ |
66 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
67 |
|
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
68 |
|
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
69 |
< |
"OutputCS=RGB,XYZ,Y,S,M,prims\n" |
69 |
> |
"OutputCS=RGB,XYZ,prims\n" |
70 |
|
#else |
71 |
|
#define RPICT_FEATURES "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
72 |
|
"ParticipatingMedia=Mist\n" \ |
74 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
75 |
|
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
76 |
|
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
77 |
< |
"OutputCS=RGB,XYZ,Y,S,M,prims\n" |
77 |
> |
"OutputCS=RGB,XYZ,prims\n" |
78 |
|
#endif |
79 |
|
|
80 |
|
|
109 |
|
strcat(RFeatureList, RPICT_FEATURES); |
110 |
|
if (argc > 1 && !strcmp(argv[1], "-features")) |
111 |
|
return feature_status(argc-2, argv+2); |
112 |
+ |
/* initialize calcomp routines */ |
113 |
+ |
initfunc(); |
114 |
|
/* option city */ |
115 |
|
for (i = 1; i < argc; i++) { |
116 |
|
/* expand arguments */ |
243 |
|
check(2,"s"); |
244 |
|
recover = argv[++i]; |
245 |
|
break; |
245 |
– |
case 't': /* timer */ |
246 |
– |
check(2,"i"); |
247 |
– |
ralrm = atoi(argv[++i]); |
248 |
– |
break; |
246 |
|
#ifdef PERSIST |
247 |
|
case 'P': /* persist file */ |
248 |
|
if (argv[i][2] == 'P') { |
255 |
|
persistfile(argv[++i]); |
256 |
|
break; |
257 |
|
#endif |
258 |
+ |
case 't': /* timer */ |
259 |
+ |
check(2,"i"); |
260 |
+ |
ralrm = atoi(argv[++i]); |
261 |
+ |
break; |
262 |
|
case 'w': /* warnings */ |
263 |
|
rval = erract[WARNING].pf != NULL; |
264 |
|
check_bool(2,rval); |
356 |
|
ray_init_pmap(); /* PMAP: set up & load photon maps */ |
357 |
|
|
358 |
|
marksources(); /* find and mark sources */ |
358 |
– |
|
359 |
|
setambient(); /* initialize ambient calculation */ |
360 |
|
|
361 |
|
fflush(stdout); /* in case we're duplicating header */ |
367 |
|
close(duped1); |
368 |
|
} |
369 |
|
if (persist == PARALLEL) { /* multiprocessing */ |
370 |
< |
preload_objs(); /* preload scene */ |
371 |
< |
shm_boundary = (char *)malloc(16); |
372 |
< |
strcpy(shm_boundary, "SHM_BOUNDARY"); |
370 |
> |
cow_memshare(); /* preloads scene */ |
371 |
|
while ((rval=fork()) == 0) { /* keep on forkin' */ |
372 |
|
pflock(1); |
373 |
|
pfhold(); |
433 |
|
) |
434 |
|
{ |
435 |
|
int lasterrno = errno; |
436 |
+ |
if (erract[WARNING].pf == NULL) |
437 |
+ |
return; /* called by calcomp or someone */ |
438 |
|
eputs(s); |
439 |
|
errno = lasterrno; |
440 |
|
} |