-
Notifications
You must be signed in to change notification settings - Fork 0
/
tim.h
49 lines (42 loc) · 948 Bytes
/
tim.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
enum TIM_BPP {
bpp4 = 0,
bpp8 = 1,
bpp16 = 2,
bpp24 = 3
};
typedef struct {
unsigned char id;
unsigned char ver;
unsigned char pad1[2];
unsigned char bpp : 2;
unsigned char pad_a : 1;
unsigned char clp : 1;
unsigned char pad_b : 4;
unsigned char pad2[3];
} TIM_FILE_HEADER;
typedef struct {
int clut_length;
unsigned short x;
unsigned short y;
unsigned short width;
unsigned short height;
} TIM_CLUT_HEADER;
typedef struct {
unsigned char r : 5;
unsigned char g : 5;
unsigned char b : 5;
unsigned char stp : 1;
} TIM_CLUT_COLOR;
typedef struct {
int img_length;
unsigned short x;
unsigned short y;
unsigned short width;
unsigned short height;
} TIM_IMG_HEADER;
int open_tim(const char *name, const char *obj_name);
void close_tim();
int tim_width();
int tim_height();
void read_tim(unsigned char *uv, int x, int y, int stp);
#define SINGLE_TEX