18 |
|
#include "random.h" |
19 |
|
#include "paths.h" |
20 |
|
#include "view.h" |
21 |
+ |
#include "pmapray.h" |
22 |
|
|
23 |
|
extern char *progname; /* global argv[0] */ |
24 |
|
|
197 |
|
error(USER, err); |
198 |
|
/* set up signal handling */ |
199 |
|
sigdie(SIGINT, "Interrupt"); |
199 |
– |
sigdie(SIGHUP, "Hangup"); |
200 |
|
sigdie(SIGTERM, "Terminate"); |
201 |
+ |
#ifndef _WIN32 |
202 |
+ |
sigdie(SIGHUP, "Hangup"); |
203 |
|
sigdie(SIGPIPE, "Broken pipe"); |
204 |
|
sigdie(SIGALRM, "Alarm clock"); |
205 |
+ |
#endif |
206 |
|
/* open error file */ |
207 |
|
if (errfile != NULL) { |
208 |
|
if (freopen(errfile, "a", stderr) == NULL) |
228 |
|
/* set up output & start process(es) */ |
229 |
|
SET_FILE_BINARY(stdout); |
230 |
|
|
231 |
< |
ray_pinit(octnm, 0); |
231 |
> |
ray_init(octnm); |
232 |
> |
|
233 |
> |
/* PMAP: set up & load photon maps */ |
234 |
> |
ray_init_pmap(); |
235 |
|
|
236 |
|
rview(); /* run interactive viewer */ |
237 |
|
|
238 |
|
devclose(); /* close output device */ |
239 |
|
|
240 |
+ |
/* PMAP: free photon maps */ |
241 |
+ |
ray_done_pmap(); |
242 |
+ |
|
243 |
|
quit(0); |
244 |
|
|
245 |
|
badopt: |
294 |
|
if (gotsig++) /* two signals and we're gone! */ |
295 |
|
_exit(signo); |
296 |
|
|
297 |
+ |
#ifndef _WIN32 |
298 |
|
alarm(15); /* allow 15 seconds to clean up */ |
299 |
|
signal(SIGALRM, SIG_DFL); /* make certain we do die */ |
300 |
+ |
#endif |
301 |
|
eputs("signal - "); |
302 |
|
eputs(sigerr[signo]); |
303 |
|
eputs("\n"); |