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

#include <W3DBridgeBuffer.h>

Public Types

enum  { MAX_BRIDGE_VERTEX =12000 , MAX_BRIDGE_INDEX =2*MAX_BRIDGE_VERTEX , MAX_BRIDGES =200 }
 

Public Member Functions

 W3DBridgeBuffer (void)
 
 ~W3DBridgeBuffer (void)
 
void clearAllBridges (void)
 Empties the bridge buffer.
 
void drawBridges (CameraClass *camera, Bool wireframe, TextureClass *cloudTexture)
 Draws the bridges. Uses camera for culling.
 
void doFullUpdate (void)
 
void loadBridges (W3DTerrainLogic *pTerrainLogic, Bool saveGame)
 Loads the bridges from the map objects list.
 
void worldBuilderUpdateBridgeTowers (W3DAssetManager *assetManager, SimpleSceneClass *scene)
 for the editor and showing visual bridge towers
 
void updateCenter (CameraClass *camera, RefRenderObjListIterator *pLightsIterator)
 

Protected Member Functions

void addBridge (Vector3 fromLoc, Vector3 toLoc, AsciiString name, W3DTerrainLogic *pTerrainLogic, Dict *props)
 Add a bridge at location. Name is the gdf item name.
 
void loadBridgesInVertexAndIndexBuffers (RefRenderObjListIterator *pLightsIterator)
 Fills the index and vertex buffers for drawing.
 
void allocateBridgeBuffers (void)
 Allocates the buffers.
 
void cull (CameraClass *camera)
 Culls the bridges.
 
void freeBridgeBuffers (void)
 Frees the index and vertex buffers.
 

Protected Attributes

DX8VertexBufferClassm_vertexBridge
 Bridge vertex buffer.
 
DX8IndexBufferClassm_indexBridge
 indices defining a triangles for the bridge drawing.
 
VertexMaterialClassm_vertexMaterial
 
TextureClassm_bridgeTexture
 Bridges texture.
 
Int m_curNumBridgeVertices
 Number of vertices used in m_vertexBridge.
 
Int m_curNumBridgeIndices
 Number of indices used in b_indexBridge;.
 
W3DBridge m_bridges [MAX_BRIDGES]
 The bridge buffer. All bridges are stored here.
 
Int m_numBridges
 Number of bridges in m_bridges.
 
Bool m_initialized
 True if the subsystem initialized.
 
Bool m_updateVis
 True if the camera moved, and we need to recalculate visibility.
 
Bool m_anythingChanged
 

Friends

class BaseHeightMapRenderObjClass
 

Detailed Description

Definition at line 150 of file W3DBridgeBuffer.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_BRIDGE_VERTEX 
MAX_BRIDGE_INDEX 
MAX_BRIDGES 

Definition at line 167 of file W3DBridgeBuffer.h.

Constructor & Destructor Documentation

◆ W3DBridgeBuffer()

W3DBridgeBuffer::W3DBridgeBuffer ( void )

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

Definition at line 742 of file W3DBridgeBuffer.cpp.

◆ ~W3DBridgeBuffer()

W3DBridgeBuffer::~W3DBridgeBuffer ( void )

Destructor. Releases w3d assets.

Definition at line 731 of file W3DBridgeBuffer.cpp.

Member Function Documentation

◆ addBridge()

void W3DBridgeBuffer::addBridge ( Vector3 fromLoc,
Vector3 toLoc,
AsciiString name,
W3DTerrainLogic * pTerrainLogic,
Dict * props )
protected

Add a bridge at location. Name is the gdf item name.

Adds a bridge. Name is the GDF object name.

Definition at line 1075 of file W3DBridgeBuffer.cpp.

◆ allocateBridgeBuffers()

void W3DBridgeBuffer::allocateBridgeBuffers ( void )
protected

Allocates the buffers.

Allocates the index and vertex buffers.

Definition at line 774 of file W3DBridgeBuffer.cpp.

◆ clearAllBridges()

void W3DBridgeBuffer::clearAllBridges ( void )

Empties the bridge buffer.

Removes all bridges.

Definition at line 799 of file W3DBridgeBuffer.cpp.

◆ cull()

void W3DBridgeBuffer::cull ( CameraClass * camera)
protected

Culls the bridges.

Todo
  • Sort bridges by texture for better performance.

Culls the bridges, marking the visible flag. If a bridge changes visibility, it sets m_anythingChanged

Definition at line 671 of file W3DBridgeBuffer.cpp.

◆ doFullUpdate()

void W3DBridgeBuffer::doFullUpdate ( void )
inline

Called when the view changes, and sort key needs to be recalculated. Normally sortKey gets calculated when a bridge becomes visible.

Definition at line 163 of file W3DBridgeBuffer.h.

◆ drawBridges()

void W3DBridgeBuffer::drawBridges ( CameraClass * camera,
Bool wireframe,
TextureClass * cloudTexture )

Draws the bridges. Uses camera for culling.

Draws the bridges.

Definition at line 1116 of file W3DBridgeBuffer.cpp.

◆ freeBridgeBuffers()

void W3DBridgeBuffer::freeBridgeBuffers ( void )
protected

Frees the index and vertex buffers.

Frees the index and vertex buffers.

Definition at line 762 of file W3DBridgeBuffer.cpp.

◆ loadBridges()

void W3DBridgeBuffer::loadBridges ( W3DTerrainLogic * pTerrainLogic,
Bool saveGame )

Loads the bridges from the map objects list.

loadBridges. When loaded, tell the terrain logic where the bridge is.

Definition at line 814 of file W3DBridgeBuffer.cpp.

◆ loadBridgesInVertexAndIndexBuffers()

void W3DBridgeBuffer::loadBridgesInVertexAndIndexBuffers ( RefRenderObjListIterator * pLightsIterator)
protected

Fills the index and vertex buffers for drawing.

Loads the bridges into the vertex buffer for drawing.

Definition at line 690 of file W3DBridgeBuffer.cpp.

◆ updateCenter()

void W3DBridgeBuffer::updateCenter ( CameraClass * camera,
RefRenderObjListIterator * pLightsIterator )

Updates the drawing buffer, based on the camera position.

Definition at line 1102 of file W3DBridgeBuffer.cpp.

◆ worldBuilderUpdateBridgeTowers()

void W3DBridgeBuffer::worldBuilderUpdateBridgeTowers ( W3DAssetManager * assetManager,
SimpleSceneClass * scene )

for the editor and showing visual bridge towers

loadBridges. When loaded, tell the terrain logic where the bridge is.

Todo
integrate the editor with the game ... will never happen tho ...

Definition at line 982 of file W3DBridgeBuffer.cpp.

Friends And Related Symbol Documentation

◆ BaseHeightMapRenderObjClass

friend class BaseHeightMapRenderObjClass
friend

Definition at line 152 of file W3DBridgeBuffer.h.

Member Data Documentation

◆ m_anythingChanged

Bool W3DBridgeBuffer::m_anythingChanged
protected

Set to true if visibility changed.

Definition at line 181 of file W3DBridgeBuffer.h.

◆ m_bridges

W3DBridge W3DBridgeBuffer::m_bridges[MAX_BRIDGES]
protected

The bridge buffer. All bridges are stored here.

Definition at line 177 of file W3DBridgeBuffer.h.

◆ m_bridgeTexture

TextureClass* W3DBridgeBuffer::m_bridgeTexture
protected

Bridges texture.

Definition at line 174 of file W3DBridgeBuffer.h.

◆ m_curNumBridgeIndices

Int W3DBridgeBuffer::m_curNumBridgeIndices
protected

Number of indices used in b_indexBridge;.

Definition at line 176 of file W3DBridgeBuffer.h.

◆ m_curNumBridgeVertices

Int W3DBridgeBuffer::m_curNumBridgeVertices
protected

Number of vertices used in m_vertexBridge.

Definition at line 175 of file W3DBridgeBuffer.h.

◆ m_indexBridge

DX8IndexBufferClass* W3DBridgeBuffer::m_indexBridge
protected

indices defining a triangles for the bridge drawing.

Definition at line 172 of file W3DBridgeBuffer.h.

◆ m_initialized

Bool W3DBridgeBuffer::m_initialized
protected

True if the subsystem initialized.

Definition at line 179 of file W3DBridgeBuffer.h.

◆ m_numBridges

Int W3DBridgeBuffer::m_numBridges
protected

Number of bridges in m_bridges.

Definition at line 178 of file W3DBridgeBuffer.h.

◆ m_updateVis

Bool W3DBridgeBuffer::m_updateVis
protected

True if the camera moved, and we need to recalculate visibility.

Definition at line 180 of file W3DBridgeBuffer.h.

◆ m_vertexBridge

DX8VertexBufferClass* W3DBridgeBuffer::m_vertexBridge
protected

Bridge vertex buffer.

Definition at line 171 of file W3DBridgeBuffer.h.

◆ m_vertexMaterial

VertexMaterialClass* W3DBridgeBuffer::m_vertexMaterial
protected

Definition at line 173 of file W3DBridgeBuffer.h.


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