182 |
|
if (write(zfd, (char *)zbar[0], hresolu*sizeof(float)) |
183 |
|
< hresolu*sizeof(float)) |
184 |
|
goto writerr; |
185 |
< |
close(zfd); |
185 |
> |
if (close(zfd) == -1) |
186 |
> |
goto writerr; |
187 |
|
for (i = 0; i <= psample; i++) |
188 |
|
free((char *)zbar[i]); |
189 |
|
} |
235 |
|
COLOR vline[MAXDIV+1]; |
236 |
|
float zline[MAXDIV+1]; |
237 |
|
int b = ysize; |
237 |
– |
double z; |
238 |
|
register int i, j; |
239 |
|
|
240 |
|
for (i = 0; i < xres; i++) { |
320 |
|
{ |
321 |
|
static RAY thisray; /* our ray for this pixel */ |
322 |
|
|
323 |
< |
viewray(thisray.rorg, thisray.rdir, &ourview, |
324 |
< |
(x+pixjitter())/hresolu, (y+pixjitter())/vresolu); |
323 |
> |
if (viewray(thisray.rorg, thisray.rdir, &ourview, |
324 |
> |
(x+pixjitter())/hresolu, (y+pixjitter())/vresolu) < 0) { |
325 |
> |
setcolor(col, 0.0, 0.0, 0.0); |
326 |
> |
return(0.0); |
327 |
> |
} |
328 |
|
|
329 |
|
rayorigin(&thisray, NULL, PRIMARY, 1.0); |
330 |
|
|
332 |
|
|
333 |
|
copycolor(col, thisray.rcol); /* return color */ |
334 |
|
|
335 |
< |
return(thisray.rot); /* return distance */ |
335 |
> |
return(thisray.rt); /* return distance */ |
336 |
|
} |
337 |
|
|
338 |
|
|