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.33 by greg, Wed May 14 20:43:46 2003 UTC vs.
Revision 2.35 by schorsch, Sun Jul 27 22:12:03 2003 UTC

# 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 297 | Line 297 | char  *p;                      /* data for f */
297                                          maxcntr*sizeof(CONTRIB));
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