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

Comparing ray/src/rt/rtmain.c (file contents):
Revision 2.32 by greg, Mon Apr 6 04:10:44 2020 UTC vs.
Revision 2.38 by greg, Wed Oct 19 21:25:20 2022 UTC

# Line 45 | Line 45 | char  *outvals = "v";                  /* output specification */
45   int  hresolu = 0;                       /* horizontal (scan) size */
46   int  vresolu = 0;                       /* vertical resolution */
47  
48 < int  castonly = 0;                      /* only doing ray-casting? */
48 > extern int  castonly;                   /* only doing ray-casting? */
49  
50   int  imm_irrad = 0;                     /* compute immediate irradiance? */
51   int  lim_dist = 0;                      /* limit distance? */
# Line 66 | Line 66 | static void onsig(int  signo);
66   static void sigdie(int  signo, char  *msg);
67   static void printdefaults(void);
68  
69 + #ifdef PERSIST
70 + #define RTRACE_FEATURES "Persist\nParallelPersist\nMultiProcessing\n" \
71 +                        "IrradianceCalc\nImmediateIrradiance\nDistanceLimiting\n" \
72 +                        "HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n"
73 + #else
74 + #define RTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \
75 +                        "HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n"
76 + #endif
77  
78 +
79   int
80   main(int  argc, char  *argv[])
81   {
# Line 89 | Line 98 | main(int  argc, char  *argv[])
98          int  i;
99                                          /* global program name */
100          progname = argv[0] = fixargv0(argv[0]);
101 +                                        /* feature check only? */
102 +        strcat(RFeatureList, RTRACE_FEATURES);
103 +        if (!strcmp(argv[1], "-features"))
104 +                return feature_status(argc-2, argv+2);
105                                          /* add trace notify function */
106          for (i = 0; addobjnotify[i] != NULL; i++)
107                  ;
# Line 251 | Line 264 | main(int  argc, char  *argv[])
264                          goto badopt;
265                  }
266          }
267 <        if (nproc > 1) {
268 <                if (persist)
256 <                        error(USER, "multiprocessing incompatible with persist file");
257 <                if (!vresolu && hresolu > 0 && hresolu < nproc)
258 <                        error(WARNING, "number of cores should not exceed horizontal resolution");
259 <                if (trace != NULL)
260 <                        error(WARNING, "multiprocessing does not work properly with trace mode");
261 <        }
267 >        if (nproc > 1 && persist)
268 >                error(USER, "multiprocessing incompatible with persist file");
269                                          /* initialize object types */
270          initotypes();
271                                          /* initialize urand */
# Line 339 | Line 346 | main(int  argc, char  *argv[])
346                  marksources();          /* find and mark sources */
347  
348                  setambient();           /* initialize ambient calculation */
349 <        }
349 >        } else
350 >                distantsources();       /* else mark only distant sources */
351 >
352 >        fflush(stdout);                 /* in case we're duplicating header */
353 >
354   #ifdef  PERSIST
355          if (persist) {
345                fflush(stdout);
356                                                  /* reconnect stdout */
357                  dup2(duped1, fileno(stdout));
358                  close(duped1);
# Line 413 | Line 423 | wputs(                         /* warning output function */
423  
424   void
425   eputs(                          /* put string to stderr */
426 <        register char  *s
426 >        char  *s
427   )
428   {
429          static int  midline = 0;
# Line 468 | Line 478 | sigdie(                        /* set fatal signal */
478   static void
479   printdefaults(void)                     /* print default values to stdout */
480   {
481 <        register char  *cp;
481 >        char  *cp;
482  
483          if (imm_irrad)
484                  printf("-I+\t\t\t\t# immediate irradiance on\n");
# Line 504 | Line 514 | printdefaults(void)                    /* print default values to stdou
514                  case 'W': printf(" coefficient"); break;
515                  case 'm': printf(" modifier"); break;
516                  case 'M': printf(" material"); break;
517 <                case '-': printf(" stroke"); break;
517 >                case '~': printf(" tilde"); break;
518                  }
519          putchar('\n');
520          printf(erract[WARNING].pf != NULL ?

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines