160 |
|
|
161 |
|
d = normalize(direc); |
162 |
|
if (d == 0.0) { /* zero ==> flush */ |
163 |
– |
if (nproc > 1 && ray_fifo_flush() < 0) |
164 |
– |
error(USER, "lost children"); |
165 |
– |
bogusray(); |
163 |
|
if (--nextflush <= 0 || !vcount) { |
164 |
+ |
if (nproc > 1 && ray_fifo_flush() < 0) |
165 |
+ |
error(USER, "lost children"); |
166 |
+ |
bogusray(); |
167 |
|
fflush(stdout); |
168 |
|
nextflush = hresolu; |
169 |
< |
} |
169 |
> |
} else |
170 |
> |
bogusray(); |
171 |
|
} else { /* compute and print */ |
172 |
|
rtcompute(orig, direc, lim_dist ? d : 0.0); |
173 |
|
/* flush if time */ |
321 |
|
RAY *r |
322 |
|
) |
323 |
|
{ |
324 |
+ |
void (*old_revf)(RAY *) = r->revf; |
325 |
+ |
|
326 |
|
r->rot = 1e-5; /* pretend we hit surface */ |
327 |
|
VSUM(r->rop, r->rorg, r->rdir, r->rot); |
328 |
|
r->ron[0] = -r->rdir[0]; |
329 |
|
r->ron[1] = -r->rdir[1]; |
330 |
|
r->ron[2] = -r->rdir[2]; |
331 |
|
r->rod = 1.0; |
329 |
– |
r->revf = raytrace; |
332 |
|
/* compute result */ |
333 |
+ |
r->revf = raytrace; |
334 |
|
(*ofun[Lamb.otype].funp)(&Lamb, r); |
335 |
+ |
r->revf = old_revf; |
336 |
|
} |
337 |
|
|
338 |
|
|