1 |
< |
/* Copyright (c) 1993 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1994 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
500 |
|
b = fillsample(scanline, zline, 0, y, i, 0, b/2); |
501 |
|
else |
502 |
|
b = fillsample(scanline+i-xstep, |
503 |
< |
zline ? zline+i-xstep : NULL, |
503 |
> |
zline ? zline+i-xstep : (float *)NULL, |
504 |
|
i-xstep, y, xstep, 0, b/2); |
505 |
|
if (sd) *sd++ = nc & 1 ? bl : b; |
506 |
|
bl = b; |
528 |
|
zline[ysize] = zbar[ysize][i]; |
529 |
|
} |
530 |
|
|
531 |
< |
b = fillsample(vline, zbar[0] ? zline : NULL, |
531 |
> |
b = fillsample(vline, zbar[0] ? zline : (float *)NULL, |
532 |
|
i, y, 0, ysize, b/2); |
533 |
|
|
534 |
|
for (j = 1; j < ysize; j++) |
586 |
|
/* recurse */ |
587 |
|
ncut += fillsample(colline, zline, x, y, xlen>>1, ylen>>1, (b-1)/2); |
588 |
|
|
589 |
< |
ncut += fillsample(colline+(len>>1), zline ? zline+(len>>1) : NULL, |
589 |
> |
ncut += fillsample(colline+(len>>1), |
590 |
> |
zline ? zline+(len>>1) : (float *)NULL, |
591 |
|
x+(xlen>>1), y+(ylen>>1), |
592 |
|
xlen-(xlen>>1), ylen-(ylen>>1), b/2); |
593 |
|
|
602 |
|
{ |
603 |
|
static RAY thisray; |
604 |
|
|
605 |
< |
if (viewray(thisray.rorg, thisray.rdir, &ourview, |
606 |
< |
(x+pixjitter())/hres, (y+pixjitter())/vres) < 0) { |
605 |
> |
if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview, |
606 |
> |
(x+pixjitter())/hres, (y+pixjitter())/vres)) < -FTINY) { |
607 |
|
setcolor(col, 0.0, 0.0, 0.0); |
608 |
|
return(0.0); |
609 |
|
} |
629 |
|
int x, y; |
630 |
|
|
631 |
|
if (oldfile == NULL) |
632 |
< |
return(0); |
633 |
< |
|
632 |
> |
goto gotzip; |
633 |
> |
|
634 |
|
if ((fp = fopen(oldfile, "r")) == NULL) { |
635 |
|
sprintf(errmsg, "cannot open recover file \"%s\"", oldfile); |
636 |
|
error(WARNING, errmsg); |
637 |
< |
return(0); |
637 |
> |
goto gotzip; |
638 |
|
} |
639 |
|
#ifdef MSDOS |
640 |
|
setmode(fileno(fp), O_BINARY); |
647 |
|
oldfile); |
648 |
|
error(WARNING, errmsg); |
649 |
|
fclose(fp); |
650 |
< |
return(0); |
650 |
> |
goto gotzip; |
651 |
|
} |
652 |
|
|
653 |
|
if (x != hres || y != vres) { |
671 |
|
fclose(fp); |
672 |
|
unlink(oldfile); |
673 |
|
return(y); |
674 |
+ |
gotzip: |
675 |
+ |
if (fflush(stdout) == EOF) |
676 |
+ |
error(SYSTEM, "error writing picture header"); |
677 |
+ |
return(0); |
678 |
|
writerr: |
679 |
|
sprintf(errmsg, "write error during recovery of \"%s\"", oldfile); |
680 |
|
error(SYSTEM, errmsg); |