Mercurial > hg > dmlib
diff tools/lib64gfx.c @ 2238:5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
DMC64Image::extraInfo[] where it actually makes sense. Also add index for
FLI type.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 15 Jun 2019 06:43:36 +0300 |
parents | a36c81c3df85 |
children | 48b48251610a |
line wrap: on
line diff
--- a/tools/lib64gfx.c Sat Jun 15 06:26:07 2019 +0300 +++ b/tools/lib64gfx.c Sat Jun 15 06:43:36 2019 +0300 @@ -1043,7 +1043,7 @@ case DS_D022: case DS_D023: case DS_D024: - case DS_ILACE_TYPE: + case DS_EXTRA_INFO: switch (op->type) { case DO_COPY: @@ -1077,7 +1077,7 @@ case DS_D022: img->d022 = value; break; case DS_D023: img->d023 = value; break; case DS_D024: img->d024 = value; break; - case DS_ILACE_TYPE: img->laceType = value; break; + case DS_EXTRA_INFO: img->extraInfo[op->offs2] = value; break; } break; @@ -1125,8 +1125,8 @@ } // Sanity check certain things .. - if ((fmt->format->type & D64_FMT_ILACE) && img->laceType == D64_ILACE_NONE) - { + if ((fmt->format->type & D64_FMT_ILACE) && + img->extraInfo[D64_EI_ILACE_TYPE] == D64_ILACE_NONE) { return dmError(DMERR_INTERNAL, "Format '%s' (%s) has interlace flag set, but interlace type is not set.\n", fmt->name, fmt->fext); @@ -1251,7 +1251,7 @@ case DS_D022: case DS_D023: case DS_D024: - case DS_ILACE_TYPE: + case DS_EXTRA_INFO: switch (op->subject) { case DS_D020: value = img->d020; break; @@ -1260,7 +1260,7 @@ case DS_D022: value = img->d022; break; case DS_D023: value = img->d023; break; case DS_D024: value = img->d024; break; - case DS_ILACE_TYPE: value = img->laceType; break; + case DS_EXTRA_INFO: value = img->extraInfo[op->offs2]; break; } switch (op->type) { @@ -1279,6 +1279,7 @@ case DO_SET_OP: // Do nothing in this case + // XXX TODO: what about DS_EXTRA_INFO? break; default: @@ -1451,7 +1452,9 @@ return DMERR_MALLOC; // Set palette information - mixed = (src->fmt->type & D64_FMT_ILACE) && src->laceType == D64_ILACE_COLOR; + mixed = (src->fmt->type & D64_FMT_ILACE) && + src->extraInfo[D64_EI_ILACE_TYPE] == D64_ILACE_COLOR; + if ((res = dmC64SetImagePalette(dst, spec, mixed)) != DMERR_OK) return res;