00001 /* 00002 =========================================================================== 00003 Copyright (C) 1999-2005 Id Software, Inc. 00004 00005 This file is part of Quake III Arena source code. 00006 00007 Quake III Arena source code is free software; you can redistribute it 00008 and/or modify it under the terms of the GNU General Public License as 00009 published by the Free Software Foundation; either version 2 of the License, 00010 or (at your option) any later version. 00011 00012 Quake III Arena source code is distributed in the hope that it will be 00013 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Foobar; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 =========================================================================== 00021 */ 00022 00023 #define AREA_PORTAL 1 00024 00025 //temporary AAS face 00026 typedef struct tmp_face_s 00027 { 00028 int num; //face number 00029 int planenum; //number of the plane the face is in 00030 winding_t *winding; //winding of the face 00031 struct tmp_area_s *frontarea; //area at the front of the face 00032 struct tmp_area_s *backarea; //area at the back of the face 00033 int faceflags; //flags of this face 00034 int aasfacenum; //the number of the aas face used for this face 00035 //double link list pointers for front and back area 00036 struct tmp_face_s *prev[2], *next[2]; 00037 //links in the list with faces 00038 struct tmp_face_s *l_prev, *l_next; 00039 } tmp_face_t; 00040 00041 //temporary AAS area settings 00042 typedef struct tmp_areasettings_s 00043 { 00044 //could also add all kind of statistic fields 00045 int contents; //contents of the area 00046 int modelnum; //bsp model inside this area 00047 int areaflags; //area flags 00048 int presencetype; //how a bot can be present in this area 00049 int numreachableareas; //number of reachable areas from this one 00050 int firstreachablearea; //first reachable area in the reachable area index 00051 } tmp_areasettings_t; 00052 00053 //temporary AAS area 00054 typedef struct tmp_area_s 00055 { 00056 int areanum; //number of the area 00057 struct tmp_face_s *tmpfaces; //the faces of the area 00058 int presencetype; //presence type of the area 00059 int contents; //area contents 00060 int modelnum; //bsp model inside this area 00061 int invalid; //true if the area is invalid 00062 tmp_areasettings_t *settings; //area settings 00063 struct tmp_area_s *mergedarea; //points to the new area after merging 00064 //when mergedarea != 0 the area has only the 00065 //seperating face of the merged areas 00066 int aasareanum; //number of the aas area created for this tmp area 00067 //links in the list with areas 00068 struct tmp_area_s *l_prev, *l_next; 00069 } tmp_area_t; 00070 00071 //temporary AAS node 00072 typedef struct tmp_node_s 00073 { 00074 int planenum; //node plane number 00075 struct tmp_area_s *tmparea; //points to an area if this node is an area 00076 struct tmp_node_s *children[2]; //child nodes of this node 00077 } tmp_node_t; 00078 00079 #define NODEBUF_SIZE 128 00080 //node buffer 00081 typedef struct tmp_nodebuf_s 00082 { 00083 int numnodes; 00084 struct tmp_nodebuf_s *next; 00085 tmp_node_t nodes[NODEBUF_SIZE]; 00086 } tmp_nodebuf_t; 00087 00088 //the whole temorary AAS 00089 typedef struct tmp_aas_s 00090 { 00091 //faces 00092 int numfaces; 00093 int facenum; 00094 tmp_face_t *faces; 00095 //areas 00096 int numareas; 00097 int areanum; 00098 tmp_area_t *areas; 00099 //area settings 00100 int numareasettings; 00101 tmp_areasettings_t *areasettings; 00102 //nodes 00103 int numnodes; 00104 tmp_node_t *nodes; 00105 //node buffer 00106 tmp_nodebuf_t *nodebuffer; 00107 } tmp_aas_t; 00108 00109 extern tmp_aas_t tmpaasworld; 00110 00111 //creates a .AAS file with the given name from an already loaded map 00112 void AAS_Create(char *aasfile); 00113 //adds a face side to an area 00114 void AAS_AddFaceSideToArea(tmp_face_t *tmpface, int side, tmp_area_t *tmparea); 00115 //remvoes a face from an area 00116 void AAS_RemoveFaceFromArea(tmp_face_t *tmpface, tmp_area_t *tmparea); 00117 //allocate a tmp face 00118 tmp_face_t *AAS_AllocTmpFace(void); 00119 //free the tmp face 00120 void AAS_FreeTmpFace(tmp_face_t *tmpface); 00121 //allocate a tmp area 00122 tmp_area_t *AAS_AllocTmpArea(void); 00123 //free a tmp area 00124 void AAS_FreeTmpArea(tmp_area_t *tmparea); 00125 //allocate a tmp node 00126 tmp_node_t *AAS_AllocTmpNode(void); 00127 //free a tmp node 00128 void AAS_FreeTmpNode(tmp_node_t *node); 00129 //checks if an area is ok 00130 void AAS_CheckArea(tmp_area_t *tmparea); 00131 //flips the area faces where needed 00132 void AAS_FlipAreaFaces(tmp_area_t *tmparea); 00133 //returns true if the face is a gap seen from the given side 00134 int AAS_GapFace(tmp_face_t *tmpface, int side); 00135 //returns true if the face is a ground face 00136 int AAS_GroundFace(tmp_face_t *tmpface);
1.3.9.1