NHDT->ANH, in most cases
[aNetHack.git] / include / tileset.h
blob39e87f4c0ff54cab5b7b0420d4117b722396f4de
1 /* NetHack 3.6 tileset.h $ANH-Date: 1457207052 2016/03/05 19:44:12 $ $ANH-Branch: master $:$ANH-Revision: 1.0 $ */
2 /* Copyright (c) Ray Chason, 2016. */
3 /* NetHack may be freely redistributed. See license for details. */
5 #ifndef TILESET_H
6 #define TILESET_H
8 struct Pixel {
9 unsigned char r, g, b, a;
12 struct TileImage {
13 /* Image data */
14 unsigned width, height;
15 struct Pixel *pixels; /* for direct color */
16 unsigned char *indexes; /* for paletted images */
19 boolean FDECL(read_tiles, (const char *filename, BOOLEAN_P true_color));
20 const struct Pixel *NDECL(get_palette);
21 void NDECL(free_tiles);
22 const struct TileImage *FDECL(get_tile, (unsigned tile_index));
24 /* Used internally by the tile set code */
25 struct TileSetImage {
26 /* Image data */
27 unsigned width, height;
28 struct Pixel *pixels; /* for direct color */
29 unsigned char *indexes; /* for paletted images */
30 struct Pixel palette[256];
32 /* Image description from the file */
33 char *image_desc;
35 /* Tile dimensions */
36 unsigned tile_width, tile_height;
39 boolean FDECL(read_bmp_tiles, (const char *filename, struct TileSetImage *image));
40 boolean FDECL(read_gif_tiles, (const char *filename, struct TileSetImage *image));
41 boolean FDECL(read_png_tiles, (const char *filename, struct TileSetImage *image));
43 #endif