summaryrefslogtreecommitdiffstats
path: root/zoom/level.h
blob: a389f715b6978cee15b29d73fa363bbbbf9be8c9 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef ZOOM_LEVEL_H
#define ZOOM_LEVEL_H

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

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

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

typedef struct _GATE {
  //unsigned char type;
  //unsigned char open;
  int nWalls;
  WALL *walls;
  //VERTEX point;
  ROOM *room1, *room2;
  int gate;
} GATE;

typedef struct _LEVELINFO {
  char *name;
  char *desc;
  VERTEX start;
} LEVELINFO;

typedef struct _TEXTURE {
  char *name;
  GLuint id;
} TEXTURE;

typedef struct _LEVEL {
  LEVELINFO *info;
  int nRooms;
  ROOM *rooms;
  int nGates;
  GATE *gates;
  int nTextures;
  TEXTURE *textures;
} LEVEL;

typedef struct _POLYGON {
  VECTOR normal;
	VERTEX vertices[3];
	VECTOR normals[3];
	
	GLuint texture;
	TEXCOORDS texcoords[3];
} POLYGON;

typedef struct _POLYGON_LIST {
	int nPolygons;
	
	POLYGON polygons[0];
} POLYGON_LIST;


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

#endif