changeset 475:c0dedfef3edf

Fix option parsing of mappings.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 07 Nov 2012 01:12:51 +0200
parents 95d1facfdb77
children 3256cd39f5be
files gfxconv.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gfxconv.c	Wed Nov 07 01:01:15 2012 +0200
+++ b/gfxconv.c	Wed Nov 07 01:12:51 2012 +0200
@@ -324,7 +324,7 @@
     if (requireIndex)
     {
         DMMapValue *value = (DMMapValue *) pvalue;
-        if (!dmParseMapOptionMapItem(opt, value, nmax, msg))
+        if (!dmParseMapOptionMapItem(opt, &value[index], nmax, msg))
             return FALSE;
     }
     else
@@ -790,8 +790,7 @@
         }
         else
         {
-            dmMsg(3, "Map index %d: %d -> %d\n",
-                index,
+            dmMsg(3, "Map index: %d -> %d\n",
                 map->from, map->to);
             
             dpal[map->to] = map->from;
@@ -822,6 +821,7 @@
     dmMsg(3, "Creating new palette.\n");
     for (index = 0; index < image->ncolors; index++)
     {
+        dmMsg(4, "%d -> %d\n", index, dpal[index]);
         if (dpal[index] >= 0 && dpal[index] < image->ncolors)
         {
             memcpy(&npal[index], &(image->pal[dpal[index]]), sizeof(DMColor));