project_files/frontlib/model/map.h
changeset 7316 f7b49b2c5d84
parent 7314 6171f0bad318
child 7482 d70a5b0d1190
equal deleted inserted replaced
7314:6171f0bad318 7316:f7b49b2c5d84
    18  */
    18  */
    19 
    19 
    20 #ifndef MODEL_MAP_H_
    20 #ifndef MODEL_MAP_H_
    21 #define MODEL_MAP_H_
    21 #define MODEL_MAP_H_
    22 
    22 
       
    23 #include <stddef.h>
    23 #include <stdint.h>
    24 #include <stdint.h>
    24 #include <stdbool.h>
    25 #include <stdbool.h>
    25 
    26 
    26 #define MAPGEN_REGULAR 0
    27 #define MAPGEN_REGULAR 0
    27 #define MAPGEN_MAZE 1
    28 #define MAPGEN_MAZE 1
    55 	int mapgen;				// Always one of the MAPGEN_ constants
    56 	int mapgen;				// Always one of the MAPGEN_ constants
    56 	char *name;				// The name of the map for MAPGEN_NAMED, otherwise one of "+rnd+", "+maze+" or "+drawn+".
    57 	char *name;				// The name of the map for MAPGEN_NAMED, otherwise one of "+rnd+", "+maze+" or "+drawn+".
    57 	char *seed;				// Used for all maps
    58 	char *seed;				// Used for all maps
    58 	char *theme;			// Used for all maps
    59 	char *theme;			// Used for all maps
    59 	uint8_t *drawData;		// Used for MAPGEN_DRAWN
    60 	uint8_t *drawData;		// Used for MAPGEN_DRAWN
    60 	int drawDataSize;		// Used for MAPGEN_DRAWN
    61 	int drawDataSize;		// Used for MAPGEN_DRAWN TODO size_t
    61 	int templateFilter;		// Used for MAPGEN_REGULAR
    62 	int templateFilter;		// Used for MAPGEN_REGULAR
    62 	int mazeSize;			// Used for MAPGEN_MAZE
    63 	int mazeSize;			// Used for MAPGEN_MAZE
    63 } flib_map;
    64 } flib_map;
    64 
    65 
    65 /**
    66 /**
    97 
    98 
    98 /**
    99 /**
    99  * Create a hand-drawn map. Use flib_map_destroy to free the returned object.
   100  * Create a hand-drawn map. Use flib_map_destroy to free the returned object.
   100  * No NULL parameters allowed, returns NULL on failure.
   101  * No NULL parameters allowed, returns NULL on failure.
   101  */
   102  */
   102 flib_map *flib_map_create_drawn(const char *seed, const char *theme, const uint8_t *drawData, int drawDataSize);
   103 flib_map *flib_map_create_drawn(const char *seed, const char *theme, const uint8_t *drawData, size_t drawDataSize);
   103 
   104 
   104 /**
   105 /**
   105  * Create a deep copy of the map. Returns NULL on failure or if NULL was passed.
   106  * Create a deep copy of the map. Returns NULL on failure or if NULL was passed.
   106  */
   107  */
   107 flib_map *flib_map_copy(const flib_map *map);
   108 flib_map *flib_map_copy(const flib_map *map);