Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
WorldHeightMap Class Reference

#include <WorldHeightMap.h>

Inherits RefCountClass, and WorldHeightMapInterfaceClass.

Inherited by WorldHeightMapEdit.

Public Types

enum  { NORMAL_DRAW_WIDTH = 129 , NORMAL_DRAW_HEIGHT = 129 , STRETCH_DRAW_WIDTH = 65 , STRETCH_DRAW_HEIGHT = 65 }
 

Public Member Functions

 WorldHeightMap (ChunkInputStream *pFile, Bool bHMapOnly=false)
 
 ~WorldHeightMap (void)
 
const VecICoord2DgetAllBoundaries (void) const
 
UnsignedBytegetDataPtr (void)
 
Int getXExtent (void)
 number of vertices in x
 
Int getYExtent (void)
 number of vertices in y
 
Int getDrawOrgX (void)
 
Int getDrawOrgY (void)
 
Int getDrawWidth (void)
 
Int getDrawHeight (void)
 
void setDrawWidth (Int width)
 
void setDrawHeight (Int height)
 
virtual Int getBorderSize (void)
 
Int getBorderSizeInline (void) const
 
UnsignedByte getDisplayHeight (Int x, Int y)
 Get height with the offset that HeightMapRenderObjClass uses built in.
 
UnsignedByte getHeight (Int xIndex, Int yIndex)
 Get height in normal coordinates.
 
void getUVForBlend (Int edgeClass, Region2D *range)
 
Bool setDrawOrg (Int xOrg, Int yOrg)
 
Int getTextureClassNoBlend (Int xIndex, Int yIndex, Bool baseClass=false)
 
Int getTextureClass (Int xIndex, Int yIndex, Bool baseClass=false)
 
TXTextureClass getTextureFromIndex (Int textureIndex)
 
void setTextureLOD (Int lod)
 set maximum lod level sent to the hardware.
 
TextureClassgetTerrainTexture (void)
 
TextureClassgetAlphaTerrainTexture (void)
 
TextureClassgetEdgeTerrainTexture (void)
 
Bool getUVData (Int xIndex, Int yIndex, float U[4], float V[4], Bool fullTile)
 UV mapping data for a cell to map into the terrain texture. Returns true if the textures had to be stretched for cliffs.
 
Bool getFlipState (Int xIndex, Int yIndex) const
 
Bool getQuickFlipState (Int xIndex, Int yIndex) const
 Faster version of above function without all the safety checks - For people that do checks externally.
 
void setFlipState (Int xIndex, Int yIndex, Bool value)
 
void clearFlipStates (void)
 
Bool getCliffState (Int xIndex, Int yIndex) const
 
Bool getExtraAlphaUVData (Int xIndex, Int yIndex, float U[4], float V[4], UnsignedByte alpha[4], Bool *flip, Bool *cliff)
 
void getAlphaUVData (Int xIndex, Int yIndex, float U[4], float V[4], UnsignedByte alpha[4], Bool *flip, Bool fullTile)
 UV mapping data for a cell to map into the alpha terrain texture.
 
void getTerrainColorAt (Real x, Real y, RGBColor *pColor)
 
AsciiString getTerrainNameAt (Real x, Real y)
 
Bool isCliffMappedTexture (Int xIndex, Int yIndex)
 Get whether something is cliff indexed with the offset that HeightMapRenderObjClass uses built in.
 
Bool getSeismicUpdateFlag (Int xIndex, Int yIndex) const
 
void setSeismicUpdateFlag (Int xIndex, Int yIndex, Bool value)
 
void clearSeismicUpdateFlags (void)
 
virtual Real getSeismicZVelocity (Int xIndex, Int yIndex) const
 
virtual void setSeismicZVelocity (Int xIndex, Int yIndex, Real value)
 
void fillSeismicZVelocities (Real value)
 
virtual Real getBilinearSampleSeismicZVelocity (Int x, Int y)
 
TerrainTextureClassgetFlatTexture (Int xCell, Int yCell, Int cellWidth, Int pixelsPerCell)
 
UnsignedBytegetPointerToTileData (Int xIndex, Int yIndex, Int width)
 
Bool getRawTileData (Short tileNdx, Int width, UnsignedByte *buffer, Int bufLen)
 
UnsignedBytegetRGBAlphaDataForWidth (Int width, TBlendTileInfo *pBlend)
 
void setRawHeight (Int xIndex, Int yIndex, UnsignedByte height)
 
- Public Member Functions inherited from RefCountClass
 RefCountClass (void)
 
 RefCountClass (const RefCountClass &)
 
void Add_Ref (void) const
 
WWINLINE void Release_Ref (void) const
 
int Num_Refs (void) const
 
virtual void Delete_This (void)
 

Static Public Member Functions

static Int getMinHeightValue (void)
 
static Int getMaxHeightValue (void)
 
static void freeListOfMapObjects (void)
 
static void setupAlphaTiles (void)
 
static Bool readTiles (InputStream *pStrm, TileData **tiles, Int numRows)
 
static Int countTiles (InputStream *pStrm, Bool *halfTile=NULL)
 Count how many tiles come in from a targa file.
 
- Static Public Member Functions inherited from RefCountClass
static int Total_Refs (void)
 
static RefCountClassAdd_Active_Ref (RefCountClass *obj)
 
static RefCountClassSet_Ref_Owner (RefCountClass *obj, char *file, int line)
 
static void Remove_Active_Ref (RefCountClass *obj)
 
static bool Validate_Active_Ref (RefCountClass *obj)
 

Protected Member Functions

TileDatagetSourceTile (UnsignedInt ndx)
 
TileDatagetEdgeTile (UnsignedInt ndx)
 
void getUVForNdx (Int ndx, float *minU, float *minV, float *maxU, float *maxV, Bool fullTile)
 UV mapping data for a cell to map into the terrain texture.
 
Bool getUVForTileIndex (Int ndx, Short tileNdx, float U[4], float V[4], Bool fullTile)
 
Int getTextureClassFromNdx (Int tileNdx)
 
void readTexClass (TXTextureClass *texClass, TileData **tileData)
 
Int updateTileTexturePositions (Int *edgeHeight)
 Places each tile in the texture.
 
void initCliffFlagsFromHeights (void)
 
void setCellCliffFlagFromHeights (Int xIndex, Int yIndex)
 
Bool ParseHeightMapData (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
Bool ParseSizeOnly (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
Bool ParseBlendTileData (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
Bool ParseObjectData (DataChunkInput &file, DataChunkInfo *info, void *userData, Bool readDict)
 
 WorldHeightMap (void)
 Simple constructor for WorldHeightMapEdit class.
 
void setCliffState (Int xIndex, Int yIndex, Bool state)
 
- Protected Member Functions inherited from RefCountClass
virtual ~RefCountClass (void)
 

Static Protected Member Functions

static Bool ParseHeightMapDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
static Bool ParseSizeOnlyInChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
static Bool ParseBlendTileDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
static Bool ParseWorldDictDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
static Bool ParseObjectsDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
static Bool ParseObjectDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 
static Bool ParseLightingDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 

Protected Attributes

Int m_width
 Height map width.
 
Int m_height
 Height map height (y size of array).
 
Int m_borderSize
 Non-playable border area.
 
VecICoord2D m_boundaries
 the in-game boundaries
 
Int m_dataSize
 size of m_data.
 
UnsignedBytem_data
 array of z(height) values in the height map.
 
UnsignedBytem_seismicUpdateFlag
 array of bits to prevent ovelapping physics-update regions from doubling effects on shared cells
 
UnsignedInt m_seismicUpdateWidth
 width of the array holding SeismicUpdateFlags
 
Realm_seismicZVelocities
 how fast is the dirt rising/falling at this location
 
UnsignedBytem_cellFlipState
 array of bits to indicate the flip state of each cell.
 
Int m_flipStateWidth
 with of the array holding cellFlipState
 
UnsignedBytem_cellCliffState
 array of bits to indicate the cliff state of each cell.
 
Shortm_tileNdxes
 Texture indices.
 
Shortm_blendTileNdxes
 matches m_Data, indexes into m_blendedTiles. 0 means no blend info.
 
Shortm_cliffInfoNdxes
 matches m_Data, indexes into m_cliffInfo. 0 means no cliff info.
 
Shortm_extraBlendTileNdxes
 matches m_Data, indexes into m_extraBlendedTiles. 0 means no blend info.
 
Int m_numBitmapTiles
 
Int m_numEdgeTiles
 
Int m_numBlendedTiles
 
TileDatam_sourceTiles [NUM_SOURCE_TILES]
 Tiles for m_textureClasses.
 
TileDatam_edgeTiles [NUM_SOURCE_TILES]
 Tiles for m_textureClasses.
 
TBlendTileInfo m_blendedTiles [NUM_BLEND_TILES]
 
TBlendTileInfo m_extraBlendedTiles [NUM_BLEND_TILES]
 
TCliffInfo m_cliffInfo [NUM_CLIFF_INFO]
 
Int m_numCliffInfo
 Number of cliffInfo's used in m_cliffInfo.
 
int m_numTextureClasses
 
TXTextureClass m_textureClasses [NUM_TEXTURE_CLASSES]
 
int m_numEdgeTextureClasses
 
TXTextureClass m_edgeTextureClasses [NUM_TEXTURE_CLASSES]
 
TerrainTextureClassm_terrainTex
 
Int m_terrainTexHeight
 
AlphaTerrainTextureClassm_alphaTerrainTex
 Height of m_terrainTex allocated.
 
Int m_alphaTexHeight
 
AlphaEdgeTextureClassm_alphaEdgeTex
 Height of m_alphaTerrainTex allocated.
 
Int m_alphaEdgeHeight
 
Int m_drawOriginX
 Height of m_alphaEdgeTex allocated.
 
Int m_drawOriginY
 
Int m_drawWidthX
 
Int m_drawHeightY
 

Static Protected Attributes

static TileDatam_alphaTiles [NUM_ALPHA_TILES] ={0,0,0,0,0,0,0,0,0,0,0,0}
 Tiles that hold the alpha channel info.
 

Friends

class TerrainTextureClass
 
class AlphaTerrainTextureClass
 
class W3DCustomEdging
 
class AlphaEdgeTextureClass
 

Additional Inherited Members

- Public Attributes inherited from RefCountClass
RefCountNodeClass ActiveRefNode
 
ActiveRefStruct ActiveRefInfo
 
- Static Public Attributes inherited from RefCountClass
static RefCountListClass ActiveRefList
 

Detailed Description

Definition at line 96 of file WorldHeightMap.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NORMAL_DRAW_WIDTH 
NORMAL_DRAW_HEIGHT 
STRETCH_DRAW_WIDTH 
STRETCH_DRAW_HEIGHT 

Definition at line 110 of file WorldHeightMap.h.

Constructor & Destructor Documentation

◆ WorldHeightMap() [1/2]

WorldHeightMap::WorldHeightMap ( void )
protected

Simple constructor for WorldHeightMapEdit class.

WorldHeightMap - create a new height map for class WorldHeightMap. Note that there is 1 m_numBlendedTiles, which is the implied transparent tile for non-blended tiles.

Definition at line 447 of file WorldHeightMap.cpp.

◆ WorldHeightMap() [2/2]

WorldHeightMap::WorldHeightMap ( ChunkInputStream * pStrm,
Bool logicalDataOnly = false )

WorldHeightMap - read a height map from a file. Format is Chunky.

Input: ChunkInputStream,

Definition at line 486 of file WorldHeightMap.cpp.

◆ ~WorldHeightMap()

WorldHeightMap::~WorldHeightMap ( void )

Definition at line 380 of file WorldHeightMap.cpp.

Member Function Documentation

◆ clearFlipStates()

void WorldHeightMap::clearFlipStates ( void )

Clears all flip state bits.

Definition at line 592 of file WorldHeightMap.cpp.

◆ clearSeismicUpdateFlags()

void WorldHeightMap::clearSeismicUpdateFlags ( void )

Definition at line 623 of file WorldHeightMap.cpp.

◆ countTiles()

Int WorldHeightMap::countTiles ( InputStream * pStrm,
Bool * halfTile = NULL )
static

Count how many tiles come in from a targa file.

Definition at line 1338 of file WorldHeightMap.cpp.

◆ fillSeismicZVelocities()

void WorldHeightMap::fillSeismicZVelocities ( Real value)

Definition at line 647 of file WorldHeightMap.cpp.

◆ freeListOfMapObjects()

void WorldHeightMap::freeListOfMapObjects ( void )
static

Definition at line 431 of file WorldHeightMap.cpp.

◆ getAllBoundaries()

const VecICoord2D & WorldHeightMap::getAllBoundaries ( void ) const
inline

Definition at line 223 of file WorldHeightMap.h.

◆ getAlphaTerrainTexture()

TextureClass * WorldHeightMap::getAlphaTerrainTexture ( void )

Definition at line 2213 of file WorldHeightMap.cpp.

◆ getAlphaUVData()

void WorldHeightMap::getAlphaUVData ( Int xIndex,
Int yIndex,
float U[4],
float V[4],
UnsignedByte alpha[4],
Bool * flip,
Bool fullTile )

UV mapping data for a cell to map into the alpha terrain texture.

getUVData - Gets the texture coordinates to use with the alpha texture.
xIndex and yIndex are the integer coorddinates into the height map. U and V are the texture coordiantes for the 4 corners of a height map cell. fullTile is true if we are doing 1/2 resolution height map, and require a full tile to texture a cell. Otherwise, we use quarter tiles per cell. flip is set if we need to flip the diagonal across the cell to make the alpha coordinates blend properly. Filling a square with 2 triangles is not symmetrical :)

Definition at line 2066 of file WorldHeightMap.cpp.

◆ getBilinearSampleSeismicZVelocity()

Real WorldHeightMap::getBilinearSampleSeismicZVelocity ( Int x,
Int y )
virtual

Implements WorldHeightMapInterfaceClass.

Definition at line 654 of file WorldHeightMap.cpp.

◆ getBorderSize()

virtual Int WorldHeightMap::getBorderSize ( void )
inlinevirtual

Implements WorldHeightMapInterfaceClass.

Definition at line 242 of file WorldHeightMap.h.

◆ getBorderSizeInline()

Int WorldHeightMap::getBorderSizeInline ( void ) const
inline

Definition at line 243 of file WorldHeightMap.h.

◆ getCliffState()

Bool WorldHeightMap::getCliffState ( Int xIndex,
Int yIndex ) const

Get whether the cell is a cliff cell (impassable to ground vehicles).

Definition at line 733 of file WorldHeightMap.cpp.

◆ getDataPtr()

UnsignedByte * WorldHeightMap::getDataPtr ( void )
inline

Definition at line 229 of file WorldHeightMap.h.

◆ getDisplayHeight()

UnsignedByte WorldHeightMap::getDisplayHeight ( Int x,
Int y )
inline

Get height with the offset that HeightMapRenderObjClass uses built in.

Definition at line 245 of file WorldHeightMap.h.

◆ getDrawHeight()

Int WorldHeightMap::getDrawHeight ( void )
inline

Definition at line 239 of file WorldHeightMap.h.

◆ getDrawOrgX()

Int WorldHeightMap::getDrawOrgX ( void )
inline

Definition at line 235 of file WorldHeightMap.h.

◆ getDrawOrgY()

Int WorldHeightMap::getDrawOrgY ( void )
inline

Definition at line 236 of file WorldHeightMap.h.

◆ getDrawWidth()

Int WorldHeightMap::getDrawWidth ( void )
inline

Definition at line 238 of file WorldHeightMap.h.

◆ getEdgeTerrainTexture()

TextureClass * WorldHeightMap::getEdgeTerrainTexture ( void )

Definition at line 2221 of file WorldHeightMap.cpp.

◆ getEdgeTile()

TileData * WorldHeightMap::getEdgeTile ( UnsignedInt ndx)
inlineprotected

Definition at line 192 of file WorldHeightMap.h.

◆ getExtraAlphaUVData()

Bool WorldHeightMap::getExtraAlphaUVData ( Int xIndex,
Int yIndex,
float U[4],
float V[4],
UnsignedByte alpha[4],
Bool * needFlip,
Bool * cliff )
Todo
: Are the different "if" cases mutually exclusive? If so, should add else statements.

Definition at line 1980 of file WorldHeightMap.cpp.

◆ getFlatTexture()

TerrainTextureClass * WorldHeightMap::getFlatTexture ( Int xCell,
Int yCell,
Int cellWidth,
Int pixelsPerCell )

Definition at line 2229 of file WorldHeightMap.cpp.

◆ getFlipState()

Bool WorldHeightMap::getFlipState ( Int xIndex,
Int yIndex ) const

Optimized version of method to get triangle flip state of a terrain cell. Use this instead of getAlphaUVData() whenever possible.

Definition at line 565 of file WorldHeightMap.cpp.

◆ getHeight()

UnsignedByte WorldHeightMap::getHeight ( Int xIndex,
Int yIndex )
inline

Get height in normal coordinates.

Definition at line 248 of file WorldHeightMap.h.

◆ getMaxHeightValue()

static Int WorldHeightMap::getMaxHeightValue ( void )
inlinestatic

Definition at line 227 of file WorldHeightMap.h.

◆ getMinHeightValue()

static Int WorldHeightMap::getMinHeightValue ( void )
inlinestatic

Definition at line 226 of file WorldHeightMap.h.

◆ getPointerToTileData()

UnsignedByte * WorldHeightMap::getPointerToTileData ( Int xIndex,
Int yIndex,
Int width )

Definition at line 2411 of file WorldHeightMap.cpp.

◆ getQuickFlipState()

Bool WorldHeightMap::getQuickFlipState ( Int xIndex,
Int yIndex ) const
inline

Faster version of above function without all the safety checks - For people that do checks externally.

Definition at line 276 of file WorldHeightMap.h.

◆ getRawTileData()

Bool WorldHeightMap::getRawTileData ( Short tileNdx,
Int width,
UnsignedByte * buffer,
Int bufLen )

Definition at line 2549 of file WorldHeightMap.cpp.

◆ getRGBAlphaDataForWidth()

UnsignedByte * WorldHeightMap::getRGBAlphaDataForWidth ( Int width,
TBlendTileInfo * pBlend )

Definition at line 2461 of file WorldHeightMap.cpp.

◆ getSeismicUpdateFlag()

Bool WorldHeightMap::getSeismicUpdateFlag ( Int xIndex,
Int yIndex ) const

Definition at line 602 of file WorldHeightMap.cpp.

◆ getSeismicZVelocity()

Real WorldHeightMap::getSeismicZVelocity ( Int xIndex,
Int yIndex ) const
virtual

Implements WorldHeightMapInterfaceClass.

Definition at line 631 of file WorldHeightMap.cpp.

◆ getSourceTile()

TileData * WorldHeightMap::getSourceTile ( UnsignedInt ndx)
inlineprotected

Definition at line 191 of file WorldHeightMap.h.

◆ getTerrainColorAt()

void WorldHeightMap::getTerrainColorAt ( Real x,
Real y,
RGBColor * pColor )

Definition at line 2355 of file WorldHeightMap.cpp.

◆ getTerrainNameAt()

AsciiString WorldHeightMap::getTerrainNameAt ( Real x,
Real y )

Definition at line 2383 of file WorldHeightMap.cpp.

◆ getTerrainTexture()

TextureClass * WorldHeightMap::getTerrainTexture ( void )

Definition at line 2166 of file WorldHeightMap.cpp.

◆ getTextureClass()

Int WorldHeightMap::getTextureClass ( Int xIndex,
Int yIndex,
Bool baseClass = false )

Gets global texture class.

Definition at line 2286 of file WorldHeightMap.cpp.

◆ getTextureClassFromNdx()

Int WorldHeightMap::getTextureClassFromNdx ( Int tileNdx)
protected

Gets global texture class.

Definition at line 2333 of file WorldHeightMap.cpp.

◆ getTextureClassNoBlend()

Int WorldHeightMap::getTextureClassNoBlend ( Int xIndex,
Int yIndex,
Bool baseClass = false )

◆ getTextureFromIndex()

TXTextureClass WorldHeightMap::getTextureFromIndex ( Int textureIndex)

Definition at line 2350 of file WorldHeightMap.cpp.

◆ getUVData()

Bool WorldHeightMap::getUVData ( Int xIndex,
Int yIndex,
float U[4],
float V[4],
Bool fullTile )

UV mapping data for a cell to map into the terrain texture. Returns true if the textures had to be stretched for cliffs.

getUVData - Gets the texture coordinates to use. See getTerrainTexture. xIndex and yIndex are the integer coorddinates into the height map. U and V are the texture coordiantes for the 4 corners of a height map cell. fullTile is true if we are doing 1/2 resolution height map, and require a full tile to texture a cell. Otherwise, we use quarter tiles per cell.

Definition at line 1687 of file WorldHeightMap.cpp.

◆ getUVForBlend()

void WorldHeightMap::getUVForBlend ( Int edgeClass,
Region2D * range )

getUVData - Gets the texture coordinates to use. See getTerrainTexture.

Definition at line 1662 of file WorldHeightMap.cpp.

◆ getUVForNdx()

void WorldHeightMap::getUVForNdx ( Int tileNdx,
float * minU,
float * minV,
float * maxU,
float * maxV,
Bool fullTile )
protected

UV mapping data for a cell to map into the terrain texture.

getUVData - Gets the texture coordinates to use. See getTerrainTexture.

Definition at line 1613 of file WorldHeightMap.cpp.

◆ getUVForTileIndex()

Bool WorldHeightMap::getUVForTileIndex ( Int ndx,
Short tileNdx,
float U[4],
float V[4],
Bool fullTile )
protected

getUVForTileIndex - Gets the texture coordinates to use. See getTerrainTexture. ndx is the index into the linear height array. tileNdx is the index into the texture tiles array. U and V are the texture coordiantes for the 4 corners of a height map cell. fullTile is true if we are doing 1/2 resolution height map, and require a full tile to texture a cell. Otherwise, we use quarter tiles per cell.

Definition at line 1728 of file WorldHeightMap.cpp.

◆ getXExtent()

Int WorldHeightMap::getXExtent ( void )
inline

number of vertices in x

Definition at line 232 of file WorldHeightMap.h.

◆ getYExtent()

Int WorldHeightMap::getYExtent ( void )
inline

number of vertices in y

Definition at line 233 of file WorldHeightMap.h.

◆ initCliffFlagsFromHeights()

void WorldHeightMap::initCliffFlagsFromHeights ( void )
protected

Sets all the cliff flags in map based on height.

Definition at line 2300 of file WorldHeightMap.cpp.

◆ isCliffMappedTexture()

Bool WorldHeightMap::isCliffMappedTexture ( Int xIndex,
Int yIndex )

Get whether something is cliff indexed with the offset that HeightMapRenderObjClass uses built in.

Definition at line 1673 of file WorldHeightMap.cpp.

◆ ParseBlendTileData()

Bool WorldHeightMap::ParseBlendTileData ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
protected

WorldHeightMap::ParseBlendTileData - read a blend tile info chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 1071 of file WorldHeightMap.cpp.

◆ ParseBlendTileDataChunk()

Bool WorldHeightMap::ParseBlendTileDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
staticprotected

WorldHeightMap::ParseBlendTileDataChunk - read a blend tile info chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 1016 of file WorldHeightMap.cpp.

◆ ParseHeightMapData()

Bool WorldHeightMap::ParseHeightMapData ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
protected

WorldHeightMap::ParseHeightMapData - read a height map chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 890 of file WorldHeightMap.cpp.

◆ ParseHeightMapDataChunk()

Bool WorldHeightMap::ParseHeightMapDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
staticprotected

WorldHeightMap::ParseHeightMapData - read a height map chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 877 of file WorldHeightMap.cpp.

◆ ParseLightingDataChunk()

Bool WorldHeightMap::ParseLightingDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
staticprotected

WorldHeightMap::ParseLightingDataChunk - read a global lights chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 782 of file WorldHeightMap.cpp.

◆ ParseObjectData()

Bool WorldHeightMap::ParseObjectData ( DataChunkInput & file,
DataChunkInfo * info,
void * userData,
Bool readDict )
protected

WorldHeightMap::ParseObjectData - read a object info chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 1251 of file WorldHeightMap.cpp.

◆ ParseObjectDataChunk()

Bool WorldHeightMap::ParseObjectDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
staticprotected

WorldHeightMap::ParseObjectData - read a object info chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 1238 of file WorldHeightMap.cpp.

◆ ParseObjectsDataChunk()

Bool WorldHeightMap::ParseObjectsDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
staticprotected

WorldHeightMap::ParseObjectsDataChunk - read a height map chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 863 of file WorldHeightMap.cpp.

◆ ParseSizeOnly()

Bool WorldHeightMap::ParseSizeOnly ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
protected

WorldHeightMap::ParseHeightMapData - read a height map chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 964 of file WorldHeightMap.cpp.

◆ ParseSizeOnlyInChunk()

Bool WorldHeightMap::ParseSizeOnlyInChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
staticprotected

WorldHeightMap::ParseHeightMapData - read a height map chunk. Format is the newer CHUNKY format. See WHeightMapEdit.cpp for the writer. Input: DataChunkInput

Definition at line 951 of file WorldHeightMap.cpp.

◆ ParseWorldDictDataChunk()

Bool WorldHeightMap::ParseWorldDictDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
staticprotected

Definition at line 763 of file WorldHeightMap.cpp.

◆ readTexClass()

void WorldHeightMap::readTexClass ( TXTextureClass * texClass,
TileData ** tileData )
protected

Function to read in the tiles for a texture class.

Definition at line 1023 of file WorldHeightMap.cpp.

◆ readTiles()

Bool WorldHeightMap::readTiles ( InputStream * pStrm,
TileData ** tiles,
Int numRows )
static

Definition at line 1380 of file WorldHeightMap.cpp.

◆ setCellCliffFlagFromHeights()

void WorldHeightMap::setCellCliffFlagFromHeights ( Int xIndex,
Int yIndex )
protected

Sets the cliff flag for a cell based on height.

Definition at line 2312 of file WorldHeightMap.cpp.

◆ setCliffState()

void WorldHeightMap::setCliffState ( Int xIndex,
Int yIndex,
Bool state )
protected

Sets the cliff state for a given cell.

Definition at line 747 of file WorldHeightMap.cpp.

◆ setDrawHeight()

void WorldHeightMap::setDrawHeight ( Int height)
inline

Definition at line 241 of file WorldHeightMap.h.

◆ setDrawOrg()

Bool WorldHeightMap::setDrawOrg ( Int xOrg,
Int yOrg )

Definition at line 2248 of file WorldHeightMap.cpp.

◆ setDrawWidth()

void WorldHeightMap::setDrawWidth ( Int width)
inline

Definition at line 240 of file WorldHeightMap.h.

◆ setFlipState()

void WorldHeightMap::setFlipState ( Int xIndex,
Int yIndex,
Bool value )

Sets the value of the flip state bit.

Definition at line 576 of file WorldHeightMap.cpp.

◆ setRawHeight()

void WorldHeightMap::setRawHeight ( Int xIndex,
Int yIndex,
UnsignedByte height )
inline

Definition at line 311 of file WorldHeightMap.h.

◆ setSeismicUpdateFlag()

void WorldHeightMap::setSeismicUpdateFlag ( Int xIndex,
Int yIndex,
Bool value )

Definition at line 610 of file WorldHeightMap.cpp.

◆ setSeismicZVelocity()

void WorldHeightMap::setSeismicZVelocity ( Int xIndex,
Int yIndex,
Real value )
virtual

Implements WorldHeightMapInterfaceClass.

Definition at line 639 of file WorldHeightMap.cpp.

◆ setTextureLOD()

void WorldHeightMap::setTextureLOD ( Int lod)

set maximum lod level sent to the hardware.

Definition at line 2160 of file WorldHeightMap.cpp.

◆ setupAlphaTiles()

void WorldHeightMap::setupAlphaTiles ( void )
static

Definition at line 2481 of file WorldHeightMap.cpp.

◆ updateTileTexturePositions()

Int WorldHeightMap::updateTileTexturePositions ( Int * edgeHeight)
protected

Places each tile in the texture.

updateTileTexturePositions - assigns each tile a location in the texture.

Definition at line 1469 of file WorldHeightMap.cpp.

Friends And Related Symbol Documentation

◆ AlphaEdgeTextureClass

friend class AlphaEdgeTextureClass
friend

Definition at line 102 of file WorldHeightMap.h.

◆ AlphaTerrainTextureClass

friend class AlphaTerrainTextureClass
friend

Definition at line 100 of file WorldHeightMap.h.

◆ TerrainTextureClass

friend class TerrainTextureClass
friend

Definition at line 99 of file WorldHeightMap.h.

◆ W3DCustomEdging

friend class W3DCustomEdging
friend

Definition at line 101 of file WorldHeightMap.h.

Member Data Documentation

◆ m_alphaEdgeHeight

Int WorldHeightMap::m_alphaEdgeHeight
protected

Definition at line 178 of file WorldHeightMap.h.

◆ m_alphaEdgeTex

AlphaEdgeTextureClass* WorldHeightMap::m_alphaEdgeTex
protected

Height of m_alphaTerrainTex allocated.

The texture that contains custom blend edge tiles.

Definition at line 177 of file WorldHeightMap.h.

◆ m_alphaTerrainTex

AlphaTerrainTextureClass* WorldHeightMap::m_alphaTerrainTex
protected

Height of m_terrainTex allocated.

The texture that contains the alpha edge tiles that get blended on top of the base texture. getAlphaUVData does the mapping.

Definition at line 173 of file WorldHeightMap.h.

◆ m_alphaTexHeight

Int WorldHeightMap::m_alphaTexHeight
protected

Definition at line 174 of file WorldHeightMap.h.

◆ m_alphaTiles

TileData * WorldHeightMap::m_alphaTiles ={0,0,0,0,0,0,0,0,0,0,0,0}
staticprotected

Tiles that hold the alpha channel info.

Definition at line 375 of file WorldHeightMap.h.

◆ m_blendedTiles

TBlendTileInfo WorldHeightMap::m_blendedTiles[NUM_BLEND_TILES]
protected

Definition at line 148 of file WorldHeightMap.h.

◆ m_blendTileNdxes

Short* WorldHeightMap::m_blendTileNdxes
protected

matches m_Data, indexes into m_blendedTiles. 0 means no blend info.

Definition at line 136 of file WorldHeightMap.h.

◆ m_borderSize

Int WorldHeightMap::m_borderSize
protected

Non-playable border area.

Definition at line 120 of file WorldHeightMap.h.

◆ m_boundaries

VecICoord2D WorldHeightMap::m_boundaries
protected

the in-game boundaries

Definition at line 121 of file WorldHeightMap.h.

◆ m_cellCliffState

UnsignedByte* WorldHeightMap::m_cellCliffState
protected

array of bits to indicate the cliff state of each cell.

Definition at line 131 of file WorldHeightMap.h.

◆ m_cellFlipState

UnsignedByte* WorldHeightMap::m_cellFlipState
protected

array of bits to indicate the flip state of each cell.

Definition at line 129 of file WorldHeightMap.h.

◆ m_cliffInfo

TCliffInfo WorldHeightMap::m_cliffInfo[NUM_CLIFF_INFO]
protected

Definition at line 151 of file WorldHeightMap.h.

◆ m_cliffInfoNdxes

Short* WorldHeightMap::m_cliffInfoNdxes
protected

matches m_Data, indexes into m_cliffInfo. 0 means no cliff info.

Definition at line 137 of file WorldHeightMap.h.

◆ m_data

UnsignedByte* WorldHeightMap::m_data
protected

array of z(height) values in the height map.

Definition at line 123 of file WorldHeightMap.h.

◆ m_dataSize

Int WorldHeightMap::m_dataSize
protected

size of m_data.

Definition at line 122 of file WorldHeightMap.h.

◆ m_drawHeightY

Int WorldHeightMap::m_drawHeightY
protected

Definition at line 184 of file WorldHeightMap.h.

◆ m_drawOriginX

Int WorldHeightMap::m_drawOriginX
protected

Height of m_alphaEdgeTex allocated.

Drawing info - re the part of the map that is being drawn.

Definition at line 181 of file WorldHeightMap.h.

◆ m_drawOriginY

Int WorldHeightMap::m_drawOriginY
protected

Definition at line 182 of file WorldHeightMap.h.

◆ m_drawWidthX

Int WorldHeightMap::m_drawWidthX
protected

Definition at line 183 of file WorldHeightMap.h.

◆ m_edgeTextureClasses

TXTextureClass WorldHeightMap::m_edgeTextureClasses[NUM_TEXTURE_CLASSES]
protected

Definition at line 163 of file WorldHeightMap.h.

◆ m_edgeTiles

TileData* WorldHeightMap::m_edgeTiles[NUM_SOURCE_TILES]
protected

Tiles for m_textureClasses.

Definition at line 146 of file WorldHeightMap.h.

◆ m_extraBlendedTiles

TBlendTileInfo WorldHeightMap::m_extraBlendedTiles[NUM_BLEND_TILES]
protected

Definition at line 149 of file WorldHeightMap.h.

◆ m_extraBlendTileNdxes

Short* WorldHeightMap::m_extraBlendTileNdxes
protected

matches m_Data, indexes into m_extraBlendedTiles. 0 means no blend info.

Definition at line 138 of file WorldHeightMap.h.

◆ m_flipStateWidth

Int WorldHeightMap::m_flipStateWidth
protected

with of the array holding cellFlipState

Definition at line 130 of file WorldHeightMap.h.

◆ m_height

Int WorldHeightMap::m_height
protected

Height map height (y size of array).

Definition at line 119 of file WorldHeightMap.h.

◆ m_numBitmapTiles

Int WorldHeightMap::m_numBitmapTiles
protected

Definition at line 141 of file WorldHeightMap.h.

◆ m_numBlendedTiles

Int WorldHeightMap::m_numBlendedTiles
protected

Definition at line 143 of file WorldHeightMap.h.

◆ m_numCliffInfo

Int WorldHeightMap::m_numCliffInfo
protected

Number of cliffInfo's used in m_cliffInfo.

Definition at line 152 of file WorldHeightMap.h.

◆ m_numEdgeTextureClasses

int WorldHeightMap::m_numEdgeTextureClasses
protected

Definition at line 162 of file WorldHeightMap.h.

◆ m_numEdgeTiles

Int WorldHeightMap::m_numEdgeTiles
protected

Definition at line 142 of file WorldHeightMap.h.

◆ m_numTextureClasses

int WorldHeightMap::m_numTextureClasses
protected

Definition at line 157 of file WorldHeightMap.h.

◆ m_seismicUpdateFlag

UnsignedByte* WorldHeightMap::m_seismicUpdateFlag
protected

array of bits to prevent ovelapping physics-update regions from doubling effects on shared cells

Definition at line 125 of file WorldHeightMap.h.

◆ m_seismicUpdateWidth

UnsignedInt WorldHeightMap::m_seismicUpdateWidth
protected

width of the array holding SeismicUpdateFlags

Definition at line 126 of file WorldHeightMap.h.

◆ m_seismicZVelocities

Real* WorldHeightMap::m_seismicZVelocities
protected

how fast is the dirt rising/falling at this location

Definition at line 127 of file WorldHeightMap.h.

◆ m_sourceTiles

TileData* WorldHeightMap::m_sourceTiles[NUM_SOURCE_TILES]
protected

Tiles for m_textureClasses.

Definition at line 145 of file WorldHeightMap.h.

◆ m_terrainTex

TerrainTextureClass* WorldHeightMap::m_terrainTex
protected

The actual texture used to render the 3d mesh. Note that it is basically m_SourceTiles laid out in rows, so by itself it is not useful. Use GetUVData to get the mapping info for height cells to map into the texture.

Definition at line 169 of file WorldHeightMap.h.

◆ m_terrainTexHeight

Int WorldHeightMap::m_terrainTexHeight
protected

Definition at line 170 of file WorldHeightMap.h.

◆ m_textureClasses

TXTextureClass WorldHeightMap::m_textureClasses[NUM_TEXTURE_CLASSES]
protected

Definition at line 158 of file WorldHeightMap.h.

◆ m_tileNdxes

Short* WorldHeightMap::m_tileNdxes
protected

Texture indices.

matches m_Data, indexes into m_SourceTiles.

Definition at line 135 of file WorldHeightMap.h.

◆ m_width

Int WorldHeightMap::m_width
protected

Height map width.

Definition at line 118 of file WorldHeightMap.h.


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