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 1.19 by greg, Thu Jan 11 11:06:22 1990 UTC vs.
Revision 1.24 by greg, Thu Dec 13 10:44:04 1990 UTC

# Line 47 | Line 47 | marksources()                  /* find and mark source objects */
47  
48                  m = objptr(o->omod);
49  
50 <                if (m->otype != MAT_LIGHT &&
51 <                                m->otype != MAT_ILLUM &&
52 <                                m->otype != MAT_GLOW &&
53 <                                m->otype != MAT_SPOT)
50 >                if (!islight(m->otype))
51                          continue;
52          
53                  if (m->oargs.nfargs != (m->otype == MAT_GLOW ? 4 :
# Line 310 | Line 307 | char  *p;                      /* data for f */
307          double  prob, ourthresh, hwt, test2, hit2;
308          RAY  sr;
309  
310 +        if (nsources <= 0)
311 +                return;
312          srccnt = (CONTRIB *)malloc(nsources*sizeof(CONTRIB));
313          cntord = (CNTPTR *)malloc(nsources*sizeof(CNTPTR));
314          if (srccnt == NULL || cntord == NULL)
# Line 395 | Line 394 | char  *p;                      /* data for f */
394          }
395                                          /* weighted hit rate */
396          hwt = hit2 / test2;
397 < #ifdef notdef
397 > #ifdef DEBUG
398          sprintf(errmsg, "%d tested, %d untested, %f hit rate\n",
399                          sn, ncnts-sn, hwt);
400          eputs(errmsg);
# Line 408 | Line 407 | char  *p;                      /* data for f */
407                  addcolor(r->rcol, srccnt[cntord[sn].sno].val);
408          }
409                  
410 <        free(srccnt);
411 <        free(cntord);
410 >        free((char *)srccnt);
411 >        free((char *)cntord);
412   }
413  
414  
# Line 453 | Line 452 | register RAY  *r;
452                                    m->oargs.farg[2]);
453                                                  /* modify value */
454                  multcolor(r->rcol, r->pcol);
455 +                                                /* assign distance */
456 +                r->rt = r->rot;
457          }
458   }
458
459
460 o_source() {}           /* intersection with a source is done elsewhere */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines