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.40 by greg, Thu Oct 20 17:18:33 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\n" \
73 +                        "AmbientValueSharing\nAdaptiveShadowTesting\n" \
74 +                        "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n"
75 + #else
76 + #define RTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \
77 +                        "HessianAmbientCache\nAmbientAveraging\n" \
78 +                        "AmbientValueSharing\nAdaptiveShadowTesting\n" \
79 +                        "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n"
80 + #endif
81  
82 +
83   int
84   main(int  argc, char  *argv[])
85   {
# Line 89 | Line 102 | main(int  argc, char  *argv[])
102          int  i;
103                                          /* global program name */
104          progname = argv[0] = fixargv0(argv[0]);
105 +                                        /* feature check only? */
106 +        strcat(RFeatureList, RTRACE_FEATURES);
107 +        if (!strcmp(argv[1], "-features"))
108 +                return feature_status(argc-2, argv+2);
109                                          /* add trace notify function */
110          for (i = 0; addobjnotify[i] != NULL; i++)
111                  ;
# Line 251 | Line 268 | main(int  argc, char  *argv[])
268                          goto badopt;
269                  }
270          }
271 <        if (nproc > 1) {
272 <                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 <        }
271 >        if (nproc > 1 && persist)
272 >                error(USER, "multiprocessing incompatible with persist file");
273                                          /* initialize object types */
274          initotypes();
275                                          /* initialize urand */
# Line 339 | Line 350 | main(int  argc, char  *argv[])
350                  marksources();          /* find and mark sources */
351  
352                  setambient();           /* initialize ambient calculation */
353 <        }
353 >        } else
354 >                distantsources();       /* else mark only distant sources */
355 >
356 >        fflush(stdout);                 /* in case we're duplicating header */
357 >
358   #ifdef  PERSIST
359          if (persist) {
345                fflush(stdout);
360                                                  /* reconnect stdout */
361                  dup2(duped1, fileno(stdout));
362                  close(duped1);
# Line 413 | Line 427 | wputs(                         /* warning output function */
427  
428   void
429   eputs(                          /* put string to stderr */
430 <        register char  *s
430 >        char  *s
431   )
432   {
433          static int  midline = 0;
# Line 468 | Line 482 | sigdie(                        /* set fatal signal */
482   static void
483   printdefaults(void)                     /* print default values to stdout */
484   {
485 <        register char  *cp;
485 >        char  *cp;
486  
487          if (imm_irrad)
488                  printf("-I+\t\t\t\t# immediate irradiance on\n");
# Line 504 | Line 518 | printdefaults(void)                    /* print default values to stdou
518                  case 'W': printf(" coefficient"); break;
519                  case 'm': printf(" modifier"); break;
520                  case 'M': printf(" material"); break;
521 <                case '-': printf(" stroke"); break;
521 >                case '~': printf(" tilde"); break;
522                  }
523          putchar('\n');
524          printf(erract[WARNING].pf != NULL ?

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines