| 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 |
|
|
| 78 |
|
default: goto badopt; } |
| 79 |
|
int persist = 0; |
| 80 |
|
char *octnm = NULL; |
| 81 |
< |
char **tralp; |
| 82 |
< |
int duped1; |
| 81 |
> |
char **tralp = NULL; |
| 82 |
> |
int duped1 = -1; |
| 83 |
|
int rval; |
| 84 |
|
int i; |
| 85 |
|
/* global program name */ |
| 89 |
|
; |
| 90 |
|
addobjnotify[i] = tranotify; |
| 91 |
|
/* set our defaults */ |
| 92 |
+ |
rand_samp = 1; |
| 93 |
|
maxdepth = -10; |
| 94 |
|
minweight = 2e-3; |
| 95 |
|
/* option city */ |
| 253 |
|
if (nproc > 1) { |
| 254 |
|
if (persist) |
| 255 |
|
error(USER, "multiprocessing incompatible with persist file"); |
| 256 |
< |
if (hresolu > 0 && hresolu < nproc) |
| 256 |
> |
if (!vresolu && hresolu > 0 && hresolu < nproc) |
| 257 |
|
error(WARNING, "number of cores should not exceed horizontal resolution"); |
| 258 |
|
if (trace != NULL) |
| 259 |
|
error(WARNING, "multiprocessing does not work properly with trace mode"); |
| 315 |
|
#endif |
| 316 |
|
if (outform != 'a') |
| 317 |
|
SET_FILE_BINARY(stdout); |
| 318 |
< |
readoct(octnm, loadflags, &thescene, NULL); |
| 318 |
> |
readoct(octname = octnm, loadflags, &thescene, NULL); |
| 319 |
|
nsceneobjs = nobjects; |
| 320 |
|
|
| 321 |
|
if (loadflags & IO_INFO) { /* print header */ |
| 325 |
|
fputformat(formstr(outform), stdout); |
| 326 |
|
putchar('\n'); |
| 327 |
|
} |
| 328 |
< |
|
| 328 |
> |
|
| 329 |
> |
ray_init_pmap(); /* PMAP: set up & load photon maps */ |
| 330 |
> |
|
| 331 |
|
marksources(); /* find and mark sources */ |
| 332 |
|
|
| 333 |
|
setambient(); /* initialize ambient calculation */ |
| 334 |
< |
|
| 334 |
> |
|
| 335 |
|
#ifdef PERSIST |
| 336 |
|
if (persist) { |
| 337 |
|
fflush(stdout); |
| 377 |
|
goto runagain; |
| 378 |
|
} |
| 379 |
|
#endif |
| 380 |
+ |
|
| 381 |
+ |
ray_done_pmap(); /* PMAP: free photon maps */ |
| 382 |
+ |
|
| 383 |
|
quit(0); |
| 384 |
|
|
| 385 |
|
badopt: |
| 465 |
|
if (imm_irrad) |
| 466 |
|
printf("-I+\t\t\t\t# immediate irradiance on\n"); |
| 467 |
|
printf("-n %-2d\t\t\t\t# number of rendering processes\n", nproc); |
| 468 |
< |
printf("-x %-9d\t\t\t# x resolution (flush interval)\n", hresolu); |
| 468 |
> |
printf("-x %-9d\t\t\t# %s\n", hresolu, |
| 469 |
> |
vresolu && hresolu ? "x resolution" : "flush interval"); |
| 470 |
|
printf("-y %-9d\t\t\t# y resolution\n", vresolu); |
| 471 |
|
printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" : |
| 472 |
|
"-ld-\t\t\t\t# limit distance off\n"); |