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

Comparing ray/src/rt/rcontrib.c (file contents):
Revision 2.44 by greg, Fri Feb 23 03:45:52 2024 UTC vs.
Revision 2.46 by greg, Wed Oct 23 23:51:20 2024 UTC

# Line 12 | Line 12 | static const char RCSid[] = "$Id$";
12   #include "otypes.h"
13   #include "source.h"
14  
15 char    *shm_boundary = NULL;           /* boundary of shared memory */
16
15   CUBE    thescene;                       /* our scene */
16   OBJECT  nsceneobjs;                     /* number of objects in our scene */
17  
# Line 93 | Line 91 | formstr(                               /* return format identifier */
91   MODCONT *
92   addmodifier(char *modn, char *outf, char *prms, char *binv, int bincnt)
93   {
94 <        LUENT   *lep = lu_find(&modconttab,modn);
95 <        MODCONT *mp;
96 <        EPNODE  *ebinv;
97 <        int     i;
98 <        
94 >        static int      lastNCS = 0;
95 >        LUENT           *lep = lu_find(&modconttab,modn);
96 >        MODCONT         *mp;
97 >        EPNODE          *ebinv;
98 >        int             i;
99 >
100 >        if (!lastNCS)
101 >                lastNCS = NCSAMP;
102 >        else if (NCSAMP != lastNCS)
103 >                error(INTERNAL,
104 >                "number of spectral samples must be set before first modifier");
105          if (lep->data != NULL) {
106                  sprintf(errmsg, "duplicate modifier '%s'", modn);
107                  error(USER, errmsg);
# Line 113 | Line 117 | addmodifier(char *modn, char *outf, char *prms, char *
117                  else
118                          modname = (char **)realloc(modname, modasiz*sizeof(char *));
119                  if (modname == NULL)
120 <                        error(SYSTEM, "Out of memory in addmodifier()");
120 >                        error(SYSTEM, "out of memory in addmodifier()");
121          }
122          modname[nmods++] = modn;        /* XXX assumes static string */
123          lep->key = modn;                /* XXX assumes static string */
# Line 226 | Line 230 | rcinit(void)
230          if (nproc > MAXPROCESS)
231                  sprintf(errmsg, "too many processes requested -- reducing to %d",
232                                  nproc = MAXPROCESS);
233 <        if (nproc > 1) {
234 <                preload_objs();         /* preload auxiliary data */
231 <                                        /* set shared memory boundary */
232 <                shm_boundary = strcpy((char *)malloc(16), "SHM_BOUNDARY");
233 <        }
233 >        if (nproc > 1)
234 >                cow_memshare();         /* preload auxiliary data */
235          trace = trace_contrib;          /* set up trace call-back */
236          for (i = 0; i < nsources; i++)  /* tracing to sources as well */
237                  source[i].sflags |= SFOLLOW;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines