changeset 518:63849f85db57

Add some comments.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Nov 2012 17:24:54 +0200
parents e2a76bb59888
children feaaf0e2ecbe
files lib64gfx.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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)