summaryrefslogtreecommitdiffstats
path: root/zoom/level.h
blob: 0ed961ca765ca997500ea02e9c48cfddc1a333d8 (plain)
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
#ifndef ZOOM_LEVEL_H
#define ZOOM_LEVEL_H

#include <GL/gl.h>
#include <zoom/types.h>

#pragma pack(push, 2)
typedef struct _LEVELHEADER {
	char l, f;
	int nRooms;
	int nTextures;
} LEVELHEADER;

typedef struct _ROOMHEADER {
	int nWalls;
	int nThings;
	int nGates;
} ROOMHEADER;

typedef struct _GATEINFO {
	unsigned short state;
	unsigned short timer;
} GATEINFO;

typedef struct _ROOM {
	int nWalls;
	int nThings;
	int nGates;
	WALL *walls;
	THING *things;
	GATE *gates;
	GATEINFO *gateinfo;
} ROOM;

typedef struct _LEVEL {
	int nRooms;
	ROOM *rooms;
	int nTextures;
	GLuint *textures;
} LEVEL;
#pragma pack(pop)


int LoadLevel(char *, LEVEL *);
void DrawRoom(LEVEL *, int);
void FreeLevel(LEVEL *);

#endif