-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSdlSc2k.h
More file actions
40 lines (36 loc) · 784 Bytes
/
SdlSc2k.h
File metadata and controls
40 lines (36 loc) · 784 Bytes
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
#ifndef SDLSC2K_H
#define SDLSC2K_H
#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<malloc.h>
#include<unistd.h>
#include<string.h>
typedef struct SHAP{
unsigned char *index;
unsigned int len1;
unsigned char scale;
unsigned char id;
unsigned short width;
unsigned short height;
unsigned int len2;
struct SHAP *next;
}ShapHeader;
class SdlSc2k{
public:
SdlSc2k();
~SdlSc2k();
ShapHeader *getShap(unsigned short pId);
int loadFile(const char *pFilename);
private:
unsigned int getUint32(unsigned char *pVal);
unsigned short getUint16(unsigned char *pVal);
void loadShap(int pIdx, ShapHeader *pSh);
int findStart();
int buildShapList();
int mSize;
unsigned char *mData;
ShapHeader *mShapes;
};
#endif