Mercurial > molko
diff src/map.h @ 41:3996f873a54b
core: implement walksprite, closes #2455
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 15 Jan 2020 13:11:47 +0100 |
parents | 7035c1eb44fb |
children | 22a09a5ee476 |
line wrap: on
line diff
--- a/src/map.h Tue Jan 14 13:40:26 2020 +0100 +++ b/src/map.h Wed Jan 15 13:11:47 2020 +0100 @@ -49,7 +49,10 @@ struct map { char title[MAP_TITLE_MAX]; /*!< (RW) The map title */ struct texture *tileset; /*!< (RW) Tileset to use */ + struct texture *picture; /*!< (RO) Map drawn into a picture */ struct sprite sprite; /*!< (RO) Sprite to render */ + uint64_t x; + uint64_t y; uint16_t width; /*!< (RO) Map width in cells */ uint16_t height; /*!< (RO) Map height in cells */ uint8_t tilewidth; /*!< (RO) Pixels per cell (width) */ @@ -79,6 +82,27 @@ map_draw(struct map *map); /** + * Force map repaint on its texture. + * + * \pre map != NULL + * \param map the map to repaint + * \warning This function does not render anything on the screen + */ +void +map_repaint(struct map *map); + +/** + * Move the origin of the picture rect to view. + * + * \param map the map + * \param x the x coordinate + * \param y the y coordinate + * \note This function may adjust the coordinates if needed + */ +void +map_view(struct map *map, uint64_t x, uint64_t y); + +/** * Close the map and its resources. * * \pre map != NULL