Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreQuake3Level.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __Quake3Level_H__
00026 #define __Quake3Level_H__
00027 
00028 #include "OgreBspPrerequisites.h"
00029 #include "OgreQuake3Types.h"
00030 #include "OgreDataStream.h"
00031 
00032 
00033 namespace Ogre {
00034 
00059     class Quake3Level
00060     {
00061     public:
00062         Quake3Level();
00063 
00069         void loadHeaderFromStream(DataStreamPtr& inStream);
00070 
00082         void loadFromStream(DataStreamPtr& inStream);
00083 
00084         /* Extracts the embedded lightmap texture data and loads them as textures.
00085            Calling this method makes the lightmap texture data embedded in
00086            the .bsp file available to the renderer. Lightmaps are extracted
00087            and loaded as Texture objects (subclass specific to RenderSystem
00088            subclass) and are named "@lightmap1", "@lightmap2" etc.
00089         */
00090         void extractLightmaps(void) const;
00091 
00093         void initialise(bool headerOnly = false);
00095         void initialiseCounts(void);
00097         void initialisePointers(void);
00098 
00100         void* getLump(int lumpType);
00101         int getLumpSize(int lumpType);
00102 
00104         void dumpContents(void);
00105 
00106         // Internal storage
00107         // This is ALL temporary. Don't rely on it being static
00108         MemoryDataStreamPtr mChunk;
00109 
00110         // NB no brushes, fog or local lightvolumes yet
00111         bsp_header_t* mHeader;
00112         unsigned char* mLumpStart;
00113 
00114         int* mElements; // vertex indexes for faces
00115         int mNumElements;
00116 
00117         void* mEntities;
00118         int mNumEntities;
00119 
00120         bsp_model_t* mModels;
00121         int mNumModels;
00122 
00123         bsp_node_t* mNodes;
00124         int mNumNodes;
00125 
00126         bsp_leaf_t* mLeaves;
00127         int mNumLeaves;
00128 
00129         int* mLeafFaces;     // Indexes to face groups by leaf
00130         int mNumLeafFaces;
00131 
00132         bsp_plane_t* mPlanes;
00133         int mNumPlanes;
00134 
00135         bsp_face_t* mFaces;      // Groups of faces
00136         int mNumFaces;
00137 
00138         bsp_vertex_t* mVertices;
00139         int mNumVertices;
00140 
00141         bsp_shader_t* mShaders;
00142         int mNumShaders;
00143 
00144         unsigned char* mLightmaps;
00145         int mNumLightmaps;
00146 
00147         bsp_vis_t* mVis;
00148 
00149         bsp_brush_t* mBrushes;
00150         int mNumBrushes;
00151 
00152         bsp_brushside_t* mBrushSides;
00153         int mNumBrushSides;
00154 
00155         int* mLeafBrushes;      // Groups of indexes to brushes by leaf
00156         int mNumLeafBrushes;
00157 
00158 
00159 
00160     };
00161 }
00162 
00163 
00164 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:47 2006