OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::Quake3Level Class Reference

Support for loading and extracting data from a Quake3 level file. More...

#include <OgreQuake3Level.h>

+ Inheritance diagram for Ogre::Quake3Level:

Public Member Functions

 Quake3Level ()
 
void dumpContents (void)
 Debug method.
 
void extractLightmaps (void) const
 
voidgetLump (int lumpType)
 Utility function to return a pointer to a lump.
 
int getLumpSize (int lumpType)
 
void initialise (bool headerOnly=false)
 Utility function read the header and set up pointers.
 
void initialiseCounts (void)
 Utility function read the header and set up counters.
 
void initialisePointers (void)
 Utility function read the header and set up pointers.
 
void loadFromStream (DataStreamPtr &inStream)
 Reads Quake3 bsp data from a stream as read from the file.
 
void loadHeaderFromStream (DataStreamPtr &inStream)
 Load just the header information from a Quake3 file.
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
 
voidoperator new (size_t sz, void *ptr)
 placement operator new
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
 

Public Attributes

bsp_brush_tmBrushes
 
bsp_brushside_tmBrushSides
 
MemoryDataStreamPtr mChunk
 
intmElements
 
voidmEntities
 
bsp_face_tmFaces
 
bsp_header_tmHeader
 
intmLeafBrushes
 
intmLeafFaces
 
bsp_leaf_tmLeaves
 
unsigned charmLightmaps
 
unsigned charmLumpStart
 
bsp_model_tmModels
 
bsp_node_tmNodes
 
int mNumBrushes
 
int mNumBrushSides
 
int mNumElements
 
int mNumEntities
 
int mNumFaces
 
int mNumLeafBrushes
 
int mNumLeafFaces
 
int mNumLeaves
 
int mNumLightmaps
 
int mNumModels
 
int mNumNodes
 
int mNumPlanes
 
int mNumShaders
 
int mNumVertices
 
bsp_plane_tmPlanes
 
bsp_shader_tmShaders
 
bsp_vertex_tmVertices
 
bsp_vis_tmVis
 

Detailed Description

Support for loading and extracting data from a Quake3 level file.

This class implements the required methods for opening Quake3 level files and extracting the pertinent data within. Ogre supports BSP based levels through it's own BspLevel class, which is not specific to any file format, so this class is here to source that data from the Quake3 format. Quake3 levels include far more than just data for rendering - typically the leaves of the tree are used for rendering, and brushes, are used to define convex hulls made of planes for collision detection. There are also entities which define non-visual elements like player start points, triggers etc and models which are used for movable scenery like doors and platforms. Shaders meanwhile are textures with extra effects and 'content flags' indicating special properties like water or lava. I will try to support as much of this as I can in Ogre, but I won't duplicate the structure or necessarily use the same terminology. Quake3 is designed for a very specific purpose and code structure, whereas Ogre is designed to be more flexible, so for example I'm likely to separate game-related properties like surface flags from the generics of materials in my implementation. This is a utility class only - a single call to loadFromChunk should be enough. You should not expect the state of this object to be consistent between calls, since it uses pointers to memory which may no longer be valid after the original call. This is why it has no accessor methods for reading it's internal state.

Constructor & Destructor Documentation

◆ Quake3Level()

Ogre::Quake3Level::Quake3Level ( )

Member Function Documentation

◆ dumpContents()

void Ogre::Quake3Level::dumpContents ( void  )

Debug method.

◆ extractLightmaps()

void Ogre::Quake3Level::extractLightmaps ( void  ) const

◆ getLump()

void * Ogre::Quake3Level::getLump ( int  lumpType)

Utility function to return a pointer to a lump.

◆ getLumpSize()

int Ogre::Quake3Level::getLumpSize ( int  lumpType)

◆ initialise()

void Ogre::Quake3Level::initialise ( bool  headerOnly = false)

Utility function read the header and set up pointers.

◆ initialiseCounts()

void Ogre::Quake3Level::initialiseCounts ( void  )

Utility function read the header and set up counters.

◆ initialisePointers()

void Ogre::Quake3Level::initialisePointers ( void  )

Utility function read the header and set up pointers.

◆ loadFromStream()

void Ogre::Quake3Level::loadFromStream ( DataStreamPtr inStream)

Reads Quake3 bsp data from a stream as read from the file.

Since ResourceManagers generally locate data in a variety of places they typically manipulate them as a chunk of data, rather than a file pointer since this is unsupported through compressed archives. Quake3 files are made up of a header (which contains version info and a table of the contents) and 17 'lumps' i.e. sections of data, the offsets to which are kept in the table of contents. The 17 types are predefined (You can find them in OgreQuake3Types.h)

Parameters
inStreamStream containing Quake3 data

◆ loadHeaderFromStream()

void Ogre::Quake3Level::loadHeaderFromStream ( DataStreamPtr inStream)

Load just the header information from a Quake3 file.

Remarks
This method loads just the header information from the Quake3 file, in order to estimate the loading time.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
void  
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

array operator new, with debug line info

Member Data Documentation

◆ mBrushes

bsp_brush_t* Ogre::Quake3Level::mBrushes

◆ mBrushSides

bsp_brushside_t* Ogre::Quake3Level::mBrushSides

◆ mChunk

MemoryDataStreamPtr Ogre::Quake3Level::mChunk

◆ mElements

int* Ogre::Quake3Level::mElements

◆ mEntities

void* Ogre::Quake3Level::mEntities

◆ mFaces

bsp_face_t* Ogre::Quake3Level::mFaces

◆ mHeader

bsp_header_t* Ogre::Quake3Level::mHeader

◆ mLeafBrushes

int* Ogre::Quake3Level::mLeafBrushes

◆ mLeafFaces

int* Ogre::Quake3Level::mLeafFaces

◆ mLeaves

bsp_leaf_t* Ogre::Quake3Level::mLeaves

◆ mLightmaps

unsigned char* Ogre::Quake3Level::mLightmaps

◆ mLumpStart

unsigned char* Ogre::Quake3Level::mLumpStart

◆ mModels

bsp_model_t* Ogre::Quake3Level::mModels

◆ mNodes

bsp_node_t* Ogre::Quake3Level::mNodes

◆ mNumBrushes

int Ogre::Quake3Level::mNumBrushes

◆ mNumBrushSides

int Ogre::Quake3Level::mNumBrushSides

◆ mNumElements

int Ogre::Quake3Level::mNumElements

◆ mNumEntities

int Ogre::Quake3Level::mNumEntities

◆ mNumFaces

int Ogre::Quake3Level::mNumFaces

◆ mNumLeafBrushes

int Ogre::Quake3Level::mNumLeafBrushes

◆ mNumLeafFaces

int Ogre::Quake3Level::mNumLeafFaces

◆ mNumLeaves

int Ogre::Quake3Level::mNumLeaves

◆ mNumLightmaps

int Ogre::Quake3Level::mNumLightmaps

◆ mNumModels

int Ogre::Quake3Level::mNumModels

◆ mNumNodes

int Ogre::Quake3Level::mNumNodes

◆ mNumPlanes

int Ogre::Quake3Level::mNumPlanes

◆ mNumShaders

int Ogre::Quake3Level::mNumShaders

◆ mNumVertices

int Ogre::Quake3Level::mNumVertices

◆ mPlanes

bsp_plane_t* Ogre::Quake3Level::mPlanes

◆ mShaders

bsp_shader_t* Ogre::Quake3Level::mShaders

◆ mVertices

bsp_vertex_t* Ogre::Quake3Level::mVertices

◆ mVis

bsp_vis_t* Ogre::Quake3Level::mVis

The documentation for this class was generated from the following file: