--- ray/src/rt/source.c 1990/01/11 11:06:22 1.19 +++ ray/src/rt/source.c 1990/12/13 10:44:04 1.24 @@ -47,10 +47,7 @@ marksources() /* find and mark source objects */ m = objptr(o->omod); - if (m->otype != MAT_LIGHT && - m->otype != MAT_ILLUM && - m->otype != MAT_GLOW && - m->otype != MAT_SPOT) + if (!islight(m->otype)) continue; if (m->oargs.nfargs != (m->otype == MAT_GLOW ? 4 : @@ -310,6 +307,8 @@ char *p; /* data for f */ double prob, ourthresh, hwt, test2, hit2; RAY sr; + if (nsources <= 0) + return; srccnt = (CONTRIB *)malloc(nsources*sizeof(CONTRIB)); cntord = (CNTPTR *)malloc(nsources*sizeof(CNTPTR)); if (srccnt == NULL || cntord == NULL) @@ -395,7 +394,7 @@ char *p; /* data for f */ } /* weighted hit rate */ hwt = hit2 / test2; -#ifdef notdef +#ifdef DEBUG sprintf(errmsg, "%d tested, %d untested, %f hit rate\n", sn, ncnts-sn, hwt); eputs(errmsg); @@ -408,8 +407,8 @@ char *p; /* data for f */ addcolor(r->rcol, srccnt[cntord[sn].sno].val); } - free(srccnt); - free(cntord); + free((char *)srccnt); + free((char *)cntord); } @@ -453,8 +452,7 @@ register RAY *r; m->oargs.farg[2]); /* modify value */ multcolor(r->rcol, r->pcol); + /* assign distance */ + r->rt = r->rot; } } - - -o_source() {} /* intersection with a source is done elsewhere */