From a5aa4b54e23d0793793384a6794cc543ea48ad34 Mon Sep 17 00:00:00 2001 From: neoraider Date: Mon, 14 May 2007 17:38:01 +0000 Subject: libzoom: XML level loader implemented. zoom: Converted old test level to XML. --- zoom/level.h | 53 ++++++++++++++++++++++++++--------------------------- zoom/types.h | 1 + 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'zoom') 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 #include -#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; -- cgit v1.2.3