# HG changeset patch # User Matti Hamalainen # Date 1526003728 -10800 # Node ID 06df2bdf5dc4e61a5e923a4cd26fb905ea81a30f # Parent bc13af8954d747d39206f7b073fb5f79bb1bfc47 Various fixes to dmC64EncodeGenericBMP(). diff -r bc13af8954d7 -r 06df2bdf5dc4 tools/lib64gfx.c --- a/tools/lib64gfx.c Fri May 11 04:52:43 2018 +0300 +++ b/tools/lib64gfx.c Fri May 11 04:55:28 2018 +0300 @@ -1432,15 +1432,6 @@ if (img == NULL || fmt == NULL) return DMERR_NULLPTR; - // Sanity check img vs format - if (img->type != fmt->type || - img->width != fmt->width || img->height != fmt->height) - { - res = dmError(DMERR_NOT_SUPPORTED, - "Can't directly encode a differing C64 bitmap image format.\n"); - goto err; - } - // Allocate the output buffer if ((res = dmGrowBufAlloc(buf, fmt->size, BUF_SIZE_GROW)) != DMERR_OK) { @@ -1449,7 +1440,6 @@ fmt->size); goto err; } - buf->len = fmt->size; // Perform encoding for (int i = 0; i < D64_MAX_ENCDEC_OPS; i++) @@ -1485,7 +1475,7 @@ goto err; } - if (fmt->size == 0 && chksize > buf->len) + if (chksize > buf->len) buf->len = chksize; // Perform operation @@ -1543,7 +1533,6 @@ i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); goto err; } - /* if (!op->encFunction(op, buf, img, fmt)) { res = dmError(DMERR_INTERNAL, @@ -1552,7 +1541,6 @@ i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); goto err; } - */ break; } }