1 /***********************************************************
2 * Artsoft Retro-Game Library *
3 *----------------------------------------------------------*
4 * (c) 1994-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
20 #if defined(TARGET_X11)
22 #define MAX_COLORS 256 /* maximal number of colors for each image */
24 typedef unsigned short Intensity; /* RGB intensity for X11 */
28 Display *display; /* destination display */
29 int depth; /* depth of destination drawable */
30 Pixel index[MAX_COLORS]; /* array of pixel values */
31 int no; /* number of pixels in the array */
32 Colormap cmap; /* colormap used for image */
33 Pixmap pixmap; /* final pixmap */
34 Pixmap pixmap_mask; /* final pixmap of mask */
39 unsigned int used; /* number of colors used in RGB map */
40 Intensity red[MAX_COLORS]; /* color values in X style */
41 Intensity green[MAX_COLORS];
42 Intensity blue[MAX_COLORS];
43 boolean color_used[MAX_COLORS]; /* flag if color cell is used */
48 unsigned int type; /* type of image (True-Color etc.) */
49 struct RGBMap rgb; /* RGB map of image if IRGB type */
50 unsigned int width; /* width of image in pixels */
51 unsigned int height; /* height of image in pixels */
52 unsigned int depth; /* depth of image in bits if IRGB type */
53 unsigned int bytes_per_pixel;/* (depth + 7) / 8 */
54 unsigned int bytes_per_row; /* width * bytes_per_pixel */
55 byte *data; /* image data */
58 #define IMAGETYPE_BITMAP 0 /* monochrome bitmap */
59 #define IMAGETYPE_RGB 1 /* RGB image with colormap */
60 #define IMAGETYPE_TRUECOLOR 2 /* true-color image */
62 #define TRUECOLOR_RED(pixel) (((unsigned long)((pixel) & 0xff0000)) >> 16)
63 #define TRUECOLOR_GREEN(pixel) (((unsigned long)((pixel) & 0xff00)) >> 8)
64 #define TRUECOLOR_BLUE(pixel) ( (unsigned long)((pixel) & 0xff))
65 #define RGB_TO_TRUECOLOR(r,g,b) ((((unsigned long)((r) & 0xff00)) << 8) | ((g) & 0xff00) | (((unsigned short)(b)) >> 8))
67 Image *newImage(unsigned int, unsigned int, unsigned int);
68 void freeImage(Image *);
69 void freeXImage(Image *, XImageInfo *);
71 Pixmap Pixmap_to_Mask(Pixmap, int, int);
73 void ZoomPixmap(Display *, GC, Pixmap, Pixmap, int, int, int, int);
75 int Read_PCX_to_Pixmap(Display *, Window, GC, char *, Pixmap *, Pixmap *);
77 #endif /* TARGET_X11 */
79 int getImageListSize();
80 struct FileInfo *getImageListEntryFromImageID(int);
81 Bitmap *getBitmapFromImageID(int);
82 int getOriginalImageWidthFromImageID(int);
83 int getOriginalImageHeightFromImageID(int);
84 char *getTokenFromImageID(int);
85 int getImageIDFromToken(char *);
86 char *getImageConfigFilename();
87 int getImageListPropertyMappingSize();
88 struct PropertyMapping *getImageListPropertyMapping();
89 void InitImageList(struct ConfigInfo *, int, struct ConfigTypeInfo *,
90 char **, char **, char **, char **, char **);
92 void ReloadCustomImages();
93 void CreateImageWithSmallImages(int, int);
94 void ScaleImage(int, int);