comparison tools/lib64gfx.h @ 1482:df6dacb48970

Rename some struct members, and sanitize handling of DMC64Image allocation more.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 11 May 2018 03:29:55 +0300
parents 32203356c652
children bc13af8954d7
comparison
equal deleted inserted replaced
1481:e967e8e3b8c3 1482:df6dacb48970
104 int type, // Image type (D64_FMT_*) 104 int type, // Image type (D64_FMT_*)
105 laceType, // Interlace type (D64_ILACE_*) 105 laceType, // Interlace type (D64_ILACE_*)
106 nbanks; 106 nbanks;
107 107
108 int width, height; // Width and height in pixels 108 int width, height; // Width and height in pixels
109 int ch_width, ch_height; // Width and height in charblocks 109 int chWidth, chHeight; // Width and height in charblocks
110
111 size_t
112 screenSize,
113 bitmapSize,
114 charmemSize;
110 115
111 Uint8 116 Uint8
112 **color, 117 **color,
113 **bitmap, 118 **bitmap,
114 **screen, 119 **screen,
151 { 156 {
152 int type; 157 int type;
153 size_t offs; 158 size_t offs;
154 int bank; 159 int bank;
155 size_t size; 160 size_t size;
156 BOOL (*decfunction)(DMC64Image *img, const struct _DMC64EncDecOp *op, const Uint8 *buf, const size_t len); 161 BOOL (*decFunction)(DMC64Image *img, const struct _DMC64EncDecOp *op, const Uint8 *buf, const size_t len);
157 BOOL (*encfunction)(const struct _DMC64EncDecOp *op, Uint8 **buf, size_t *len, const DMC64Image *img); 162 BOOL (*encFunction)(const struct _DMC64EncDecOp *op, Uint8 **buf, size_t *len, const DMC64Image *img);
158 } DMC64EncDecOp; 163 } DMC64EncDecOp;
159 164
160 165
161 typedef struct _DMC64ImageFormat 166 typedef struct _DMC64ImageFormat
162 { 167 {
166 171
167 size_t addr; // Loading address (0 if no loading address) 172 size_t addr; // Loading address (0 if no loading address)
168 size_t size; // Size, including loading address. Only used in encoding, if even there (0 if no static size) 173 size_t size; // Size, including loading address. Only used in encoding, if even there (0 if no static size)
169 174
170 int width, height; // Width and height in pixels 175 int width, height; // Width and height in pixels
171 int ch_width, ch_height; // Width and height in charblocks 176 int chWidth, chHeight; // Width and height in charblocks
172 177
173 int (*probe)(const Uint8 *buf, const size_t len, const struct _DMC64ImageFormat *fmt); 178 int (*probe)(const Uint8 *buf, const size_t len, const struct _DMC64ImageFormat *fmt);
174 179
175 int (*decode)(DMC64Image *img, const Uint8 *buf, const size_t len, const struct _DMC64ImageFormat *fmt); 180 int (*decode)(DMC64Image *img, const Uint8 *buf, const size_t len, const struct _DMC64ImageFormat *fmt);
176 int (*encode)(DMGrowBuf *buf, const DMC64Image *img, const struct _DMC64ImageFormat *fmt); 181 int (*encode)(DMGrowBuf *buf, const DMC64Image *img, const struct _DMC64ImageFormat *fmt);