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.13 by greg, Thu Sep 13 20:02:11 2007 UTC vs.
Revision 2.27 by greg, Tue Aug 15 01:19:37 2023 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 54 | Line 55 | extern double  dblur;                  /* depth-of-field blur paramet
55   static void onsig(int signo);
56   static void sigdie(int  signo, char  *msg);
57   static void printdefaults(void);
58 +                                        /* rpict additional features */
59 + #ifdef PERSIST
60 + #define RPICT_FEATURES  "Persist\nParallelPersist\n" \
61 +                "ParticipatingMedia=Mist\n" \
62 +                "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \
63 +                "HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \
64 +                "PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \
65 +                "SmallSourceDrawing\nViewSequence\nProgressReporting\n" \
66 +                "AdaptiveShadowTesting\nOutputs=v,l\n"
67 + #else
68 + #define RPICT_FEATURES  "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \
69 +                "ParticipatingMedia=Mist\n" \
70 +                "HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \
71 +                "PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \
72 +                "SmallSourceDrawing\nViewSequence\nProgressReporting\n" \
73 +                "AdaptiveShadowTesting\nOutputs=v,l\n"
74 + #endif
75  
76  
77   int
# Line 62 | Line 80 | main(int  argc, char  *argv[])
80   #define  check(ol,al)           if (argv[i][ol] || \
81                                  badarg(argc-i-1,argv+i+1,al)) \
82                                  goto badopt
83 < #define  bool(olen,var)         switch (argv[i][olen]) { \
83 > #define  check_bool(olen,var)           switch (argv[i][olen]) { \
84                                  case '\0': var = !var; break; \
85                                  case 'y': case 'Y': case 't': case 'T': \
86                                  case '+': case '1': var = 1; break; \
# Line 76 | Line 94 | main(int  argc, char  *argv[])
94          int  loadflags = ~IO_FILES;
95          int  seqstart = 0;
96          int  persist = 0;
97 <        int  duped1;
97 >        int  duped1 = -1;
98          int  rval;
99          int  i;
100                                          /* record start time */
101          tstart = time((time_t *)NULL);
102                                          /* global program name */
103          progname = argv[0] = fixargv0(argv[0]);
104 +                                        /* feature check only? */
105 +        strcat(RFeatureList, RPICT_FEATURES);
106 +        if (argc > 1 && !strcmp(argv[1], "-features"))
107 +                return feature_status(argc-2, argv+2);
108                                          /* option city */
109          for (i = 1; i < argc; i++) {
110                                                  /* expand arguments */
# Line 208 | Line 230 | main(int  argc, char  *argv[])
230   #endif
231                  case 'w':                               /* warnings */
232                          rval = erract[WARNING].pf != NULL;
233 <                        bool(2,rval);
233 >                        check_bool(2,rval);
234                          if (rval) erract[WARNING].pf = wputs;
235                          else erract[WARNING].pf = NULL;
236                          break;
# Line 285 | Line 307 | main(int  argc, char  *argv[])
307   #endif
308          if (outfile != NULL)
309                  openheader();
288 #ifdef  _WIN32
310          SET_FILE_BINARY(stdout);
311          if (octname == NULL)
312                  SET_FILE_BINARY(stdin);
292 #endif
313          readoct(octname, loadflags, &thescene, NULL);
314          nsceneobjs = nobjects;
315  
# Line 297 | Line 317 | main(int  argc, char  *argv[])
317                  printargs(i, argv, stdout);
318                  printf("SOFTWARE= %s\n", VersionID);
319          }
320 +                  
321 +        ray_init_pmap();     /* PMAP: set up & load photon maps */
322  
323          marksources();                  /* find and mark sources */
324  
325          setambient();                   /* initialize ambient calculation */
326 +        
327 +        fflush(stdout);                 /* in case we're duplicating header */
328  
329   #ifdef  PERSIST
330          if (persist) {
307                fflush(stdout);
331                  if (outfile == NULL) {          /* reconnect stdout */
332                          dup2(duped1, fileno(stdout));
333                          close(duped1);
# Line 356 | Line 379 | runagain:
379                  goto runagain;
380          }
381   #endif
382 +
383 +
384 +        ray_done_pmap();           /* PMAP: free photon maps */
385 +        
386          quit(0);
387  
388   badopt:
# Line 364 | Line 391 | badopt:
391          return 1; /* pro forma return */
392  
393   #undef  check
394 < #undef  bool
394 > #undef  check_bool
395   }
396  
397  
398   void
399   wputs(                          /* warning output function */
400 <        char    *s
400 >        const char      *s
401   )
402   {
403          int  lasterrno = errno;
# Line 381 | Line 408 | wputs(                         /* warning output function */
408  
409   void
410   eputs(                          /* put string to stderr */
411 <        register char  *s
411 >        const char  *s
412   )
413   {
414          static int  midline = 0;
# Line 442 | Line 469 | printdefaults(void)                    /* print default values to stdou
469                          ourview.type==VT_HEM ? "hemispherical" :
470                          ourview.type==VT_ANG ? "angular" :
471                          ourview.type==VT_CYL ? "cylindrical" :
472 +                        ourview.type==VT_PLS ? "planisphere" :
473                          "unknown");
474          printf("-vp %f %f %f\t# view point\n",
475                          ourview.vp[0], ourview.vp[1], ourview.vp[2]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines