--- ray/src/hd/rhcopy.c 2008/11/10 19:08:19 3.24 +++ ray/src/hd/rhcopy.c 2017/05/03 21:15:06 3.29 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rhcopy.c,v 3.24 2008/11/10 19:08:19 greg Exp $"; +static const char RCSid[] = "$Id: rhcopy.c,v 3.29 2017/05/03 21:15:06 greg Exp $"; #endif /* * Copy data into a holodeck file @@ -134,7 +134,7 @@ openholo( /* open existing holodeck file for i/o */ FILE *fp; int fd; int hflags = 0; - long nextloc; + off_t nextloc; int n; /* open holodeck file */ if ((fp = fopen(fname, append ? "r+" : "r")) == NULL) { @@ -152,7 +152,7 @@ openholo( /* open existing holodeck file for i/o */ nextloc = ftell(fp); /* get stdio position */ fclose(fp); /* done with stdio */ for (n = 0; nextloc > 0L; n++) { /* initialize each section */ - lseek(fd, (off_t)nextloc, SEEK_SET); + lseek(fd, nextloc, SEEK_SET); read(fd, (char *)&nextloc, sizeof(nextloc)); hdinit(fd, NULL)->priv = hflags&H_OBST ? &obstr : hflags&H_OBSF ? &unobstr : (char *)NULL; @@ -176,7 +176,7 @@ addray( /* add a ray to our output holodeck */ int sn, bi, n; register HOLO *hp; GCOORD gc[2]; - BYTE rr[2][2]; + uby8 rr[2][2]; BEAM *bp; double d0, d1; unsigned dc; @@ -359,7 +359,7 @@ addpicz( /* add a picture + depth-buffer */ error(USER, errmsg); } if (phd.altprims) { - sprintf(errmsg, "ignoring primary values in picture \"%s\"", + sprintf(errmsg, "ignoring color primaries in picture \"%s\"", pcf); error(WARNING, errmsg); } @@ -398,6 +398,8 @@ addpicz( /* add a picture + depth-buffer */ error(USER, errmsg); } for (i = scanlen(&prs); i--; ) { /* do each pixel */ + if (zscn[i] <= 0.0) + continue; /* illegal depth */ pix2loc(vl, &prs, i, j); aftd = viewray(ro, rd, &phd.vw, vl[0], vl[1]); if (aftd < -FTINY)