1 #ifndef XMJ3TS_HH 2 #define XMJ3TS_HH 3 #include <lcdfgif/gif.h> 4 #include <lcdfgif/gifx.h> 5 #include "tileset.hh" 6 7 class Xmj3Tileset: public Tileset { 8 9 enum ImageType { 10 itFace, 11 itBase, 12 itSelected, 13 itObscured 14 }; 15 16 enum ImageError { 17 ieNone = 0, 18 ieBadGif, 19 ieNoBase, 20 ieBadSize, 21 }; 22 23 Gif_Stream *_gfs; 24 Gif_XContext *_gifx; 25 Gif_Colormap *_colormap; 26 int _image_error; 27 28 Vector<short> _face_ref; 29 Vector<short> _base_ref; 30 Vector<short> _selected_ref; 31 Vector<short> _obscured_ref; 32 33 Vector<Pixmap> _images; 34 Vector<Pixmap> _masks; 35 36 void map_one_image(const char *, int, ImageType, Vector<short> &); 37 void initialize_images(); 38 void check_images(); 39 bool check() const; 40 void initialize(); 41 42 void draw(SwDrawable *, short, short, short, short); 43 44 public: 45 46 Xmj3Tileset(Gif_Stream *, Gif_XContext *); 47 ~Xmj3Tileset(); 48 ok() const49 bool ok() const { return _gfs; } 50 51 void draw_normal(const Tile *, SwDrawable *, short x, short y); 52 void draw_lit(const Tile *, SwDrawable *, short x, short y); 53 void draw_obscured(const Tile *, SwDrawable *, short x, short y); 54 55 }; 56 57 #endif 58