Skip to content

Commit e268a17

Browse files
committed
v5.5.0
1 parent 2f25eac commit e268a17

File tree

5 files changed

+35
-25
lines changed

5 files changed

+35
-25
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.11)
22
project (raylib_aseprite
3-
VERSION 5.0.2
3+
VERSION 5.5.0
44
DESCRIPTION "raylib_aseprite: Use Aseprite files in raylib"
55
HOMEPAGE_URL "https://github.com/robloach/raylib-aseprite"
66
LANGUAGES C)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ See the [examples directory](examples) for more demonstrations of how to use *ra
7373
// Aseprite functions
7474
Aseprite LoadAseprite(const char* fileName); // Load an .aseprite file
7575
Aseprite LoadAsepriteFromMemory(unsigned char* fileData, int size); // Load an aseprite file from memory
76-
bool IsAsepriteReady(Aseprite aseprite); // Check if the given Aseprite was loaded successfully
76+
bool IsAsepriteValid(Aseprite aseprite); // Check if the given Aseprite was loaded successfully
7777
void UnloadAseprite(Aseprite aseprite); // Unloads the aseprite file
7878
void TraceAseprite(Aseprite aseprite); // Display all information associated with the aseprite
7979
Texture GetAsepriteTexture(Aseprite aseprite); // Retrieve the raylib texture associated with the aseprite
@@ -88,7 +88,7 @@ void DrawAsepritePro(Aseprite aseprite, int frame, Rectangle dest, Vector2 origi
8888
AsepriteTag LoadAsepriteTag(Aseprite aseprite, const char* name); // Load an Aseprite tag animation sequence
8989
AsepriteTag LoadAsepriteTagFromIndex(Aseprite aseprite, int index); // Load an Aseprite tag animation sequence from its index
9090
int GetAsepriteTagCount(Aseprite aseprite); // Get the total amount of available tags
91-
bool IsAsepriteTagReady(AsepriteTag tag); // Check if the given Aseprite tag was loaded successfully
91+
bool IsAsepriteTagValid(AsepriteTag tag); // Check if the given Aseprite tag was loaded successfully
9292
void UpdateAsepriteTag(AsepriteTag* tag); // Update the tag animation frame
9393
AsepriteTag GenAsepriteTagDefault(); // Generate an empty Tag with sane defaults
9494
void DrawAsepriteTag(AsepriteTag tag, int posX, int posY, Color tint);
@@ -100,7 +100,7 @@ void DrawAsepriteTagPro(AsepriteTag tag, Rectangle dest, Vector2 origin, float r
100100
AsepriteSlice LoadAsepriteSlice(Aseprite aseprite, const char* name); // Load a slice from an Aseprite based on its name.
101101
AsepriteSlice LoadAsperiteSliceFromIndex(Aseprite aseprite, int index); // Load a slice from an Aseprite based on its index.
102102
int GetAsepriteSliceCount(Aseprite aseprite); // Get the amount of slices that are defined in the Aseprite.
103-
bool IsAsepriteSliceReady(AsepriteSlice slice); // Return whether or not the given slice was found.
103+
bool IsAsepriteSliceValid(AsepriteSlice slice); // Return whether or not the given slice was found.
104104
AsepriteSlice GenAsepriteSliceDefault(); // Generate empty Aseprite slice data.
105105
```
106106

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if (NOT raylib_FOUND)
55
FetchContent_Declare(
66
raylib
77
GIT_REPOSITORY https://github.com/raysan5/raylib.git
8-
GIT_TAG 5.0
8+
GIT_TAG 5.5
99
)
1010
FetchContent_GetProperties(raylib)
1111
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?

include/raylib-aseprite.h

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ typedef struct AsepriteSlice {
8282
// Aseprite functions
8383
Aseprite LoadAseprite(const char* fileName); // Load an .aseprite file
8484
Aseprite LoadAsepriteFromMemory(unsigned char* fileData, int size); // Load an aseprite file from memory
85-
bool IsAsepriteReady(Aseprite aseprite); // Check if the given Aseprite was loaded successfully
85+
bool IsAsepriteValid(Aseprite aseprite); // Check if the given Aseprite was loaded successfully
8686
void UnloadAseprite(Aseprite aseprite); // Unloads the aseprite file
8787
void TraceAseprite(Aseprite aseprite); // Display all information associated with the aseprite
8888
Texture GetAsepriteTexture(Aseprite aseprite); // Retrieve the raylib texture associated with the aseprite
@@ -100,7 +100,7 @@ void DrawAsepriteProFlipped(Aseprite aseprite, int frame, Rectangle dest, Vector
100100
AsepriteTag LoadAsepriteTag(Aseprite aseprite, const char* name); // Load an Aseprite tag animation sequence
101101
AsepriteTag LoadAsepriteTagFromIndex(Aseprite aseprite, int index); // Load an Aseprite tag animation sequence from its index
102102
int GetAsepriteTagCount(Aseprite aseprite); // Get the total amount of available tags
103-
bool IsAsepriteTagReady(AsepriteTag tag); // Check if the given Aseprite tag was loaded successfully
103+
bool IsAsepriteTagValid(AsepriteTag tag); // Check if the given Aseprite tag was loaded successfully
104104
void UpdateAsepriteTag(AsepriteTag* tag); // Update the tag animation frame
105105
AsepriteTag GenAsepriteTagDefault(); // Generate an empty Tag with sane defaults
106106
void DrawAsepriteTag(AsepriteTag tag, int posX, int posY, Color tint);
@@ -118,7 +118,7 @@ int GetAsepriteTagFrame(AsepriteTag tag);
118118
AsepriteSlice LoadAsepriteSlice(Aseprite aseprite, const char* name); // Load a slice from an Aseprite based on its name.
119119
AsepriteSlice LoadAsperiteSliceFromIndex(Aseprite aseprite, int index); // Load a slice from an Aseprite based on its index.
120120
int GetAsepriteSliceCount(Aseprite aseprite); // Get the amount of slices that are defined in the Aseprite.
121-
bool IsAsepriteSliceReady(AsepriteSlice slice); // Return whether or not the given slice was found.
121+
bool IsAsepriteSliceValid(AsepriteSlice slice); // Return whether or not the given slice was found.
122122
AsepriteSlice GenAsepriteSliceDefault(); // Generate empty Aseprite slice data.
123123

124124
#ifdef __cplusplus
@@ -241,7 +241,7 @@ Aseprite LoadAsepriteFromMemory(unsigned char* fileData, int size) {
241241
* @return The loaded Aseprite object, or an empty one on failure.
242242
*
243243
* @see UnloadAseprite()
244-
* @see IsAsepriteReady()
244+
* @see IsAsepriteValid()
245245
*/
246246
Aseprite LoadAseprite(const char* fileName) {
247247
int bytesRead;
@@ -265,7 +265,7 @@ Aseprite LoadAseprite(const char* fileName) {
265265
*
266266
* @return True if the Aseprite was loaded successfully, false otherwise.
267267
*/
268-
bool IsAsepriteReady(Aseprite aseprite) {
268+
bool IsAsepriteValid(Aseprite aseprite) {
269269
return aseprite.ase != 0;
270270
}
271271

@@ -387,7 +387,10 @@ void DrawAsepriteVFlipped(Aseprite aseprite, int frame, Vector2 position, bool h
387387
return;
388388
}
389389

390-
Rectangle source = {(float)(frame * ase->w), 0, horizontalFlip ? (float)-ase->w : ase->w, verticalFlip ? (float)-ase->h : (float)ase->h};
390+
Rectangle source = {(float)(frame * ase->w), 0,
391+
horizontalFlip ? (float)-ase->w : (float)ase->w,
392+
verticalFlip ? (float)-ase->h : (float)ase->h
393+
};
391394
Texture2D texture = GetAsepriteTexture(aseprite);
392395
DrawTextureRec(texture, source, position, tint);
393396
}
@@ -402,7 +405,10 @@ void DrawAsepriteExFlipped(Aseprite aseprite, int frame, Vector2 position, float
402405
return;
403406
}
404407

405-
Rectangle source = {(float)(frame * ase->w), 0, horizontalFlip ? (float)-ase->w : ase->w, verticalFlip ? (float)-ase->h : (float)ase->h};
408+
Rectangle source = {(float)(frame * ase->w), 0,
409+
horizontalFlip ? (float)-ase->w : (float)ase->w,
410+
verticalFlip ? (float)-ase->h : (float)ase->h
411+
};
406412
Texture2D texture = GetAsepriteTexture(aseprite);
407413
Rectangle dest = {(float)position.x, (float)position.y, (float)ase->w * scale, (float)ase->h * scale};
408414
Vector2 origin = {0, 0};
@@ -419,7 +425,11 @@ void DrawAsepriteProFlipped(Aseprite aseprite, int frame, Rectangle dest, Vector
419425
return;
420426
}
421427

422-
Rectangle source = {(float)(frame * ase->w), 0, horizontalFlip ? (float)-ase->w : ase->w, verticalFlip ? (float)-ase->h : (float)ase->h};
428+
Rectangle source = {
429+
(float)(frame * ase->w), 0,
430+
horizontalFlip ? (float)-ase->w : (float)ase->w,
431+
verticalFlip ? (float)-ase->h : (float)ase->h
432+
};
423433
Texture2D texture = GetAsepriteTexture(aseprite);
424434
DrawTexturePro(texture, source, dest, origin, rotation, tint);
425435
}
@@ -624,7 +634,7 @@ AsepriteTag GenAsepriteTagDefault() {
624634
* @return The Aseprite tag information, or an empty tag on failure.
625635
*
626636
* @see LoadAsepriteTag()
627-
* @see IsAsepriteTagReady()
637+
* @see IsAsepriteTagValid()
628638
*/
629639
AsepriteTag LoadAsepriteTagFromIndex(Aseprite aseprite, int index) {
630640
AsepriteTag tag = GenAsepriteTagDefault();
@@ -684,7 +694,7 @@ AsepriteTag LoadAsepriteTagFromIndex(Aseprite aseprite, int index) {
684694
*
685695
* @return The loaded Aseprite tag, or an empty tag on failure.
686696
*
687-
* @see IsAsepriteTagReady()
697+
* @see IsAsepriteTagValid()
688698
* @see UpdateAsepriteTag()
689699
*/
690700
AsepriteTag LoadAsepriteTag(Aseprite aseprite, const char* name) {
@@ -715,7 +725,7 @@ AsepriteTag LoadAsepriteTag(Aseprite aseprite, const char* name) {
715725
*
716726
* @return True if the tag was loaded, false otherwise.
717727
*/
718-
bool IsAsepriteTagReady(AsepriteTag tag) {
728+
bool IsAsepriteTagValid(AsepriteTag tag) {
719729
return tag.tag != 0;
720730
}
721731

@@ -789,7 +799,7 @@ int GetAsepriteSliceCount(Aseprite aseprite) {
789799
/**
790800
* Return whether or not the given slice was found.
791801
*/
792-
bool IsAsepriteSliceReady(AsepriteSlice slice) {
802+
bool IsAsepriteSliceValid(AsepriteSlice slice) {
793803
return TextLength(slice.name) != 0;
794804
}
795805

test/raylib-aseprite-test.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ int main(int argc, char *argv[]) {
2626
assert(aseprite.ase->frame_count > 20);
2727
assert(aseprite.ase->frame_count < 40);
2828

29-
// IsAsepriteReady()
30-
assert(IsAsepriteReady(aseprite));
29+
// IsAsepriteValid()
30+
assert(IsAsepriteValid(aseprite));
3131

3232
// GetAsepriteWidth()
3333
assert(GetAsepriteWidth(aseprite) == 64);
@@ -54,8 +54,8 @@ int main(int argc, char *argv[]) {
5454
assert(tag.color.a == expected.a);
5555
assert(TextIsEqual(tag.name, "Backwards"));
5656

57-
// IsAsepriteTagReady()
58-
assert(IsAsepriteTagReady(tag));
57+
// IsAsepriteTagValid()
58+
assert(IsAsepriteTagValid(tag));
5959

6060
// LoadAsepriteTagFromIndex()
6161
{
@@ -128,17 +128,17 @@ int main(int argc, char *argv[]) {
128128
assert(TextIsEqual(slice.name, "Number"));
129129
}
130130

131-
// IsAsepriteSliceReady()
131+
// IsAsepriteSliceValid()
132132
{
133133
AsepriteSlice slice = LoadAsperiteSliceFromIndex(aseprite, 0);
134-
assert(IsAsepriteSliceReady(slice));
134+
assert(IsAsepriteSliceValid(slice));
135135

136136
AsepriteSlice noSlice;
137137
noSlice.name = "";
138-
assert(!IsAsepriteSliceReady(noSlice));
138+
assert(!IsAsepriteSliceValid(noSlice));
139139

140140
noSlice = LoadAsperiteSliceFromIndex(aseprite, 100);
141-
assert(!IsAsepriteSliceReady(noSlice));
141+
assert(!IsAsepriteSliceValid(noSlice));
142142
}
143143

144144
// GenAsepriteSliceDefault()

0 commit comments

Comments
 (0)