| # | 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; | |
| – | Removed lines |
| + | Added lines |
| < | Changed lines (old) |
| > | Changed lines (new) |