comparison tools/libgfx.c @ 1618:4c96181c9c09

Cleanup.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 16 May 2018 13:19:26 +0300
parents 36d073c45327
children dacf4c2f7a86
comparison
equal deleted inserted replaced
1617:625a7867877e 1618:4c96181c9c09
1614 int dmDecodeILBMBody(DMResource *fp, DMIFF *iff, DMImage **pimg, Uint32 *read) 1614 int dmDecodeILBMBody(DMResource *fp, DMIFF *iff, DMImage **pimg, Uint32 *read)
1615 { 1615 {
1616 DMImage *img; 1616 DMImage *img;
1617 Uint8 *buf; 1617 Uint8 *buf;
1618 size_t bufLen; 1618 size_t bufLen;
1619 int yc, res = DMERR_OK; 1619 int res = DMERR_OK;
1620 1620
1621 *read = 0; 1621 *read = 0;
1622 1622
1623 // Allocate image 1623 // Allocate image
1624 if ((*pimg = img = dmImageAlloc(iff->bmhd.w, iff->bmhd.h, 1624 if ((*pimg = img = dmImageAlloc(iff->bmhd.w, iff->bmhd.h,
1635 return DMERR_MALLOC; 1635 return DMERR_MALLOC;
1636 1636
1637 dmMsg(2, "ILBM: plane row size %d bytes.\n", bufLen); 1637 dmMsg(2, "ILBM: plane row size %d bytes.\n", bufLen);
1638 1638
1639 // Decode the chunk 1639 // Decode the chunk
1640 for (yc = 0; yc < img->height; yc++) 1640 for (int yc = 0; yc < img->height; yc++)
1641 { 1641 {
1642 const int nplanes = iff->bmhd.nplanes; 1642 const int nplanes = iff->bmhd.nplanes;
1643 Uint8 *dp = img->data + (yc * img->pitch); 1643 Uint8 *dp = img->data + (yc * img->pitch);
1644 1644
1645 dmMemset(dp, 0, img->pitch); 1645 dmMemset(dp, 0, img->pitch);