| 80 |
|
} |
| 81 |
|
free((char *)spanbr); |
| 82 |
|
close_allsrcs(); |
| 83 |
– |
absorb_specks(); |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
|
| 99 |
|
d = indirect[i].lcos - tanb*indirect[i].lsin; |
| 100 |
|
if (d > 0.0) { |
| 101 |
|
indirect[i].sum += d * br; |
| 102 |
< |
indirect[i].n++; |
| 102 |
> |
indirect[i].n += d; |
| 103 |
|
} |
| 104 |
|
} |
| 105 |
|
return; |
| 113 |
|
d = indirect[i].rcos - tanb*indirect[i].rsin; |
| 114 |
|
if (d > 0.0) { |
| 115 |
|
indirect[i].sum += d * br; |
| 116 |
< |
indirect[i].n++; |
| 116 |
> |
indirect[i].n += d; |
| 117 |
|
} |
| 118 |
|
} |
| 119 |
|
return; |
| 123 |
|
d = cos(h_theta(h) - indirect[i].theta); |
| 124 |
|
if (d > 0.0) { |
| 125 |
|
indirect[i].sum += d * br; |
| 126 |
< |
indirect[i].n++; |
| 126 |
> |
indirect[i].n += d; |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
} |
| 339 |
|
fprintf(stderr, "%s: absorbing small sources...\n", progname); |
| 340 |
|
head.next = donelist; |
| 341 |
|
last = &head; |
| 342 |
< |
for (this = donelist; this != NULL; this = this->next) |
| 342 |
> |
for (this = head.next; this != NULL; this = this->next) |
| 343 |
|
if (TOOSMALL(this)) { |
| 344 |
|
last->next = this->next; |
| 345 |
< |
buddy = findbuddy(this, donelist); |
| 345 |
> |
buddy = findbuddy(this, head.next); |
| 346 |
|
if (buddy != NULL) |
| 347 |
|
mergesource(buddy, this); |
| 348 |
|
else |
| 358 |
|
register struct source *s; |
| 359 |
|
{ |
| 360 |
|
FVECT dir; |
| 361 |
< |
register int i, n; |
| 361 |
> |
double d; |
| 362 |
> |
register int i; |
| 363 |
|
|
| 364 |
|
for (i = 0; i < nglardirs; i++) { |
| 365 |
|
spinvector(dir, ourview.vdir, ourview.vup, indirect[i].theta); |
| 366 |
< |
n = DOT(dir,s->dir)*s->dom*(sampdens*sampdens) + 0.5; |
| 367 |
< |
if (n == 0) |
| 366 |
> |
d = DOT(dir,s->dir)*s->dom*(sampdens*sampdens); |
| 367 |
> |
if (d <= 0.0) |
| 368 |
|
continue; |
| 369 |
< |
indirect[i].sum += n * s->brt; |
| 370 |
< |
indirect[i].n += n; |
| 369 |
> |
indirect[i].sum += d * s->brt; |
| 370 |
> |
indirect[i].n += d; |
| 371 |
|
} |
| 372 |
|
for ( ; s->first != NULL; s->first = s->first->next) |
| 373 |
|
free((char *)s->first); |