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.53 by greg, Tue Apr 30 22:25:46 2024 UTC vs.
Revision 2.60 by greg, Fri Jun 20 03:43:17 2025 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13   #include  "rtprocess.h" /* getpid() */
14   #include  "resolu.h"
15   #include  "ray.h"
16 + #include  "func.h"
17   #include  "source.h"
18   #include  "ambient.h"
19   #include  "random.h"
19 #include  "paths.h"
20   #include  "pmapray.h"
21  
22   extern char     *progname;              /* global argv[0] */
23  
24 extern char     *shm_boundary;          /* boundary of shared memory */
25
24                                          /* persistent processes define */
25   #ifdef  F_SETLKW
26   #define  PERSIST        1               /* normal persist */
# Line 59 | Line 57 | extern void  tranotify(OBJECT obj);
57   char  *tralist[MAXMODLIST];             /* list of modifers to trace (or no) */
58   int  traincl = -1;                      /* include == 1, exclude == 0 */
59  
60 < double  (*sens_curve)(SCOLOR scol) = NULL;      /* spectral conversion for 1-channel */
60 > double  (*sens_curve)(const SCOLOR scol) = NULL;        /* spectral conversion for 1-channel */
61   double  out_scalefactor = 1;            /* output calibration scale factor */
62   RGBPRIMP  out_prims = stdprims;         /* output color primitives (NULL if spectral) */
63   static RGBPRIMS  our_prims;             /* private output color primitives */
# Line 116 | Line 114 | main(int  argc, char  *argv[])
114          strcat(RFeatureList, RTRACE_FEATURES);
115          if (argc > 1 && !strcmp(argv[1], "-features"))
116                  return feature_status(argc-2, argv+2);
117 +                                        /* initialize calcomp routines */
118 +        initfunc();
119                                          /* add trace notify function */
120          for (i = 0; addobjnotify[i] != NULL; i++)
121                  ;
# Line 350 | Line 350 | main(int  argc, char  *argv[])
350          rval = setspectrsamp(CNDX, WLPART);
351          if (rval < 0)
352                  error(USER, "unsupported spectral sampling");
353 <        if (out_prims != NULL) {
353 >        if (sens_curve != NULL)
354 >                out_prims = NULL;
355 >        else if (out_prims != NULL) {
356                  if (!rval)
357                          error(WARNING, "spectral range incompatible with color output");
358          } else if (NCSAMP == 3)
# Line 360 | Line 362 | main(int  argc, char  *argv[])
362                                          /* initialize object types */
363          initotypes();
364                                          /* initialize urand */
365 <        if (rand_samp) {
364 <                srandom((long)time(0));
365 <                initurand(0);
366 <        } else {
367 <                srandom(0L);
368 <                initurand(2048);
369 <        }
365 >        reset_random();
366                                          /* set up signal handling */
367          sigdie(SIGINT, "Interrupt");
368   #ifdef SIGHUP
# Line 453 | Line 449 | main(int  argc, char  *argv[])
449                  dup2(duped1, fileno(stdout));
450                  close(duped1);
451                  if (persist == PARALLEL) {      /* multiprocessing */
452 <                        preload_objs();         /* preload scene */
457 <                        shm_boundary = (char *)malloc(16);
458 <                        strcpy(shm_boundary, "SHM_BOUNDARY");
452 >                        cow_memshare();         /* preloads scene */
453                          while ((rval=fork()) == 0) {    /* keep on forkin' */
454                                  pflock(1);
455                                  pfhold();
# Line 512 | Line 506 | wputs(                         /* warning output function */
506   )
507   {
508          int  lasterrno = errno;
509 +        if (erract[WARNING].pf == NULL)
510 +                return;         /* called by calcomp or someone */
511          eputs(s);
512          errno = lasterrno;
513   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines