ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/bmpfile.c
(Generate patch)

Comparing ray/src/common/bmpfile.c (file contents):
Revision 2.7 by schorsch, Tue Mar 30 16:24:25 2004 UTC vs.
Revision 2.8 by greg, Sat Apr 10 02:54:44 2004 UTC

# Line 600 | Line 600 | wrseek(uint32 pos, BMPWriter *bw)
600   {
601          if (pos == bw->fpos)
602                  return BIR_OK;
603 <        if (bw->seek == NULL) {
604 <                if (pos < bw->fpos)
605 <                        return BIR_SEEKERR;
606 <                while (bw->fpos < pos)
607 <                        wrbyte(0, bw);
608 <                return BIR_OK;
609 <        }
603 >        if (bw->seek == NULL)
604 >                return BIR_SEEKERR;
605          if ((*bw->seek)(pos, bw->c_data) != 0)
606                  return BIR_SEEKERR;
607          bw->fpos = pos;
# Line 761 | Line 756 | BMPwriteScanline(BMPWriter *bw)
756          bw->yscan++;                            /* write line break or EOD */
757          if (bw->yscan == bw->hdr->height) {
758                  wrbyte(0, bw); wrbyte(1, bw);   /* end of bitmap marker */
759 <                if (bw->seek == NULL || (*bw->seek)(2, bw->c_data) != 0)
759 >                if (wrseek(2, bw) != BIR_OK)
760                          return BIR_OK;          /* no one may care */
761 <                bw->fpos = 2;
761 >                wrint32(bw->flen, bw);          /* correct file length */
762 >                if (wrseek(34, bw) != BIR_OK)
763 >                        return BIR_OK;
764                  wrint32(bw->flen-bw->fbmp, bw); /* correct bitmap length */
765          } else {
766                  wrbyte(0, bw); wrbyte(0, bw);   /* end of line marker */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines