|
33 | 33 | #define INCLUDE_RAYLIB_ASEPRITE_H_
|
34 | 34 |
|
35 | 35 | #include "raylib.h" // NOLINT
|
| 36 | +#include "cute_aseprite.h" // NOLINT |
36 | 37 |
|
37 | 38 | #ifdef __cplusplus
|
38 | 39 | extern "C" {
|
39 | 40 | #endif
|
40 | 41 |
|
41 |
| -typedef struct Aseprite Aseprite; // A loaded Aseprite file |
42 |
| -typedef struct AsepriteTag AsepriteTag; // A tag sprite animation within an Aseprite file |
43 |
| -typedef struct AsepriteSlice AsepriteSlice; // A slice is a defined region within the Asperite. |
| 42 | +/** |
| 43 | + * Aseprite object containing a pointer to the ase_t* from cute_aseprite.h. |
| 44 | + * |
| 45 | + * @see LoadAseprite() |
| 46 | + * @see UnloadAseprite() |
| 47 | + */ |
| 48 | +typedef struct Aseprite { |
| 49 | + ase_t* ase; // Pointer to the cute_aseprite data. |
| 50 | +} Aseprite; |
| 51 | + |
| 52 | +/** |
| 53 | + * Tag information from an Aseprite object. |
| 54 | + * |
| 55 | + * @see LoadAsepriteTag() |
| 56 | + * @see LoadAsepriteTagFromIndex() |
| 57 | + */ |
| 58 | +typedef struct AsepriteTag { |
| 59 | + char* name; // The name of the tag. |
| 60 | + int currentFrame; // The frame that the tag is currently on |
| 61 | + float timer; // The countdown timer in seconds |
| 62 | + int direction; // Whether we are moving forwards, or backwards through the frames |
| 63 | + float speed; // The animation speed factor (1 is normal speed, 2 is double speed) |
| 64 | + Color color; // The color provided for the tag |
| 65 | + bool loop; // Whether to continue to play the animation when the animation finishes |
| 66 | + bool paused; // Set to true to not progression of the animation |
| 67 | + Aseprite aseprite; // The loaded Aseprite file |
| 68 | + ase_tag_t* tag; // The active tag to act upon |
| 69 | +} AsepriteTag; |
| 70 | + |
| 71 | +/** |
| 72 | + * Slice data for the Aseprite. |
| 73 | + * |
| 74 | + * @see LoadAsepriteSlice() |
| 75 | + * @see https://www.aseprite.org/docs/slices/ |
| 76 | + */ |
| 77 | +typedef struct AsepriteSlice { |
| 78 | + char* name; // The name of the slice. |
| 79 | + Rectangle bounds; // The rectangle outer bounds for the slice. |
| 80 | +} AsepriteSlice; |
44 | 81 |
|
45 | 82 | // Aseprite functions
|
46 | 83 | Aseprite LoadAseprite(const char* fileName); // Load an .aseprite file
|
@@ -114,46 +151,6 @@ extern "C" {
|
114 | 151 |
|
115 | 152 | #include "cute_aseprite.h" // NOLINT
|
116 | 153 |
|
117 |
| -/** |
118 |
| - * Aseprite object containing a pointer to the ase_t* from cute_aseprite.h. |
119 |
| - * |
120 |
| - * @see LoadAseprite() |
121 |
| - * @see UnloadAseprite() |
122 |
| - */ |
123 |
| -struct Aseprite { |
124 |
| - ase_t* ase; // Pointer to the cute_aseprite data. |
125 |
| -}; |
126 |
| - |
127 |
| -/** |
128 |
| - * Tag information from an Aseprite object. |
129 |
| - * |
130 |
| - * @see LoadAsepriteTag() |
131 |
| - * @see LoadAsepriteTagFromIndex() |
132 |
| - */ |
133 |
| -struct AsepriteTag { |
134 |
| - char* name; // The name of the tag. |
135 |
| - int currentFrame; // The frame that the tag is currently on |
136 |
| - float timer; // The countdown timer in seconds |
137 |
| - int direction; // Whether we are moving forwards, or backwards through the frames |
138 |
| - float speed; // The animation speed factor (1 is normal speed, 2 is double speed) |
139 |
| - Color color; // The color provided for the tag |
140 |
| - bool loop; // Whether to continue to play the animation when the animation finishes |
141 |
| - bool paused; // Set to true to not progression of the animation |
142 |
| - Aseprite aseprite; // The loaded Aseprite file |
143 |
| - ase_tag_t* tag; // The active tag to act upon |
144 |
| -}; |
145 |
| - |
146 |
| -/** |
147 |
| - * Slice data for the Aseprite. |
148 |
| - * |
149 |
| - * @see LoadAsepriteSlice() |
150 |
| - * @see https://www.aseprite.org/docs/slices/ |
151 |
| - */ |
152 |
| -struct AsepriteSlice { |
153 |
| - char* name; // The name of the slice. |
154 |
| - Rectangle bounds; // The rectangle outer bounds for the slice. |
155 |
| -}; |
156 |
| - |
157 | 154 | /**
|
158 | 155 | * Load an .aseprite file through its memory data.
|
159 | 156 | *
|
|
0 commit comments