1 /* 2 * OpenBOR - http://www.LavaLit.com 3 * ----------------------------------------------------------------------- 4 * All rights reserved, see LICENSE in OpenBOR root for details. 5 * 6 * Copyright (c) 2004 - 2011 OpenBOR Team 7 */ 8 9 #ifndef ANIGIF_H 10 #define ANIGIF_H 11 12 13 #pragma pack (1) 14 15 // Animated GIF player. 16 17 // ============================== This is it! =============================== 18 // Should be something like this... 19 20 21 #define ANIGIF_DECODE_END 0 22 #define ANIGIF_DECODE_FRAME 1 23 #define ANIGIF_DECODE_RETRY 3 24 #define ANIGIF_DECODE_PAL 4 25 26 #define NO_CODE -1 27 28 29 30 typedef struct{ 31 char magic[6]; 32 unsigned short screenwidth, screenheight; 33 unsigned char flags; 34 unsigned char background; 35 unsigned char aspect; 36 }gifheaderstruct; 37 38 39 typedef struct { 40 short left, top; 41 unsigned short width, height; 42 unsigned char flags; 43 }gifblockstruct; 44 45 46 #if PSP || PS2 || DC 47 #define sizeof_gifheaderstruct 13 48 #define sizeof_iblock 9 49 #endif 50 51 typedef struct 52 { 53 gifheaderstruct gif_header; 54 int handle; // = -1; 55 int transparent; // = -1; 56 int bitdepth; 57 int numcolours; 58 int noblackenbg; // don't blacken the first color 59 int lastdelay; 60 unsigned char* global_pal; 61 unsigned char* local_pal; 62 } anigif_info; 63 64 65 66 // Returns true on succes 67 int anigif_open(char *filename, char *packfilename, unsigned char *pal, anigif_info* info); 68 69 // Returns type of action (frame, retry or end) 70 int anigif_decode(s_screen * screen, int *delay, int x, int y, unsigned char* pal, anigif_info* info); 71 72 void anigif_close(anigif_info* info); 73 74 #endif 75