-
Notifications
You must be signed in to change notification settings - Fork 0
/
levels.h
59 lines (52 loc) · 938 Bytes
/
levels.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
58
59
struct lvlpoint {
float blx;
float bly;
float blz;
float trx;
float trY;
float trz;
int material;
struct lvlpoint *next;
struct lvlpoint *prev;
};
struct block {
float x1, y1, z1;
float x2, y2, z2;
float x3, y3, z3;
float x4, y4, z4;
};
struct texcoord {
float x1, y1;
float x2, y2;
float x3, y3;
float x4, y4;
};
class Level {
public:
lvlpoint * head;
lvlpoint *tail; //linked lists! yay!
float *vertices;
float *texcoords;
int blocks;
int curBlock;
int maxFuel;
int maxOxygen;
int gravity;
char next[30];
char fname[64];
FILE *data;
Level();
~Level();
bool initialize(const char *filename);
bool loadNext();
void Render( /*float front, float back */ );
void Add(lvlpoint * newPoint);
void Delete(lvlpoint * point);
void Sort();
void Save();
void prepare(); //set up arrays for rendering
void clear(); //empty the lists
private:
lvlpoint * addPoint();
GLuint lvlList;
};