changeset 904:d3cd9f2a8ef1

Some dummy code for encfunctions.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 23 Feb 2015 22:00:44 +0200
parents f29a6164ec80
children b83868a23ca5
files src/lib64gfx.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib64gfx.c	Mon Feb 23 22:00:20 2015 +0200
+++ b/src/lib64gfx.c	Mon Feb 23 22:00:44 2015 +0200
@@ -678,6 +678,22 @@
             case DT_BGCOLOR:     *dst = img->bgcolor; break;
             case DT_EXTRADATA:   memcpy(dst, img->extradata, size); break;
             case DT_ENC_FUNCTION:
+                if (op->encfunction == NULL)
+                {
+                    dmError("Encode op is a function, but function ptr is NULL: "
+                        "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
+                        i, op->offs, op->offs, op->bank, size, size, *plen, *plen);
+                    return DMERR_INTERNAL;
+                }
+                /*
+                if (!op->encfunction(op, buf, len))
+                {
+                    dmError("Encode op custom function failed: op #%d, "
+                        "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n",
+                        i, op->offs, op->offs, op->bank, size, size, len, len);
+                    return DMERR_INTERNAL;
+                }
+                */
                 break;
         }
     }