1 #ifndef RL_MAP_H
2 #define RL_MAP_H
3 
4 #include <rl_userdata.h>
5 #include <rl_image.h>
6 #include <rl_tile.h>
7 
8 #include <stdint.h>
9 #include <stddef.h>
10 
11 #define RL_MAP_HAS_COLLISION 1
12 
13 typedef struct
14 {
15   uint16_t indices[ 0 ]; /* width * height *tile* indices */
16 }
17 rl_layer0_t;
18 
19 /* layern indices are *image* indices. */
20 typedef rl_layer0_t rl_layern_t;
21 
22 typedef struct
23 {
24   rl_userdata_t ud;
25 
26   int width;
27   int height;
28   int num_layers;
29   int flags;
30 
31   const rl_tileset_t*  tileset;
32   const rl_imageset_t* imageset;
33   const uint32_t*      collision;
34   const rl_layer0_t*   layer0;
35 
36   rl_layern_t* layers[ 0 ];
37 }
38 rl_map_t;
39 
40 rl_map_t* rl_map_create( const void* data, size_t size, const rl_tileset_t* tileset, const rl_imageset_t* imageset );
41 void      rl_map_destroy( const rl_map_t* map );
42 
43 void rl_map_blit0_nobg( const rl_map_t* map, int x, int y );
44 void rl_map_blitn_nobg( const rl_map_t* map, int index, int x, int y );
45 
46 #endif /* RL_MAP_H */
47