ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rpmain.c
(Generate patch)

Comparing ray/src/rt/rpmain.c (file contents):
Revision 2.12 by greg, Wed Apr 5 06:22:57 2006 UTC vs.
Revision 2.18 by schorsch, Thu Mar 10 18:25:46 2016 UTC

# Line 18 | Line 18 | static const char      RCSid[] = "$Id$";
18   #include  "random.h"
19   #include  "paths.h"
20   #include  "view.h"
21 + #include  "pmapray.h"
22  
23                                          /* persistent processes define */
24   #ifdef  F_SETLKW
# Line 62 | Line 63 | main(int  argc, char  *argv[])
63   #define  check(ol,al)           if (argv[i][ol] || \
64                                  badarg(argc-i-1,argv+i+1,al)) \
65                                  goto badopt
66 < #define  bool(olen,var)         switch (argv[i][olen]) { \
66 > #define  check_bool(olen,var)           switch (argv[i][olen]) { \
67                                  case '\0': var = !var; break; \
68                                  case 'y': case 'Y': case 't': case 'T': \
69                                  case '+': case '1': var = 1; break; \
# Line 76 | Line 77 | main(int  argc, char  *argv[])
77          int  loadflags = ~IO_FILES;
78          int  seqstart = 0;
79          int  persist = 0;
80 <        int  duped1;
80 >        int  duped1 = -1;
81          int  rval;
82          int  i;
83                                          /* record start time */
# Line 208 | Line 209 | main(int  argc, char  *argv[])
209   #endif
210                  case 'w':                               /* warnings */
211                          rval = erract[WARNING].pf != NULL;
212 <                        bool(2,rval);
212 >                        check_bool(2,rval);
213                          if (rval) erract[WARNING].pf = wputs;
214                          else erract[WARNING].pf = NULL;
215                          break;
# Line 285 | Line 286 | main(int  argc, char  *argv[])
286   #endif
287          if (outfile != NULL)
288                  openheader();
289 < #ifdef  _WIN32
289 > #if defined(_WIN32) || defined(_WIN64)
290          SET_FILE_BINARY(stdout);
291          if (octname == NULL)
292                  SET_FILE_BINARY(stdin);
# Line 297 | Line 298 | main(int  argc, char  *argv[])
298                  printargs(i, argv, stdout);
299                  printf("SOFTWARE= %s\n", VersionID);
300          }
301 +                  
302 +        ray_init_pmap();     /* PMAP: set up & load photon maps */
303  
304          marksources();                  /* find and mark sources */
305  
306          setambient();                   /* initialize ambient calculation */
307 <
307 >        
308   #ifdef  PERSIST
309          if (persist) {
310                  fflush(stdout);
# Line 317 | Line 320 | main(int  argc, char  *argv[])
320                                  pflock(1);
321                                  pfhold();
322                                  tstart = time((time_t *)NULL);
323 +                                ambsync();              /* load new values */
324                          }
325                          if (rval < 0)
326                                  error(SYSTEM, "cannot fork child for persist function");
327 <                        pfdetach();             /* parent exits */
327 >                        pfdetach();             /* parent will run then exit */
328                  }
329          }
330   runagain:
# Line 355 | Line 359 | runagain:
359                  goto runagain;
360          }
361   #endif
362 +
363 +
364 +        ray_done_pmap();           /* PMAP: free photon maps */
365 +        
366          quit(0);
367  
368   badopt:
# Line 363 | Line 371 | badopt:
371          return 1; /* pro forma return */
372  
373   #undef  check
374 < #undef  bool
374 > #undef  check_bool
375   }
376  
377  
# Line 441 | Line 449 | printdefaults(void)                    /* print default values to stdou
449                          ourview.type==VT_HEM ? "hemispherical" :
450                          ourview.type==VT_ANG ? "angular" :
451                          ourview.type==VT_CYL ? "cylindrical" :
452 +                        ourview.type==VT_PLS ? "planisphere" :
453                          "unknown");
454          printf("-vp %f %f %f\t# view point\n",
455                          ourview.vp[0], ourview.vp[1], ourview.vp[2]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines