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

Comparing ray/src/rt/ambcomp.c (file contents):
Revision 2.20 by greg, Fri Oct 28 16:16:33 2005 UTC vs.
Revision 2.22 by greg, Sun Sep 26 15:51:15 2010 UTC

# Line 94 | Line 94 | divsample(                             /* sample a division */
94                  ar.rdir[i] =    xd*h->ux[i] +
95                                  yd*h->uy[i] +
96                                  zd*h->uz[i];
97 +        checknorm(ar.rdir);
98          dimlist[ndims++] = dp->t*h->np + dp->p + 90171;
99          rayvalue(&ar);
100          ndims--;
# Line 204 | Line 205 | doambient(                             /* compute ambient component */
205                          else
206                                  addcolor(acol, dp->v);
207                  }
208 <        if (!divcnt)
208 >        if (!divcnt) {
209 >                if (div != NULL)
210 >                        free((void *)div);
211                  return(0.0);            /* no samples taken */
212 +        }
213          if (divcnt < hemi.nt*hemi.np) {
214                  pg = dg = NULL;         /* incomplete sampling */
215                  hemi.ns = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines