comparison tools/64vw.c @ 2265:48b48251610a

Refactor how the image "mode/type" is handled. It is still not perfect for our purposes, but better now.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Jun 2019 02:03:35 +0300
parents 2e656da1b10b
children 8ad08ab4975b
comparison
equal deleted inserted replaced
2264:e25fa516b53a 2265:48b48251610a
222 bmap.data = surf->pixels; 222 bmap.data = surf->pixels;
223 bmap.pitch = surf->pitch; 223 bmap.pitch = surf->pitch;
224 bmap.width = surf->w; 224 bmap.width = surf->w;
225 bmap.height = surf->h; 225 bmap.height = surf->h;
226 226
227 mixedPalette = (cimage->fmt->type & D64_FMT_ILACE) && 227 mixedPalette = (cimage->extraInfo[D64_EI_MODE] & D64_FMT_ILACE) &&
228 cimage->extraInfo[D64_EI_ILACE_TYPE] == D64_ILACE_COLOR; 228 cimage->extraInfo[D64_EI_ILACE_TYPE] == D64_ILACE_COLOR;
229 229
230 if ((res = dmC64SetImagePalette(&bmap, spec, mixedPalette)) != DMERR_OK) 230 if ((res = dmC64SetImagePalette(&bmap, spec, mixedPalette)) != DMERR_OK)
231 { 231 {
232 dmErrorMsg("Could not create copy of palette.\n"); 232 dmErrorMsg("Could not create copy of palette.\n");
308 // Check for forced input format 308 // Check for forced input format
309 if (optForcedFormat >= 0) 309 if (optForcedFormat >= 0)
310 { 310 {
311 forced = &dmC64ImageFormats[optForcedFormat]; 311 forced = &dmC64ImageFormats[optForcedFormat];
312 dmMsg(0, "Forced %s format image, type %d, %s\n", 312 dmMsg(0, "Forced %s format image, type %d, %s\n",
313 forced->name, forced->format->type, forced->fext); 313 forced->name, forced->format->mode, forced->fext);
314 } 314 }
315 else 315 else
316 forced = NULL; 316 forced = NULL;
317 317
318 // If we are simply displaying file information, no need to initialize SDL etc 318 // If we are simply displaying file information, no need to initialize SDL etc