summaryrefslogtreecommitdiffstats
path: root/zoom
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-05-14 19:38:01 +0200
committerneoraider <devnull@localhost>2007-05-14 19:38:01 +0200
commita5aa4b54e23d0793793384a6794cc543ea48ad34 (patch)
tree480f4686b8879347119803ac0973266216a5e6bc /zoom
parent4069752dbc64302b2fb64703644622cb2ec09eef (diff)
downloadlibzoom-a5aa4b54e23d0793793384a6794cc543ea48ad34.tar
libzoom-a5aa4b54e23d0793793384a6794cc543ea48ad34.zip
libzoom: XML level loader implemented.
zoom: Converted old test level to XML.
Diffstat (limited to 'zoom')
-rw-r--r--zoom/level.h53
-rw-r--r--zoom/types.h1
2 files changed, 27 insertions, 27 deletions
diff --git a/zoom/level.h b/zoom/level.h
index c93fd3b..49de407 100644
--- a/zoom/level.h
+++ b/zoom/level.h
@@ -5,45 +5,44 @@
#include <zoom/types.h>
#include <zoom/render.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;
+ int nWalls;
+ int nThings;
+ int nGates;
+ WALL *walls;
+ THING *things;
+ GATE *gates;
+ GATEINFO *gateinfo;
} ROOM;
+typedef struct _LEVELINFO {
+ char *name;
+ char *desc;
+ VERTEX start;
+} LEVELINFO;
+
+typedef struct _TEXTURE {
+ char *name;
+ GLuint id;
+} TEXTURE;
+
typedef struct _LEVEL {
- int nRooms;
- ROOM *rooms;
- int nTextures;
- GLuint *textures;
+ LEVELINFO *info;
+ int nRooms;
+ ROOM *rooms;
+ int nTextures;
+ TEXTURE *textures;
} LEVEL;
-#pragma pack(pop)
typedef struct _POLYGON {
+ VECTOR normal;
VERTEX vertices[3];
- VECTOR normal;
+ VECTOR normals[3];
GLuint texture;
TEXCOORDS texcoords[3];
@@ -56,7 +55,7 @@ typedef struct _POLYGON_LIST {
} POLYGON_LIST;
-int LoadLevel(char *, LEVEL *);
+LEVEL *LoadLevel(char *);
POLYGON_LIST *DrawRoom(LEVEL *, int);
void FreeLevel(LEVEL *);
diff --git a/zoom/types.h b/zoom/types.h
index 0a60876..4c86190 100644
--- a/zoom/types.h
+++ b/zoom/types.h
@@ -32,6 +32,7 @@ typedef struct WALL {
VECTOR normal;
};
};
+ VECTOR normals[3];
int texture;
TEXCOORDS texcoords[3];
} WALL;