-
Notifications
You must be signed in to change notification settings - Fork 0
/
TIM.h
49 lines (36 loc) · 893 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
#ifndef TIM_H
#define TIM_H
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define RGB555(R,G,B) ((((unsigned int)(B))<<10)|(((unsigned int)(G))<<5)|(((unsigned int)(R))))
typedef struct TIM_DATA {
unsigned int MAGIC_NUM;
unsigned int TIM_BPP;
unsigned int UNK_32;
unsigned short paletteOrgX;
unsigned short paletteOrgY;
unsigned short unk;
unsigned short numbCluts;
unsigned char* clutData;
unsigned int UNK_32_2;
unsigned short imageOrgX;
unsigned short imageOrgY;
unsigned short imageWidth; // mult by 2 to get the actually width
unsigned short imageHeight;
} TIM_DATA ;
class TIM {
public:
TIM();
~TIM();
void timLoad(std::string imgName);
void readFromPtr(unsigned char *data);
TIM_DATA timTexture;
unsigned char *rawTexture;
private:
unsigned int **colorTable;
unsigned char *timData;
unsigned int timSize;
};
#endif