-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsprites.h
57 lines (41 loc) · 1.06 KB
/
sprites.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
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef SPRITES_H
#define SPRITES_H
#include <GL/gl.h>
#include "graphics.h"
#include "common.h"
typedef int SpriteClassId;
typedef enum {SSC_ANIM, SSC_STILL, SSC_BFNT} SpriteSubClass;
typedef struct
{
BitmapId image;
int w;
int h;
} SpriteFrame;
typedef struct
{
IntPoint charSize;
IntPoint spacing;
char charString[_STR_BUFLEN];
IntPoint charPosLut[256];
} Font;
typedef struct
{
char *name;
int fcount;
double fps;
int areverse;
int arepeat;
SpriteFrame *frame;
SpriteSubClass ssc;
Font *font;
} SpriteClass;
void sprites_Init();
SpriteClassId sprites_GetIdByName(const char *name);
SpriteClassId sprites_GetIdByNameF(const char *namefmt, ...);
void sprites_LoadFromCfg(const char *cfgpathrel, const char *namePrefix);
void sprites_LoadFromCfgF(const char *cfgpathrelfmt, const char *namePrefix, ...);
void sprites_LoadFontsFromCfg(char *cfgpathrel);
void sprites_FreeAll();
void sprites_GetDimensions(SpriteClassId id, int *width, int *height);
SpriteClass* sprites_GetClass(SpriteClassId id);
#endif