1 // ============================================================================
2 // Artsoft Retro-Game Library
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
18 // bitmap array positions for various element sizes, if available
20 // for any loaded image, the "standard" size (which represents the 32x32 pixel
21 // size for game elements) is always defined; other bitmap sizes may be NULL
23 // formats from 32x32 down to 1x1 are standard bitmap sizes for game elements
24 // (used in the game, in the level editor, in the level preview etc.)
26 // "CUSTOM" sizes for game elements (like 64x64) may be additionally created;
27 // all "OTHER" image sizes are stored if different from all other bitmap sizes,
28 // which may be used "as is" by global animations (as the "standard" size used
29 // normally may be wrong due to being scaled up or down to a different size if
30 // the same image contains game elements in a non-standard size)
32 #define IMG_BITMAP_32x32 0
33 #define IMG_BITMAP_16x16 1
34 #define IMG_BITMAP_8x8 2
35 #define IMG_BITMAP_4x4 3
36 #define IMG_BITMAP_2x2 4
37 #define IMG_BITMAP_1x1 5
38 #define IMG_BITMAP_CUSTOM 6
39 #define IMG_BITMAP_OTHER 7
41 #define NUM_IMG_BITMAPS 8
43 // these bitmap pointers point to one of the above bitmaps (do not free them)
44 #define IMG_BITMAP_PTR_GAME 8
45 #define IMG_BITMAP_PTR_ORIGINAL 9
47 #define NUM_IMG_BITMAP_POINTERS 10
49 // this bitmap pointer points to the bitmap with default image size
50 #define IMG_BITMAP_STANDARD IMG_BITMAP_32x32
52 // maximum number of statically and dynamically defined image files
53 #define MAX_IMAGE_FILES 1000000
56 #define GET_BITMAP_ID_FROM_TILESIZE(x) ((x) == 1 ? IMG_BITMAP_1x1 : \
57 (x) == 2 ? IMG_BITMAP_2x2 : \
58 (x) == 4 ? IMG_BITMAP_4x4 : \
59 (x) == 8 ? IMG_BITMAP_8x8 : \
60 (x) == 16 ? IMG_BITMAP_16x16 : \
61 (x) == 32 ? IMG_BITMAP_32x32 : \
64 #define GET_TILESIZE_FROM_BITMAP_ID(x) ((x) == IMG_BITMAP_1x1 ? 1 : \
65 (x) == IMG_BITMAP_2x2 ? 2 : \
66 (x) == IMG_BITMAP_4x4 ? 4 : \
67 (x) == IMG_BITMAP_8x8 ? 8 : \
68 (x) == IMG_BITMAP_16x16 ? 16 : \
69 (x) == IMG_BITMAP_32x32 ? 32 : \
73 int getImageListSize(void);
74 struct FileInfo *getImageListEntryFromImageID(int);
75 Bitmap **getBitmapsFromImageID(int);
76 int getOriginalImageWidthFromImageID(int);
77 int getOriginalImageHeightFromImageID(int);
78 char *getTokenFromImageID(int);
79 char *getFilenameFromImageID(int);
80 int getImageIDFromToken(char *);
81 char *getImageConfigFilename(void);
82 int getImageListPropertyMappingSize(void);
83 struct PropertyMapping *getImageListPropertyMapping(void);
84 void InitImageList(struct ConfigInfo *, int, struct ConfigTypeInfo *,
85 char **, char **, char **, char **, char **);
87 void ReloadCustomImages(void);
88 void CreateImageWithSmallImages(int, int, int);
89 void CreateImageTextures(int);
90 void FreeAllImageTextures(void);
91 void ScaleImage(int, int);
93 void FreeAllImages(void);