# HG changeset patch # User Matti Hamalainen # Date 1503059256 -10800 # Node ID 32051ad352c8d6ee6e9f83221390babc82caa978 # Parent b812fad6f33ecfc7129696ce1334cb904d1564d8 Adjust debug messages and debug message levels in libgfx. diff -r b812fad6f33e -r 32051ad352c8 src/libgfx.c --- a/src/libgfx.c Fri Aug 18 15:20:44 2017 +0300 +++ b/src/libgfx.c Fri Aug 18 15:27:36 2017 +0300 @@ -434,7 +434,7 @@ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - dmMsg(3, "PNG: %d x %d, depth=%d, type=%d\n", + dmMsg(2, "PNG: %d x %d, depth=%d, type=%d\n", img->width * spec->scaleX, img->height * spec->scaleY, 8, fmt); @@ -584,7 +584,7 @@ } // Allocate image - dmMsg(3, "PNG: %d x %d, depth=%d, type=%d\n", + dmMsg(2, "PNG: %d x %d, depth=%d, type=%d\n", width, height, bit_depth, color_type); if ((*pimg = img = dmImageAlloc(width, height, DM_IFMT_PALETTE, bit_depth)) == NULL) @@ -608,7 +608,7 @@ { case PNG_COLOR_TYPE_GRAY: ncolors = 256; - dmMsg(3, "PNG: Generating %d color grayscale palette.\n", ncolors); + dmMsg(2, "PNG: Generating %d color grayscale palette.\n", ncolors); if (!dmImageAllocPalette(img, ncolors, -1)) { @@ -624,7 +624,7 @@ case PNG_COLOR_TYPE_PALETTE: png_get_PLTE(png_ptr, info_ptr, &palette, &ncolors); - dmMsg(3, "PNG: Palette of %d colors found.\n", ncolors); + dmMsg(2, "PNG: Palette of %d colors found.\n", ncolors); if (ncolors > 0 && palette != NULL) { if (!dmImageAllocPalette(img, ncolors, -1)) @@ -851,7 +851,7 @@ if (res % 2) hdr.bpl++; hdr.bpl *= 2; - dmMsg(3, "PCX: paletted=%d, nplanes=%d, bpp=%d, bpl=%d\n", + dmMsg(2, "PCX: paletted=%d, nplanes=%d, bpp=%d, bpl=%d\n", spec->paletted, hdr.nplanes, hdr.bitsPerPlane, hdr.bpl); pcx.bufLen = hdr.bpl * 4; @@ -914,7 +914,7 @@ { int i; dm_fwrite_byte(pcx.fp, 0x0C); - dmMsg(3, "PCX: Writing palette of %d active entries.\n", img->ncolors); + dmMsg(2, "PCX: Writing palette of %d active entries.\n", img->ncolors); for (i = 0; i < img->ncolors; i++) { @@ -1083,8 +1083,15 @@ goto error; } - dmMsg(3, "PCX: nplanes=%d, bpp=%d, bpl=%d\n", - hdr.nplanes, hdr.bitsPerPlane, hdr.bpl); + dmMsg(2, + "PCX: xmin=%d, ymin=%d, xmax=%d, ymax=%d, res=%dx%d, scr=%dx%d\n", + hdr.xmin, hdr.ymin, hdr.xmax, hdr.ymax, + hdr.hres, hdr.vres, + hdr.hScreenSize, hdr.vScreenSize); + + dmMsg(2, + "PCX: nplanes=%d, bpp=%d, bpl=%d, bitsPerPlane=%d\n", + hdr.nplanes, hdr.bitsPerPlane, hdr.bpl, hdr.bitsPerPlane); isPaletted = (hdr.bitsPerPlane * hdr.nplanes) < 8; if (!isPaletted) @@ -1446,7 +1453,7 @@ if ((buf = dmMalloc(bufLen)) == NULL) return DMERR_MALLOC; - dmMsg(3, "ILBM: plane row size %d bytes.\n", bufLen); + dmMsg(2, "ILBM: plane row size %d bytes.\n", bufLen); // Decode the chunk for (yc = 0; yc < img->height; yc++) @@ -1605,7 +1612,7 @@ "ILBM: Error reading BMHD chunk.\n"); } - dmMsg(3, "ILBM: BMHD %d x %d @ %d, %d : nplanes=%d, comp=%d, mask=%d\n", + dmMsg(2, "ILBM: BMHD %d x %d @ %d, %d : nplanes=%d, comp=%d, mask=%d\n", iff.bmhd.w, iff.bmhd.h, iff.bmhd.x, iff.bmhd.y, iff.bmhd.nplanes, iff.bmhd.compression, iff.bmhd.masking); @@ -1640,11 +1647,11 @@ } iff.ncolors = chunk.size / 3; - dmMsg(3, "ILBM: CMAP %d entries (%d bytes)\n", + dmMsg(2, "ILBM: CMAP %d entries (%d bytes)\n", iff.ncolors, chunk.size, 1 << iff.bmhd.nplanes); if (iff.bmhd.nplanes > 0 && iff.ncolors != 1 << iff.bmhd.nplanes) - dmMsg(3, "ILBM: Expected %d entries in CMAP.\n", 1 << iff.bmhd.nplanes); + dmMsg(2, "ILBM: Expected %d entries in CMAP.\n", 1 << iff.bmhd.nplanes); // Read palette if (iff.ncolors > 0) @@ -1678,7 +1685,7 @@ "ILBM: BODY chunk before BMHD?\n"); } - dmMsg(3, "ILBM: BODY chunk size %d bytes\n", chunk.size); + dmMsg(2, "ILBM: BODY chunk size %d bytes\n", chunk.size); // Decode the body if (iff.planar) @@ -1707,7 +1714,7 @@ "ILBM: Error reading CAMG chunk.\n"); } - dmMsg(3, "ILBM: CAMG value 0x%08x\n", iff.camg); + dmMsg(2, "ILBM: CAMG value 0x%08x\n", iff.camg); if ((iff.camg & IFF_CAMG_HAM)) {