Mercurial > molko
comparison librpg/rpg/map.h @ 212:ddfe0a211169
rpg: experiment with map teleport
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 16 Nov 2020 14:26:13 +0100 |
parents | adcbb7ccfdee |
children | 64f24b482722 |
comparison
equal
deleted
inserted
replaced
211:adcbb7ccfdee | 212:ddfe0a211169 |
---|---|
24 * \brief Game map. | 24 * \brief Game map. |
25 */ | 25 */ |
26 | 26 |
27 #include <stddef.h> | 27 #include <stddef.h> |
28 | 28 |
29 #include <core/action.h> | |
29 #include <core/texture.h> | 30 #include <core/texture.h> |
30 | 31 |
31 #include "walksprite.h" | 32 #include "walksprite.h" |
32 | 33 |
33 struct sprite; | 34 struct sprite; |
93 struct map_tiledef *tiledefs; /*!< (+&?) Per tile properties (must be sorted by id). */ | 94 struct map_tiledef *tiledefs; /*!< (+&?) Per tile properties (must be sorted by id). */ |
94 size_t tiledefsz; /*!< (+) Number of tile properties. */ | 95 size_t tiledefsz; /*!< (+) Number of tile properties. */ |
95 | 96 |
96 /* View options. */ | 97 /* View options. */ |
97 enum map_flags flags; /*!< (+) View options. */ | 98 enum map_flags flags; /*!< (+) View options. */ |
99 | |
100 struct action_stack actions; /*!< (+) */ | |
98 | 101 |
99 /* Player. */ | 102 /* Player. */ |
100 struct sprite *player_sprite; /*!< (+) The sprite to use */ | 103 struct sprite *player_sprite; /*!< (+) The sprite to use */ |
101 struct walksprite player_ws; /*!< (-) Walking sprite for moving the player. */ | 104 struct walksprite player_ws; /*!< (-) Walking sprite for moving the player. */ |
102 int player_x; /*!< (+) Player position in x */ | 105 int player_x; /*!< (+) Player position in x */ |
173 */ | 176 */ |
174 void | 177 void |
175 map_repaint(struct map *map); | 178 map_repaint(struct map *map); |
176 | 179 |
177 /** | 180 /** |
178 * Convert the map into a game state. | |
179 * | |
180 * Both objects must exist until the state is no longer used. | |
181 * | |
182 * \pre map != NULL | |
183 * \pre state != NULL | |
184 * \param map the map to use | |
185 * \param state the state to fill | |
186 * \post state->data is set to map | |
187 * \post state->handle is set | |
188 * \post state->update is set | |
189 * \post state->draw is set | |
190 */ | |
191 void | |
192 map_state(struct map *map, struct state *state); | |
193 | |
194 /** | |
195 * Dispose map resources. | 181 * Dispose map resources. |
196 * | 182 * |
197 * \pre map != NULL | 183 * \pre map != NULL |
198 * \param map the map to close | 184 * \param map the map to close |
199 */ | 185 */ |