comparison tools/lib64gfx.h @ 921:2454ddb7363f

Add constant for max number of enc/dec ops in C64 image format struct and check the specified amount against that.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 25 Feb 2015 14:19:46 +0200
parents 9be156fa4b9d
children 658bf4c452d0
comparison
equal deleted inserted replaced
920:9be156fa4b9d 921:2454ddb7363f
172 BOOL (*decfunction)(DMC64Image *img, const struct _DMC64EncDecOp *op, const Uint8 *buf, const size_t len); 172 BOOL (*decfunction)(DMC64Image *img, const struct _DMC64EncDecOp *op, const Uint8 *buf, const size_t len);
173 BOOL (*encfunction)(const struct _DMC64EncDecOp *op, Uint8 **buf, size_t *len, const DMC64Image *img); 173 BOOL (*encfunction)(const struct _DMC64EncDecOp *op, Uint8 **buf, size_t *len, const DMC64Image *img);
174 } DMC64EncDecOp; 174 } DMC64EncDecOp;
175 175
176 176
177 #define D64_MAX_ENCDEC_OPS 16
178
179
177 typedef struct _DMC64ImageFormat 180 typedef struct _DMC64ImageFormat
178 { 181 {
179 int type; 182 int type;
180 char *fext; 183 char *fext;
181 char *name; 184 char *name;
186 int (*encode)(DMC64Image *img, Uint8 **buf, size_t *len, const struct _DMC64ImageFormat *fmt); 189 int (*encode)(DMC64Image *img, Uint8 **buf, size_t *len, const struct _DMC64ImageFormat *fmt);
187 int (*convertFrom)(DMImage *, const DMC64Image *, const BOOL doubleMC); 190 int (*convertFrom)(DMImage *, const DMC64Image *, const BOOL doubleMC);
188 int (*convertTo)(DMImage *, DMC64Image *); 191 int (*convertTo)(DMImage *, DMC64Image *);
189 192
190 int nencdecOps; 193 int nencdecOps;
191 DMC64EncDecOp encdecOps[16]; 194 DMC64EncDecOp encdecOps[D64_MAX_ENCDEC_OPS];
192 } DMC64ImageFormat; 195 } DMC64ImageFormat;
193 196
194 197
195 extern const size_t dmC64DefaultSizes[DT_LAST]; 198 extern const size_t dmC64DefaultSizes[DT_LAST];
196 extern DMColor dmC64Palette[C64_NCOLORS]; 199 extern DMColor dmC64Palette[C64_NCOLORS];