changeset 1535:2f7ff28ea56e

Fix DrazLace encoding.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 12 May 2018 04:05:10 +0300
parents acad4974dc09
children 064fc2e3ee64
files tools/lib64fmts.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sat May 12 03:28:25 2018 +0300
+++ b/tools/lib64fmts.c	Sat May 12 04:05:10 2018 +0300
@@ -124,6 +124,15 @@
 }
 
 
+static BOOL fmtDrazLaceSetLaceType(const DMC64EncDecOp *op, DMGrowBuf *buf,
+    const DMC64Image *img, const DMC64ImageFormat *fmt)
+{
+    (void) fmt;
+    buf->data[op->offs] = (img->laceType == D64_ILACE_RES) ? 1 : 0;
+    return TRUE;
+}
+
+
 static int fmtProbeGunPaint(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt)
 {
     if (len > 0x400 &&
@@ -529,6 +538,7 @@
             { DT_COLOR_REG,    0x2740, 0,  DC_BGCOL, NULL, NULL },
             { DT_BITMAP,       0x2800, 1,  0, NULL, NULL },
             { DT_DEC_FUNCTION, 0x2742, 0,  1, fmtDrazLaceGetLaceType, NULL },
+            { DT_ENC_FUNCTION, 0x2742, 0,  1, NULL, fmtDrazLaceSetLaceType },
             { DT_LAST,         0,      0,  0, NULL, NULL },
         }
     },
@@ -548,6 +558,7 @@
             { DT_COLOR_REG,    0x2740, 0,  DC_BGCOL, NULL, NULL },
             { DT_BITMAP,       0x2800, 1,  0, NULL, NULL },
             { DT_DEC_FUNCTION, 0x2742, 0,  1, fmtDrazLaceGetLaceType, NULL },
+            { DT_ENC_FUNCTION, 0x2742, 0,  1, NULL, fmtDrazLaceSetLaceType },
             { DT_LAST,         0,      0,  0, NULL, NULL },
         }
     },