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.34 by greg, Tue Jun 24 15:37:01 2003 UTC vs.
Revision 2.36 by greg, Tue Aug 26 16:09:44 2003 UTC

# Line 60 | Line 60 | marksources()                  /* find and mark source objects */
60  
61                  if (!issurface(o->otype) || o->omod == OVOID)
62                          continue;
63 <
63 >                                        /* find material */
64                  m = objptr(o->omod);
65 <
66 <                if (!islight(m->otype))
67 <                        continue;
65 >                while (!ismaterial(m->otype))
66 >                        if (ismixture(m->otype) || m->omod == OVOID) {
67 >                                m = NULL;
68 >                                break;
69 >                        } else
70 >                                m = objptr(m->omod);
71 >                if (m == NULL || !islight(m->otype))
72 >                        continue;       /* not source modifier */
73          
74                  if (m->oargs.nfargs != (m->otype == MAT_GLOW ? 4 :
75                                  m->otype == MAT_SPOT ? 7 : 3))
# Line 115 | Line 120 | marksources()                  /* find and mark source objects */
120          maxcntr = nsources + MAXSPART;  /* start with this many */
121          srccnt = (CONTRIB *)malloc(maxcntr*sizeof(CONTRIB));
122          cntord = (CNTPTR *)malloc(maxcntr*sizeof(CNTPTR));
123 <        if (srccnt == NULL | cntord == NULL)
123 >        if ((srccnt == NULL) | (cntord == NULL))
124                  goto memerr;
125          return;
126   memerr:
# Line 297 | Line 302 | char  *p;                      /* data for f */
302                                          maxcntr*sizeof(CONTRIB));
303                          cntord = (CNTPTR *)realloc((void *)cntord,
304                                          maxcntr*sizeof(CNTPTR));
305 <                        if (srccnt == NULL | cntord == NULL)
305 >                        if ((srccnt == NULL) | (cntord == NULL))
306                                  error(SYSTEM, "out of memory in direct");
307                  }
308                  cntord[sn].sndx = sn;
# Line 493 | Line 498 | register RAY  *r;
498  
499   static int weaksrcmod(obj) int obj;     /* efficiency booster function */
500   {register OBJREC *o = objptr(obj);
501 < return(o->otype==MAT_ILLUM|o->otype==MAT_GLOW);}
501 > return((o->otype==MAT_ILLUM)|(o->otype==MAT_GLOW));}
502  
503   #define  illumblock(m, r)       (!(source[r->rsrc].sflags&SVIRTUAL) && \
504                                  r->rod > 0.0 && \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines