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

Comparing ray/src/rt/source.c (file contents):
Revision 2.31 by greg, Tue Mar 11 17:08:55 2003 UTC vs.
Revision 2.35 by schorsch, Sun Jul 27 22:12:03 2003 UTC

# Line 54 | Line 54 | marksources()                  /* find and mark source objects */
54                                          /* initialize dispatch table */
55          initstypes();
56                                          /* find direct sources */
57 <        for (i = 0; i < nobjects; i++) {
57 >        for (i = 0; i < nsceneobjs; i++) {
58          
59                  o = objptr(i);
60  
# Line 115 | Line 115 | marksources()                  /* find and mark source objects */
115          maxcntr = nsources + MAXSPART;  /* start with this many */
116          srccnt = (CONTRIB *)malloc(maxcntr*sizeof(CONTRIB));
117          cntord = (CNTPTR *)malloc(maxcntr*sizeof(CNTPTR));
118 <        if (srccnt == NULL | cntord == NULL)
118 >        if ((srccnt == NULL) | (cntord == NULL))
119                  goto memerr;
120          return;
121   memerr:
# Line 293 | Line 293 | char  *p;                      /* data for f */
293          for (sn = 0; srcray(&sr, r, &si); sn++) {
294                  if (sn >= maxcntr) {
295                          maxcntr = sn + MAXSPART;
296 <                        srccnt = (CONTRIB *)realloc((char *)srccnt,
296 >                        srccnt = (CONTRIB *)realloc((void *)srccnt,
297                                          maxcntr*sizeof(CONTRIB));
298 <                        cntord = (CNTPTR *)realloc((char *)cntord,
298 >                        cntord = (CNTPTR *)realloc((void *)cntord,
299                                          maxcntr*sizeof(CNTPTR));
300 <                        if (srccnt == NULL | cntord == NULL)
300 >                        if ((srccnt == NULL) | (cntord == NULL))
301                                  error(SYSTEM, "out of memory in direct");
302                  }
303                  cntord[sn].sndx = sn;
# Line 355 | Line 355 | char  *p;                      /* data for f */
355                  rayorigin(&sr, r, SHADOW, 1.0);
356                  VCOPY(sr.rdir, scp->dir);
357                  sr.rsrc = scp->sno;
358 <                source[scp->sno].ntests++;      /* keep statistics */
358 >                                                /* keep statistics */
359 >                if (source[scp->sno].ntests++ > 0xfffffff0) {
360 >                        source[scp->sno].ntests >>= 1;
361 >                        source[scp->sno].nhits >>= 1;
362 >                }
363                  if (localhit(&sr, &thescene) &&
364                                  ( sr.ro != source[scp->sno].so ||
365                                  source[scp->sno].sflags & SFOLLOW )) {
# Line 489 | Line 493 | register RAY  *r;
493  
494   static int weaksrcmod(obj) int obj;     /* efficiency booster function */
495   {register OBJREC *o = objptr(obj);
496 < return(o->otype==MAT_ILLUM|o->otype==MAT_GLOW);}
496 > return((o->otype==MAT_ILLUM)|(o->otype==MAT_GLOW));}
497  
498   #define  illumblock(m, r)       (!(source[r->rsrc].sflags&SVIRTUAL) && \
499                                  r->rod > 0.0 && \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines