Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 1828:6e1dd79c6bce
Use dmGrowBufPutU16LE() instead of two dmGrowBufPutU8() to push the loading
address into target buffer in dmC64EncodeBMP().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 22 Jun 2018 13:41:54 +0300 |
parents | d6fbbf7ddba1 |
children | ce1a734b016f |
comparison
equal
deleted
inserted
replaced
1827:d6fbbf7ddba1 | 1828:6e1dd79c6bce |
---|---|
1443 // Allocate a buffer | 1443 // Allocate a buffer |
1444 if ((res = dmGrowBufAlloc(buf, BUF_SIZE_INITIAL, BUF_SIZE_GROW)) != DMERR_OK) | 1444 if ((res = dmGrowBufAlloc(buf, BUF_SIZE_INITIAL, BUF_SIZE_GROW)) != DMERR_OK) |
1445 goto err; | 1445 goto err; |
1446 | 1446 |
1447 // Add the loading address | 1447 // Add the loading address |
1448 if (!dmGrowBufPutU8(buf, DM_GET_ADDR_LO(fmt->addr)) || | 1448 if (!dmGrowBufPutU16LE(buf, fmt->addr)) |
1449 !dmGrowBufPutU8(buf, DM_GET_ADDR_HI(fmt->addr))) | |
1450 goto err; | 1449 goto err; |
1451 | 1450 |
1452 // Attempt to encode the image to a buffer | 1451 // Attempt to encode the image to a buffer |
1453 if (fmt->encode != NULL) | 1452 if (fmt->encode != NULL) |
1454 res = fmt->encode(buf, img, fmt); | 1453 res = fmt->encode(buf, img, fmt); |