sprite frames added
This commit is contained in:
parent
12a28fea88
commit
f337113932
2 changed files with 8 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ extern "C" {
|
||||||
#include "arc/graphics/renderer.h"
|
#include "arc/graphics/renderer.h"
|
||||||
#include "arc/graphics/spritesheet.h"
|
#include "arc/graphics/spritesheet.h"
|
||||||
#include "arc/math/rectangle.h"
|
#include "arc/math/rectangle.h"
|
||||||
|
#include "arc/std/array.h"
|
||||||
|
|
||||||
typedef struct ARC_Sprite ARC_Sprite;
|
typedef struct ARC_Sprite ARC_Sprite;
|
||||||
|
|
||||||
|
|
@ -19,6 +20,8 @@ void ARC_Sprite_Render(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_Rect *ren
|
||||||
|
|
||||||
void ARC_Sprite_IterateFrame(ARC_Sprite *sprite);
|
void ARC_Sprite_IterateFrame(ARC_Sprite *sprite);
|
||||||
|
|
||||||
|
void ARC_Sprite_SetFrames(ARC_Sprite *sprite, ARC_Array *frames);
|
||||||
|
|
||||||
ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite);
|
ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,11 @@ void ARC_Sprite_IterateFrame(ARC_Sprite *sprite){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ARC_Sprite_SetFrames(ARC_Sprite *sprite, ARC_Array *frames){
|
||||||
|
sprite->frames = frames->data;
|
||||||
|
*sprite->frameIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite){
|
ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite){
|
||||||
return sprite->frames + *sprite->frameIndex;
|
return sprite->frames + *sprite->frameIndex;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue