Mercurial > molko
comparison libmlk-rpg/mlk/rpg/tileset-loader-file.h @ 629:fee7bd30725c
rpg: cleanup tileset-loader-file
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 26 Aug 2023 16:09:35 +0200 |
parents | e070fdcc592b |
children | bb67f935a93f |
comparison
equal
deleted
inserted
replaced
628:c2b62ff38224 | 629:fee7bd30725c |
---|---|
29 * It also allocate memory for individual element and as such must be kept | 29 * It also allocate memory for individual element and as such must be kept |
30 * valid until the tileset is no longer used. If this behavior is not wanted, | 30 * valid until the tileset is no longer used. If this behavior is not wanted, |
31 * the allocator functions can be changed. | 31 * the allocator functions can be changed. |
32 */ | 32 */ |
33 | 33 |
34 struct mlk_tileset_loader; | 34 #include "tileset-loader.h" |
35 | |
36 struct mlk_tileset_collision; | |
37 struct mlk_tileset_animation; | |
38 struct mlk__loader_file; | |
39 | |
40 struct mlk_tileset_loader_file { | |
41 /** | |
42 * (read-write) | |
43 * | |
44 * Underlying tileset loader. | |
45 */ | |
46 struct mlk_tileset_loader iface; | |
47 | |
48 /** \cond MLK_PRIVATE_DECLS */ | |
49 struct mlk_tileset_collision *tilecollisions; | |
50 struct mlk_tileset_animation *tileanimations; | |
51 struct mlk__loader_file *lf; | |
52 /** \endcond MLK_PRIVATE_DECLS */ | |
53 }; | |
35 | 54 |
36 #if defined(__cplusplus) | 55 #if defined(__cplusplus) |
37 extern "C" { | 56 extern "C" { |
38 #endif | 57 #endif |
39 | 58 |
42 * and find appropriate resources relative to the tileset filename. | 61 * and find appropriate resources relative to the tileset filename. |
43 * | 62 * |
44 * After loading the tileset with this underlying loader, it should be kept | 63 * After loading the tileset with this underlying loader, it should be kept |
45 * until the tileset is no longer used. | 64 * until the tileset is no longer used. |
46 * | 65 * |
47 * \pre loader != NULL | 66 * \pre file != NULL |
48 * \pre filename != NULL | 67 * \pre filename != NULL |
49 * \param loader the abstract loader interface | 68 * \param file the abstract loader interface |
50 * \param filename path to the tileset file | 69 * \param filename path to the tileset file |
51 * \return 0 on success or -1 on error | 70 * \return 0 on success or -1 on error |
52 */ | 71 */ |
53 int | 72 int |
54 mlk_tileset_loader_file_init(struct mlk_tileset_loader *loader, | 73 mlk_tileset_loader_file_init(struct mlk_tileset_loader_file *file, const char *filename); |
55 const char *filename); | |
56 | 74 |
57 /** | 75 /** |
58 * Cleanup allocated resources by this file loader. | 76 * Cleanup allocated resources by this file loader. |
59 * | 77 * |
60 * \pre loader != NULL | 78 * \pre file != NULL |
61 * \param loader the file loader | 79 * \param file the file loader |
62 */ | 80 */ |
63 void | 81 void |
64 mlk_tileset_loader_file_finish(struct mlk_tileset_loader *loader); | 82 mlk_tileset_loader_file_finish(struct mlk_tileset_loader_file *file); |
65 | 83 |
66 #if defined(__cplusplus) | 84 #if defined(__cplusplus) |
67 } | 85 } |
68 #endif | 86 #endif |
69 | 87 |