17 |
|
#include "ambient.h" |
18 |
|
#include "random.h" |
19 |
|
#include "paths.h" |
20 |
+ |
#include "pmapray.h" |
21 |
|
|
22 |
|
extern char *progname; /* global argv[0] */ |
23 |
|
|
76 |
|
case 'n': case 'N': case 'f': case 'F': \ |
77 |
|
case '-': case '0': var = 0; break; \ |
78 |
|
default: goto badopt; } |
79 |
+ |
extern char *octname; |
80 |
|
int persist = 0; |
81 |
|
char *octnm = NULL; |
82 |
< |
char **tralp; |
83 |
< |
int duped1; |
82 |
> |
char **tralp = NULL; |
83 |
> |
int duped1 = -1; |
84 |
|
int rval; |
85 |
|
int i; |
86 |
|
/* global program name */ |
316 |
|
#endif |
317 |
|
if (outform != 'a') |
318 |
|
SET_FILE_BINARY(stdout); |
319 |
< |
readoct(octnm, loadflags, &thescene, NULL); |
319 |
> |
readoct(octname = octnm, loadflags, &thescene, NULL); |
320 |
|
nsceneobjs = nobjects; |
321 |
|
|
322 |
|
if (loadflags & IO_INFO) { /* print header */ |
326 |
|
fputformat(formstr(outform), stdout); |
327 |
|
putchar('\n'); |
328 |
|
} |
329 |
< |
|
329 |
> |
|
330 |
> |
ray_init_pmap(); /* PMAP: set up & load photon maps */ |
331 |
> |
|
332 |
|
marksources(); /* find and mark sources */ |
333 |
|
|
334 |
|
setambient(); /* initialize ambient calculation */ |
335 |
< |
|
335 |
> |
|
336 |
|
#ifdef PERSIST |
337 |
|
if (persist) { |
338 |
|
fflush(stdout); |
378 |
|
goto runagain; |
379 |
|
} |
380 |
|
#endif |
381 |
+ |
|
382 |
+ |
ray_done_pmap(); /* PMAP: free photon maps */ |
383 |
+ |
|
384 |
|
quit(0); |
385 |
|
|
386 |
|
badopt: |