Mercurial > hg > dmlib
comparison tools/lib64gfx.h @ 931:2270d7f3af77
Refactor the DMC64Image handling to be more dynamic, and start
work on allowing non 320/160 x 200 formats, and charmode based formats.
There is still work to be done, and some problems to sort out.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 25 Feb 2015 19:37:59 +0200 |
parents | 3132868d1548 |
children | 5104a7c87d7b |
comparison
equal
deleted
inserted
replaced
930:efbad8817b79 | 931:2270d7f3af77 |
---|---|
131 fliType, // FLI type (if FLI used) | 131 fliType, // FLI type (if FLI used) |
132 laceType, // Interlace type (D64_ILACE_*) | 132 laceType, // Interlace type (D64_ILACE_*) |
133 laceBank1, // Interlace video bank indices | 133 laceBank1, // Interlace video bank indices |
134 laceBank2; | 134 laceBank2; |
135 | 135 |
136 int width, height; // Width and height in pixels | |
137 int ch_width, ch_height; // Width and height in charblocks | |
138 | |
136 Uint8 | 139 Uint8 |
137 color[C64_SCR_MAX_BANK][C64_SCR_COLOR_SIZE], | 140 *color[C64_SCR_MAX_BANK], |
138 bitmap[C64_SCR_MAX_BANK][C64_SCR_BITMAP_SIZE], | 141 *bitmap[C64_SCR_MAX_BANK], |
139 screen[C64_SCR_MAX_BANK][C64_SCR_SCREEN_SIZE], | 142 *screen[C64_SCR_MAX_BANK], |
143 *charmem[C64_SCR_MAX_BANK], | |
140 extradata[C64_SCR_EXTRADATA], | 144 extradata[C64_SCR_EXTRADATA], |
141 d020, bgcolor, d022, d023, d024; | 145 d020, bgcolor, d022, d023, d024; |
142 | 146 |
143 Uint8 charmem[C64_MAX_CHARS][C64_CHR_HEIGHT * C64_CHR_WIDTH]; | |
144 DMC64Sprite sprites[C64_MAX_SPRITES]; | 147 DMC64Sprite sprites[C64_MAX_SPRITES]; |
145 } DMC64Image; | 148 } DMC64Image; |
146 | 149 |
147 | 150 |
148 enum | 151 enum |
204 extern DMColor dmC64Palette[C64_NCOLORS]; | 207 extern DMColor dmC64Palette[C64_NCOLORS]; |
205 extern const DMC64ImageFormat dmC64ImageFormats[]; | 208 extern const DMC64ImageFormat dmC64ImageFormats[]; |
206 extern const int ndmC64ImageFormats; | 209 extern const int ndmC64ImageFormats; |
207 | 210 |
208 | 211 |
212 DMC64Image *dmC64ImageAlloc(int width, int height, int ch_width, int ch_height); | |
213 void dmC64ImageFree(DMC64Image *img); | |
214 | |
215 | |
209 char * dmC64GetImageTypeString(char *buf, const size_t len, const int type); | 216 char * dmC64GetImageTypeString(char *buf, const size_t len, const int type); |
210 int dmC64ConvertCSDataToImage(DMImage *img, int xoffs, int yoffs, const Uint8 *inBuf, int width, int height, BOOL multicolor, int *colors); | 217 int dmC64ConvertCSDataToImage(DMImage *img, int xoffs, int yoffs, const Uint8 *inBuf, int width, int height, BOOL multicolor, int *colors); |
211 | 218 |
212 int dmC64DecodeGenericBMP(DMC64Image *img, const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt); | 219 int dmC64DecodeGenericBMP(DMC64Image *img, const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt); |
213 int dmC64EncodeGenericBMP(Uint8 **pbuf, size_t *plen, const DMC64Image *img, const DMC64ImageFormat *fmt); | 220 int dmC64EncodeGenericBMP(Uint8 **pbuf, size_t *plen, const DMC64Image *img, const DMC64ImageFormat *fmt); |
214 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const BOOL doubleMC); | 221 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const BOOL doubleMC); |
215 | 222 |
216 int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt, const BOOL doubleMC); | 223 int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageFormat *fmt, const BOOL doubleMC); |
217 int dmC64ProbeBMP(const Uint8 *buf, const size_t len, const DMC64ImageFormat **fmt); | 224 int dmC64ProbeBMP(const Uint8 *buf, const size_t len, const DMC64ImageFormat **fmt); |
218 int dmC64DecodeBMP(DMC64Image *img, const Uint8 *buf, const size_t len, const size_t probeOffs, const size_t loadOffs, const DMC64ImageFormat **fmt, const DMC64ImageFormat *forced); | 225 int dmC64DecodeBMP(DMC64Image **img, const Uint8 *buf, const size_t len, const size_t probeOffs, const size_t loadOffs, const DMC64ImageFormat **fmt, const DMC64ImageFormat *forced); |
219 | 226 |
220 | 227 |
221 #ifdef __cplusplus | 228 #ifdef __cplusplus |
222 } | 229 } |
223 #endif | 230 #endif |