diff src/core/map.h @ 94:ed72843a7194

core: simplify font/texture interfaces Expose the structure to avoid calling functions and heap allocations. While here remove some useless functions.
author David Demelier <markand@malikania.fr>
date Mon, 30 Mar 2020 13:34:42 +0200
parents 52792b863ff7
children c7e993455985
line wrap: on
line diff
--- a/src/core/map.h	Thu Mar 26 10:28:11 2020 +0100
+++ b/src/core/map.h	Mon Mar 30 13:34:42 2020 +0200
@@ -26,15 +26,13 @@
 
 #include <stdbool.h>
 
-#include "sprite.h"
+#include "texture.h"
 
 /**
  * \brief Max title length for a map.
  */
 #define MAP_TITLE_MAX   32
 
-struct texture;
-
 /**
  * \brief Map layer.
  */
@@ -50,9 +48,8 @@
  */
 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 */
+	struct texture tileset;         /*!< (RW) Tileset to use */
+	struct texture picture;         /*!< (RO) Map drawn into a picture */
 	int origin_x;                   /*!< (RO) Where the player starts in X */
 	int origin_y;                   /*!< (RO) Where the player starts in Y */
 	unsigned int width;             /*!< (RO) Map width in cells */
@@ -102,6 +99,6 @@
  * \param map the map to render
  */
 void
-map_close(struct map *map);
+map_finish(struct map *map);
 
 #endif /* !MOLKO_MAP_H */