From 112f368dc6ea782712ede051c3051d2c0779efcf Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 27 Mar 2021 17:24:40 -0400 Subject: map: Add tile size query functions --- diff --git a/src/map.c b/src/map.c index 6bf2bd9..ea80751 100644 --- a/src/map.c +++ b/src/map.c @@ -955,6 +955,18 @@ db_map_render(struct db_map *map, SDL_Renderer *renderer) } int +db_map_get_tilewidth(struct db_map *map) +{ + return map->tw; +} + +int +db_map_get_tileheight(struct db_map *map) +{ + return map->th; +} + +int db_map_get_framerate(struct db_map *map) { return map->fr; diff --git a/src/map.h b/src/map.h index a2cd112..b86c3bb 100644 --- a/src/map.h +++ b/src/map.h @@ -27,6 +27,8 @@ struct db_map; struct db_map *db_map_new(const char *game_id, const char *level_id); SDL_Texture *db_map_render(struct db_map *map, SDL_Renderer *renderer); +int db_map_get_tilewidth(struct db_map *map) __attribute__((__pure__)); +int db_map_get_tileheight(struct db_map *map) __attribute__((__pure__)); int db_map_get_framerate(struct db_map *map) __attribute__((__pure__)); struct db_tileset *db_map_get_tilesets(struct db_map *map) __attribute__((__pure__)); -- cgit v0.9.1