Changeset 9414 in orxonox.OLD for branches/terrain/src/lib/graphics/importer/bsp_file.h
- Timestamp:
- Jul 24, 2006, 12:47:07 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/terrain/src/lib/graphics/importer/bsp_file.h
r9003 r9414 19 19 20 20 #include <vector> 21 #include "filesys/binary_file.h" 21 22 class SDL_Surface; 22 23 class BspTreeNode; … … 27 28 28 29 29 struct plane 30 struct bsp_lump { 31 int offset; 32 int length; 33 }; 34 35 enum bsp_lumps { 36 Entities = 0, 37 Textures = 1, 38 Planes = 2, 39 Nodes = 3, 40 Leafs = 4, 41 Leaffaces = 5, 42 Leafbrushes = 6, 43 Models = 7, 44 Brushes = 8, 45 Brushsides = 9, 46 Vertices = 10, 47 Meshverts = 11, 48 Effects = 12, 49 Faces = 13, 50 Lightmaps = 14, 51 Lightvols = 15, 52 Visdata = 16 53 }; 54 55 struct bsp_header { 56 // The magic number always "IBSP" 57 char magic[4]; 58 // The version, 0x2e for quake 3 models 59 int version; 60 bsp_lump lumps[17]; 61 }; 62 63 struct plane 30 64 { 31 65 float x; //!< 1st component of the plane's normal … … 34 68 float d; //!< distance of the plane to the origin 35 69 }; 70 36 71 37 72 typedef struct … … 82 117 } 83 118 brushside; 119 84 120 85 121 struct face … … 101 137 } ; 102 138 139 103 140 typedef struct 104 141 { … … 130 167 } 131 168 AMat; 132 133 169 typedef struct 134 170 { … … 144 180 } 145 181 BspTexture; 182 146 183 147 184 class BspFile … … 162 199 163 200 private: 164 BspTreeNode* root; 165 char header [ 280 ]; //!< Buffer for header of BSP-File 166 node* nodes; //!< Buffer to store BSP-Tree-Nodes 167 leaf* leaves; //!< Buffer to store BSP-Tree-Leaves 168 plane* planes; //!< Buffer to store planes separateing the space 169 model* bspModels; //!< Buffer to store BSP-Model-List 170 char* leafFaces; //!< Buffer to store leafFaces 171 face* faces; //!< 172 char* leafBrushes; //!< Buffer to store brush indice 173 brush* brushes; //!< Buffer to store brushes 174 brushside* brushSides; //!< 175 char* vertice; //!< 176 meshvert* meshverts; //!< Buffer to store meshverice 177 char* visData; //!< Buffer to store visibility data 178 char* textures; //!< Holds all the texture filename strings 179 char* patchVertice; //!< 180 char* patchIndexes; 181 char* patchTrianglesPerRow; 182 lightmap* lightMaps; //!< Buffer to store lightmap-images 183 184 185 int** patchRowIndexes; 186 VertexArrayModel** VertexArrayModels; 187 int patchOffset; 188 189 int numNodes; 190 int numLeafs; 191 int numVertex; 192 int numPlanes; 193 int numBspModels; 194 int numLeafFaces; 195 int numFaces; 196 int numLeafBrushes; 197 int numTextures; 198 int numPatches; 199 int numBrushSides; 200 int numLightMaps; 201 202 float scale; 203 204 BspTreeNode* build_tree_rec( int i ); 205 unsigned int loadLightMapToGL(lightmap&); 206 AMat* Materials; 207 unsigned int* glLightMapTextures; 208 unsigned int whiteLightMap; 209 unsigned char whiteTexture[3]; 210 void swapAllBspCoordinates(); 211 void swapCoords(int * array); 212 void swapCoords(float * array); 213 SDL_Surface* testSurf; 214 215 216 ::std::vector<MoviePlayer* > MovieMaterials; //!< Movieplayer Materials 217 }; 218 201 void readEntities(); 202 void readTextures(); 203 void readPlanes(); 204 void readNodes(); 205 void readLeafs(); 206 void readLeafFaces(); 207 void readLeafBrushes(); 208 void readBrushSides(); 209 void readModels(); 210 void readBrushes(); 211 void readVertices(); 212 void readMeshVerts(); 213 void readEffects(); 214 void readFaces(); 215 void readLightmaps(); 216 void readLightvols(); 217 void readVisdata(); 218 BinaryFile file; 219 BspTreeNode* root; 220 bsp_header header; //!< Buffer for header of BSP-File 221 node* nodes; //!< Buffer to store BSP-Tree-Nodes 222 leaf* leaves; //!< Buffer to store BSP-Tree-Leaves 223 plane* planes; //!< Buffer to store planes separateing the space 224 model* bspModels; //!< Buffer to store BSP-Model-List 225 char* leafFaces; //!< Buffer to store leafFaces 226 face* faces; //!< 227 char* leafBrushes; //!< Buffer to store brush indice 228 brush* brushes; //!< Buffer to store brushes 229 brushside* brushSides; //!< 230 char* vertice; //!< 231 meshvert* meshverts; //!< Buffer to store meshverice 232 char* visData; //!< Buffer to store visibility data 233 char* textures; //!< Holds all the texture filename strings 234 char* patchVertice; //!< 235 char* patchIndexes; 236 char* patchTrianglesPerRow; 237 lightmap* lightMaps; //!< Buffer to store lightmap-images 238 239 240 int** patchRowIndexes; 241 VertexArrayModel** VertexArrayModels; 242 int patchOffset; 243 244 int numNodes; 245 int numLeafs; 246 int numVertex; 247 int numPlanes; 248 int numBspModels; 249 int numLeafFaces; 250 int numFaces; 251 int numLeafBrushes; 252 int numTextures; 253 int numPatches; 254 int numBrushSides; 255 int numLightMaps; 256 257 float scale; 258 259 BspTreeNode* build_tree_rec( int i ); 260 unsigned int loadLightMapToGL(lightmap&); 261 AMat* Materials; 262 unsigned int* glLightMapTextures; 263 unsigned int whiteLightMap; 264 unsigned char whiteTexture[3]; 265 void swapAllBspCoordinates(); 266 void swapCoords(int * array); 267 void swapCoords(float * array); 268 SDL_Surface* testSurf; 269 270 271 ::std::vector<MoviePlayer* > MovieMaterials; //!< Movieplayer Materials 272 }; 273
Note: See TracChangeset
for help on using the changeset viewer.