Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound 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 © 2000-2002 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 "OgreDataChunk.h"
00031 
00032 
00033 namespace Ogre {
00034 
00059     class Quake3Level
00060     {
00061     public:
00062         Quake3Level();
00063 
00075         void loadFromChunk(DataChunk& inChunk);
00076 
00077         /* Extracts the embedded lightmap texture data and loads them as textures.
00078            Calling this method makes the lightmap texture data embedded in
00079            the .bsp file available to the renderer. Lightmaps are extracted
00080            and loaded as Texture objects (subclass specific to RenderSystem
00081            subclass) and are named "@lightmap1", "@lightmap2" etc.
00082         */
00083         void extractLightmaps(void) const;
00084 
00086         void initialise(void);
00087 
00089         void* getLump(int lumpType);
00090         int getLumpSize(int lumpType);
00091 
00092 
00094         void dumpContents(void);
00095 
00096         // Internal storage
00097         // This is ALL temporary. Don't rely on it being static
00098 
00099         // NB no brushes, fog or local lightvolumes yet
00100         DataChunk mChunk;
00101         bsp_header_t* mHeader;
00102         unsigned char* mLumpStart;
00103 
00104         int* mElements; // vertex indexes for faces
00105         int mNumElements;
00106 
00107         void* mEntities;
00108         int mNumEntities;
00109 
00110         bsp_model_t* mModels;
00111         int mNumModels;
00112 
00113         bsp_node_t* mNodes;
00114         int mNumNodes;
00115 
00116         bsp_leaf_t* mLeaves;
00117         int mNumLeaves;
00118 
00119         int* mLeafFaces;     // Indexes to face groups by leaf
00120         int mNumLeafFaces;
00121 
00122         bsp_plane_t* mPlanes;
00123         int mNumPlanes;
00124 
00125         bsp_face_t* mFaces;      // Groups of faces
00126         int mNumFaces;
00127 
00128         bsp_vertex_t* mVertices;
00129         int mNumVertices;
00130 
00131         bsp_shader_t* mShaders;
00132         int mNumShaders;
00133 
00134         unsigned char* mLightmaps;
00135         int mNumLightmaps;
00136 
00137         bsp_vis_t* mVis;
00138 
00139         bsp_brush_t* mBrushes;
00140         int mNumBrushes;
00141 
00142         bsp_brushside_t* mBrushSides;
00143         int mNumBrushSides;
00144 
00145         int* mLeafBrushes;      // Groups of indexes to brushes by leaf
00146         int mNumLeafBrushes;
00147 
00148 
00149 
00150     };
00151 }
00152 
00153 
00154 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:40 2004