-
Notifications
You must be signed in to change notification settings - Fork 2
/
xsprite.h
45 lines (35 loc) · 1023 Bytes
/
xsprite.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* This file belongs to the 'xlab' game engine.
* Copyright 2009 xfacter
* Copyright 2016 wickles
* This work is licensed under the LGPLv3
* subject to all terms as reproduced in the included LICENSE file.
*/
#pragma once
#include "xconfig.h"
#include "xtexture.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
int anim;
int frame;
int def_anim;
int num_anims;
float time;
int frame_width;
int frame_height;
int uframes;
int vframes;
x_anim* anims_use;
xTexture* texture;
} xSprite;
/* uses anims going down the image, and frames from left to right */
int xSpriteBind(xSprite* object, xTexture* texture, x_anim* my_anims, int num_anim, int fwidth, int fheight, int default_anim);
void xSpriteSetAnim(xSprite* object, int anim, int loop);
void xSpriteUpdate(xSprite* object, float dt);
void xSpriteDraw(xSprite* object, int x, int y);
//void xSpriteDraw3D(xSprite* object, ScePspFVector3* pos, float length, float height);
#ifdef __cplusplus
}
#endif