diff lib64gfx.h @ 510:43ea59887c69

Start work on making C64 formats encoding possible by changing DMDecodeOps to DMEncDecOps and adding fields and op enums for custom encode functions, renaming, etc. Split generic op sanity checking into a separate function in preparation for its use in generic encoding function.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 19 Nov 2012 15:06:01 +0200
parents 272e64259fde
children 4cdcaeb68b54
line wrap: on
line diff
--- a/lib64gfx.h	Mon Nov 19 14:04:56 2012 +0200
+++ b/lib64gfx.h	Mon Nov 19 15:06:01 2012 +0200
@@ -105,20 +105,22 @@
     DT_BGCOLOR,
     DT_EXTRADATA,
     
-    DT_FUNCTION,
+    DT_DEC_FUNCTION,
+    DT_ENC_FUNCTION,
     
     DT_LAST,
 };
 
 
-typedef struct _DMDecodeOp
+typedef struct _DMC64EncDecOp
 {
     int    type;
     size_t offs;
     int    bank;
     size_t size;
-    BOOL   (*function)(DMC64Image *img, const struct _DMDecodeOp *op, const Uint8 *buf, const size_t len);
-} DMDecodeOp;
+    BOOL   (*decfunction)(DMC64Image *img, const struct _DMC64EncDecOp *op, const Uint8 *buf, const size_t len);
+    BOOL   (*encfunction)(const struct _DMC64EncDecOp *op, Uint8 **buf, size_t *len, const DMC64Image *img);
+} DMC64EncDecOp;
 
 
 typedef struct _DMC64ImageFormat
@@ -132,8 +134,8 @@
     int  (*convertFrom)(DMImage *, DMC64Image *);
     int  (*convertTo)(DMImage *, DMC64Image *);
 
-    int ndecodeOps;
-    DMDecodeOp decodeOps[16];
+    int ndecencOps;
+    DMC64EncDecOp decencOps[16];
 } DMC64ImageFormat;