00001 00005 /* 00006 Copyright (C) 1997-2001 Id Software, Inc. 00007 00008 This program is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 as published by the Free Software Foundation; either version 2 00011 of the License, or (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 See the GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00023 */ 00024 00025 #ifndef _BSPFILE 00026 #define _BSPFILE 00027 00028 #include "../../../common/qfiles.h" 00029 00030 void LoadBSPFile(const char *filename); 00031 long WriteBSPFile(const char *filename); 00032 void PrintBSPFileSizes(void); 00033 00037 typedef struct epair_s { 00038 struct epair_s *next; 00039 char *key; 00040 char *value; 00041 } epair_t; 00042 00046 typedef struct { 00047 vec3_t origin; 00048 int firstbrush; 00049 int numbrushes; 00050 epair_t *epairs; 00051 qboolean skip; 00053 } entity_t; 00054 00055 extern int num_entities; 00056 extern entity_t entities[MAX_MAP_ENTITIES]; 00057 00058 entity_t *FindTargetEntity(const char *target); 00059 void ParseEntities(void); 00060 const char *UnparseEntities(void); 00061 00062 void SetKeyValue(entity_t *ent, const char *key, const char *value); 00063 /* will return "" if not present */ 00064 const char *ValueForKey(const entity_t *ent, const char *key); 00065 00066 vec_t FloatForKey(const entity_t *ent, const char *key); 00067 void GetVectorFromString(const char *value, vec3_t vec); 00068 void GetVectorForKey(const entity_t *ent, const char *key, vec3_t vec); 00069 epair_t *ParseEpair(void); 00070 byte *CompressRouting(byte *dataStart, byte *destStart, int l); 00071 00072 #endif /* _BSP_FILE */