Skip to content

Commit 6a63a54

Browse files
authored
Merge pull request #22 from pbentes/master
Moved struct definitions out of the implementation
2 parents 967a972 + 7accadc commit 6a63a54

File tree

1 file changed

+40
-43
lines changed

1 file changed

+40
-43
lines changed

include/raylib-aseprite.h

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,51 @@
3333
#define INCLUDE_RAYLIB_ASEPRITE_H_
3434

3535
#include "raylib.h" // NOLINT
36+
#include "cute_aseprite.h" // NOLINT
3637

3738
#ifdef __cplusplus
3839
extern "C" {
3940
#endif
4041

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;
4481

4582
// Aseprite functions
4683
Aseprite LoadAseprite(const char* fileName); // Load an .aseprite file
@@ -114,46 +151,6 @@ extern "C" {
114151

115152
#include "cute_aseprite.h" // NOLINT
116153

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-
157154
/**
158155
* Load an .aseprite file through its memory data.
159156
*

0 commit comments

Comments
 (0)