# HG changeset patch # User Matti Hamalainen # Date 1353338694 -7200 # Node ID 63849f85db57a4f6bb135365fbbd90d4ff4eda71 # Parent e2a76bb59888b2bd722459123902853287151d38 Add some comments. diff -r e2a76bb59888 -r 63849f85db57 lib64gfx.c --- a/lib64gfx.c Mon Nov 19 17:24:41 2012 +0200 +++ b/lib64gfx.c Mon Nov 19 17:24:54 2012 +0200 @@ -377,6 +377,10 @@ const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); +// Perform probing of the given data buffer, trying to determine +// if it contains a supported "C64" image format. Returns the +// "probe score", see libgfx.h for list of values. If a match +// is found, pointer to format description is set to *pfmt. int dmC64ProbeGeneric(const Uint8 *buf, const size_t len, const DMC64ImageFormat **pfmt) { int i, scoreMax = DM_PROBE_SCORE_FALSE, scoreIndex = -1; @@ -439,9 +443,11 @@ if (buf == NULL || img == NULL || fmt == NULL) return DMERR_NULLPTR; + // Clear the image structure memset(img, 0, sizeof(*img)); img->type = fmt->type; + // Perform decoding for (i = 0; i < fmt->nencdecOps; i++) { const DMC64EncDecOp *op = &fmt->encdecOps[i]; @@ -620,6 +626,8 @@ } +// Convert a generic "C64" format bitmap in DMC64Image struct to +// a indexed/paletted bitmap image. int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src) { switch (src->type)