OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreQuake3Level.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __Quake3Level_H__
29 #define __Quake3Level_H__
30 
31 #include "OgreBspPrerequisites.h"
32 #include "OgreQuake3Types.h"
33 #include "OgreDataStream.h"
34 
35 
36 namespace Ogre {
37 
62  class Quake3Level : public ResourceAlloc
63  {
64  public:
65  Quake3Level();
66 
72  void loadHeaderFromStream(DataStreamPtr& inStream);
73 
85  void loadFromStream(DataStreamPtr& inStream);
86 
87  /* Extracts the embedded lightmap texture data and loads them as textures.
88  Calling this method makes the lightmap texture data embedded in
89  the .bsp file available to the renderer. Lightmaps are extracted
90  and loaded as Texture objects (subclass specific to RenderSystem
91  subclass) and are named "@lightmap1", "@lightmap2" etc.
92  */
93  void extractLightmaps(void) const;
94 
96  void initialise(bool headerOnly = false);
98  void initialiseCounts(void);
100  void initialisePointers(void);
101 
103  void* getLump(int lumpType);
104  int getLumpSize(int lumpType);
105 
107  void dumpContents(void);
108 
109  // Internal storage
110  // This is ALL temporary. Don't rely on it being static
112 
113  // NB no brushes, fog or local lightvolumes yet
115  unsigned char* mLumpStart;
116 
117  int* mElements; // vertex indexes for faces
119 
120  void* mEntities;
122 
125 
128 
131 
132  int* mLeafFaces; // Indexes to face groups by leaf
134 
137 
138  bsp_face_t* mFaces; // Groups of faces
140 
143 
146 
147  unsigned char* mLightmaps;
149 
151 
154 
157 
158  int* mLeafBrushes; // Groups of indexes to brushes by leaf
160 
161 
162 
163  };
164 }
165 
166 
167 #endif
void extractLightmaps(void) const
void initialisePointers(void)
Utility function read the header and set up pointers.
bsp_node_t * mNodes
bsp_leaf_t * mLeaves
void loadFromStream(DataStreamPtr &inStream)
Reads Quake3 bsp data from a stream as read from the file.
void dumpContents(void)
Debug method.
int getLumpSize(int lumpType)
unsigned char * mLightmaps
bsp_plane_t * mPlanes
bsp_header_t * mHeader
unsigned char * mLumpStart
Support for loading and extracting data from a Quake3 level file.
void initialiseCounts(void)
Utility function read the header and set up counters.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
bsp_model_t * mModels
void loadHeaderFromStream(DataStreamPtr &inStream)
Load just the header information from a Quake3 file.
void * getLump(int lumpType)
Utility function to return a pointer to a lump.
bsp_vertex_t * mVertices
MemoryDataStreamPtr mChunk
bsp_face_t * mFaces
bsp_shader_t * mShaders
void initialise(bool headerOnly=false)
Utility function read the header and set up pointers.
bsp_brushside_t * mBrushSides
bsp_brush_t * mBrushes