Mercurial > hg > dmlib
changeset 1283:642a0dd98c6e
Oops, forgot to adjust the writing and reading when adding two members to
the PCX header struct.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 18 Aug 2017 02:52:35 +0300 |
parents | 086f49d616ac |
children | 28be63226b05 |
files | src/libgfx.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/libgfx.c Fri Aug 18 02:15:51 2017 +0300 +++ b/src/libgfx.c Fri Aug 18 02:52:35 2017 +0300 @@ -836,6 +836,8 @@ hdr.ymax = hdr.vres - 1; hdr.nplanes = dmImageGetBytesPerPixel(pcx.format); hdr.palInfo = 1; + hdr.hScreenSize = hdr.hres; + hdr.vScreenSize = hdr.vres; res = (img->width * spec->scaleX); hdr.bpl = res / 2; @@ -888,6 +890,8 @@ !dm_fwrite_byte(pcx.fp, hdr.nplanes) || !dm_fwrite_le16(pcx.fp, hdr.bpl) || !dm_fwrite_le16(pcx.fp, hdr.palInfo) || + !dm_fwrite_le16(pcx.fp, hdr.hScreenSize) || + !dm_fwrite_le16(pcx.fp, hdr.vScreenSize) || !dm_fwrite_str(pcx.fp, (Uint8 *) &hdr.filler, sizeof(hdr.filler))) { res = dmError(DMERR_FWRITE, @@ -1027,6 +1031,8 @@ !dm_fread_byte(fp, &hdr.nplanes) || !dm_fread_le16(fp, &hdr.bpl) || !dm_fread_le16(fp, &hdr.palInfo) || + !dm_fread_le16(fp, &hdr.hScreenSize) || + !dm_fread_le16(fp, &hdr.vScreenSize) || !dm_fread_str(fp, (Uint8 *) &hdr.filler, sizeof(hdr.filler))) { res = dmError(DMERR_FREAD,