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

#include <W3DTerrainBackground.h>

Public Member Functions

 W3DTerrainBackground (void)
 
 ~W3DTerrainBackground (void)
 
void drawVisiblePolys (RenderInfoClass &rinfo, Bool disableTextures)
 Draws the terrain.
 
void setFlip (WorldHeightMap *htMap)
 Sets the flip bit for required vertices.
 
void doPartialUpdate (const IRegion2D &partialRange, WorldHeightMap *htMap, Bool doTextures)
 
void doTesselatedUpdate (const IRegion2D &partialRange, WorldHeightMap *htMap, Bool doTextures)
 
void allocateTerrainBuffers (WorldHeightMap *htMap, Int xOrigin, Int yOrigin, Int width)
 Allocates the buffers.
 
void updateCenter (CameraClass *camera)
 
void updateTexture (void)
 
Bool isCulled (void)
 
Int getTexMultiplier (void)
 

Protected Types

enum  { CULL_STATUS_UNKNOWN , CULL_STATUS_VISIBLE , CULL_STATUS_INVISIBLE }
 
enum  { TEX4X =4 , TEX2X =2 , TEX1X =1 }
 
enum  TDirection { HORIZONTAL , VERTICAL }
 

Protected Member Functions

void freeTerrainBuffers (void)
 Frees the index and vertex buffers.
 
void fillVBRecursive (UnsignedShort *ib, Int xOffset, Int yOffset, Int width, UnsignedShort *ndx, Int &curIndex)
 
void setFlipRecursive (Int xOffset, Int yOffset, Int width)
 
Bool advanceLeft (ICoord2D &left, Int xOffset, Int yOffset, Int width)
 
Bool advanceRight (ICoord2D &left, Int xOffset, Int yOffset, Int width)
 

Protected Attributes

enum W3DTerrainBackground:: { ... }  m_cullStatus
 
AABoxClass m_bounds
 
DX8VertexBufferClassm_vertexTerrain
 Terrain vertex buffer.
 
Int m_vertexTerrainSize
 Num vertices in bib buffer.
 
DX8IndexBufferClassm_indexTerrain
 indices defining a triangles for the bib drawing.
 
Int m_indexTerrainSize
 indices available in m_indexTerrain.
 
TerrainTextureClassm_terrainTexture
 Terrain texture.
 
TerrainTextureClassm_terrainTexture2X
 Terrain texture.
 
TerrainTextureClassm_terrainTexture4X
 Terrain texture.
 
enum W3DTerrainBackground:: { ... }  m_texMultiplier
 
Int m_curNumTerrainVertices
 Number of vertices used in m_vertexTerrain.
 
Int m_curNumTerrainIndices
 Number of indices used in b_indexTerrain;.
 
Int m_xOrigin
 
Int m_yOrigin
 
Int m_width
 
WorldHeightMapm_map
 
Bool m_anythingChanged
 Set to true if visibility or sorting changed.
 
Bool m_initialized
 True if the subsystem initialized.
 

Friends

class HeightMapRenderObjClass
 

Detailed Description

Definition at line 79 of file W3DTerrainBackground.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
TEX4X 
TEX2X 
TEX1X 

Definition at line 107 of file W3DTerrainBackground.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
CULL_STATUS_UNKNOWN 
CULL_STATUS_VISIBLE 
CULL_STATUS_INVISIBLE 

Definition at line 97 of file W3DTerrainBackground.h.

◆ TDirection

Enumerator
HORIZONTAL 
VERTICAL 

Definition at line 120 of file W3DTerrainBackground.h.

Constructor & Destructor Documentation

◆ W3DTerrainBackground()

W3DTerrainBackground::W3DTerrainBackground ( void )

Constructor. Sets m_initialized to true if it finds the w3d models it needs for the bibs.

Definition at line 619 of file W3DTerrainBackground.cpp.

◆ ~W3DTerrainBackground()

W3DTerrainBackground::~W3DTerrainBackground ( void )

Destructor. Releases w3d assets.

Definition at line 605 of file W3DTerrainBackground.cpp.

Member Function Documentation

◆ advanceLeft()

Bool W3DTerrainBackground::advanceLeft ( ICoord2D & left,
Int xOffset,
Int yOffset,
Int width )
protected

Fills in vertex & index buffers.

Definition at line 240 of file W3DTerrainBackground.cpp.

◆ advanceRight()

Bool W3DTerrainBackground::advanceRight ( ICoord2D & right,
Int xOffset,
Int yOffset,
Int width )
protected

Fills in vertex & index buffers.

Definition at line 262 of file W3DTerrainBackground.cpp.

◆ allocateTerrainBuffers()

void W3DTerrainBackground::allocateTerrainBuffers ( WorldHeightMap * htMap,
Int xOrigin,
Int yOrigin,
Int width )

Allocates the buffers.

Allocates the index and vertex buffers.

Definition at line 654 of file W3DTerrainBackground.cpp.

◆ doPartialUpdate()

void W3DTerrainBackground::doPartialUpdate ( const IRegion2D & partialRange,
WorldHeightMap * htMap,
Bool doTextures )

Updates a partial block of vertices from [x0,y0 to x1,y1] The coordinates in partialRange are map cell coordinates, relative to the entire map. The vertex coordinates and texture coordinates, as well as static lighting are updated.

Definition at line 115 of file W3DTerrainBackground.cpp.

◆ doTesselatedUpdate()

void W3DTerrainBackground::doTesselatedUpdate ( const IRegion2D & partialRange,
WorldHeightMap * htMap,
Bool doTextures )

Updates a partial block of vertices from [x0,y0 to x1,y1] The coordinates in partialRange are map cell coordinates, relative to the entire map. The vertex coordinates and texture coordinates, as well as static lighting are updated.

Definition at line 472 of file W3DTerrainBackground.cpp.

◆ drawVisiblePolys()

void W3DTerrainBackground::drawVisiblePolys ( RenderInfoClass & rinfo,
Bool disableTextures )

Draws the terrain.

Definition at line 762 of file W3DTerrainBackground.cpp.

◆ fillVBRecursive()

void W3DTerrainBackground::fillVBRecursive ( UnsignedShort * ib,
Int xOffset,
Int yOffset,
Int width,
UnsignedShort * ndx,
Int & curIndex )
protected

Fills in vertex & index buffers.

Definition at line 284 of file W3DTerrainBackground.cpp.

◆ freeTerrainBuffers()

void W3DTerrainBackground::freeTerrainBuffers ( void )
protected

Frees the index and vertex buffers.

Frees the index and vertex buffers.

Definition at line 638 of file W3DTerrainBackground.cpp.

◆ getTexMultiplier()

Int W3DTerrainBackground::getTexMultiplier ( void )
inline

Definition at line 95 of file W3DTerrainBackground.h.

◆ isCulled()

Bool W3DTerrainBackground::isCulled ( void )
inline

Definition at line 94 of file W3DTerrainBackground.h.

◆ setFlip()

void W3DTerrainBackground::setFlip ( WorldHeightMap * htMap)

Sets the flip bit for required vertices.

Loads the terrain into the vertex buffer for drawing.

Definition at line 91 of file W3DTerrainBackground.cpp.

◆ setFlipRecursive()

void W3DTerrainBackground::setFlipRecursive ( Int xOffset,
Int yOffset,
Int width )
protected

Fills in vertex & index buffers.

Definition at line 421 of file W3DTerrainBackground.cpp.

◆ updateCenter()

void W3DTerrainBackground::updateCenter ( CameraClass * camera)

Updates the culling status.

Definition at line 673 of file W3DTerrainBackground.cpp.

◆ updateTexture()

void W3DTerrainBackground::updateTexture ( void )

Updates the culling status.

Definition at line 729 of file W3DTerrainBackground.cpp.

Friends And Related Symbol Documentation

◆ HeightMapRenderObjClass

friend class HeightMapRenderObjClass
friend

Definition at line 81 of file W3DTerrainBackground.h.

Member Data Documentation

◆ m_anythingChanged

Bool W3DTerrainBackground::m_anythingChanged
protected

Set to true if visibility or sorting changed.

Definition at line 116 of file W3DTerrainBackground.h.

◆ m_bounds

AABoxClass W3DTerrainBackground::m_bounds
protected

Definition at line 98 of file W3DTerrainBackground.h.

◆ []

enum { ... } W3DTerrainBackground::m_cullStatus

◆ m_curNumTerrainIndices

Int W3DTerrainBackground::m_curNumTerrainIndices
protected

Number of indices used in b_indexTerrain;.

Definition at line 109 of file W3DTerrainBackground.h.

◆ m_curNumTerrainVertices

Int W3DTerrainBackground::m_curNumTerrainVertices
protected

Number of vertices used in m_vertexTerrain.

Definition at line 108 of file W3DTerrainBackground.h.

◆ m_indexTerrain

DX8IndexBufferClass* W3DTerrainBackground::m_indexTerrain
protected

indices defining a triangles for the bib drawing.

Definition at line 102 of file W3DTerrainBackground.h.

◆ m_indexTerrainSize

Int W3DTerrainBackground::m_indexTerrainSize
protected

indices available in m_indexTerrain.

Definition at line 103 of file W3DTerrainBackground.h.

◆ m_initialized

Bool W3DTerrainBackground::m_initialized
protected

True if the subsystem initialized.

Definition at line 117 of file W3DTerrainBackground.h.

◆ m_map

WorldHeightMap* W3DTerrainBackground::m_map
protected

Definition at line 114 of file W3DTerrainBackground.h.

◆ m_terrainTexture

TerrainTextureClass* W3DTerrainBackground::m_terrainTexture
protected

Terrain texture.

Definition at line 104 of file W3DTerrainBackground.h.

◆ m_terrainTexture2X

TerrainTextureClass* W3DTerrainBackground::m_terrainTexture2X
protected

Terrain texture.

Definition at line 105 of file W3DTerrainBackground.h.

◆ m_terrainTexture4X

TerrainTextureClass* W3DTerrainBackground::m_terrainTexture4X
protected

Terrain texture.

Definition at line 106 of file W3DTerrainBackground.h.

◆ []

enum { ... } W3DTerrainBackground::m_texMultiplier

◆ m_vertexTerrain

DX8VertexBufferClass* W3DTerrainBackground::m_vertexTerrain
protected

Terrain vertex buffer.

Definition at line 100 of file W3DTerrainBackground.h.

◆ m_vertexTerrainSize

Int W3DTerrainBackground::m_vertexTerrainSize
protected

Num vertices in bib buffer.

Definition at line 101 of file W3DTerrainBackground.h.

◆ m_width

Int W3DTerrainBackground::m_width
protected

Definition at line 113 of file W3DTerrainBackground.h.

◆ m_xOrigin

Int W3DTerrainBackground::m_xOrigin
protected

Definition at line 111 of file W3DTerrainBackground.h.

◆ m_yOrigin

Int W3DTerrainBackground::m_yOrigin
protected

Definition at line 112 of file W3DTerrainBackground.h.


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