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

#include <W3DPropBuffer.h>

Inherits Snapshot.

Public Member Functions

 W3DPropBuffer (void)
 
 ~W3DPropBuffer (void)
 
void addProp (Int id, Coord3D location, Real angle, Real scale, const AsciiString &modelName)
 Add a prop at location. Name is the w3d model name.
 
void removeProp (Int id)
 Remove a prop.
 
Bool updatePropPosition (Int id, const Coord3D &location, Real angle, Real scale)
 Remove a prop.
 
void notifyShroudChanged (void)
 Let us know that the shroud has changed.
 
void removePropsForConstruction (const Coord3D *pos, const GeometryInfo &geom, Real angle)
 
Int addPropType (const AsciiString &modelName)
 Add a type of prop. Name is the w3d model name.
 
void clearAllProps (void)
 Empties the prop buffer.
 
void drawProps (RenderInfoClass &rinfo)
 Draws the props. Uses camera for culling.
 
void doFullUpdate (void)
 Called when the view changes, and sort key needs to be recalculated.
 

Protected Types

enum  { MAX_PROPS =4000 }
 
enum  { MAX_TYPES = 64 }
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
void cull (CameraClass *camera)
 Culls the props.
 

Protected Attributes

TProp m_props [MAX_PROPS]
 The prop buffer. All props are stored here.
 
Int m_numProps
 Number of props in m_props.
 
Bool m_anythingChanged
 Set to true if visibility or sorting changed.
 
Bool m_initialized
 True if the subsystem initialized.
 
Bool m_doCull
 
TPropType m_propTypes [MAX_TYPES]
 Info about a kind of prop.
 
Int m_numPropTypes
 Number of entries in m_propTypes.
 
W3DShroudMaterialPassClassm_propShroudMaterialPass
 Custom render pass which applies shrouds to objects.
 
LightClassm_light
 

Friends

class BaseHeightMapRenderObjClass
 

Detailed Description

Definition at line 96 of file W3DPropBuffer.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
MAX_TYPES 

Definition at line 137 of file W3DPropBuffer.h.

◆ anonymous enum

anonymous enum
protected
Enumerator
MAX_PROPS 

Definition at line 136 of file W3DPropBuffer.h.

Constructor & Destructor Documentation

◆ W3DPropBuffer()

W3DPropBuffer::W3DPropBuffer ( void )

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

Definition at line 123 of file W3DPropBuffer.cpp.

◆ ~W3DPropBuffer()

W3DPropBuffer::~W3DPropBuffer ( void )

Destructor. Releases w3d assets.

Definition at line 107 of file W3DPropBuffer.cpp.

Member Function Documentation

◆ addProp()

void W3DPropBuffer::addProp ( Int id,
Coord3D location,
Real angle,
Real scale,
const AsciiString & modelName )

Add a prop at location. Name is the w3d model name.

Adds a prop. Name is the W3D model name, supported models are ALPINE, DECIDUOUS and SHRUB.

Definition at line 184 of file W3DPropBuffer.cpp.

◆ addPropType()

Int W3DPropBuffer::addPropType ( const AsciiString & modelName)

Add a type of prop. Name is the w3d model name.

Adds a type of prop (model & texture).

Definition at line 158 of file W3DPropBuffer.cpp.

◆ clearAllProps()

void W3DPropBuffer::clearAllProps ( void )

Empties the prop buffer.

Removes all props.

Definition at line 142 of file W3DPropBuffer.cpp.

◆ crc()

void W3DPropBuffer::crc ( Xfer * xfer)
protectedvirtual

CRC

Implements Snapshot.

Definition at line 397 of file W3DPropBuffer.cpp.

◆ cull()

void W3DPropBuffer::cull ( CameraClass * camera)
protected

Culls the props.

Culls the props, marking the visible flag. If a prop becomes visible, it sets it's sortKey

Definition at line 86 of file W3DPropBuffer.cpp.

◆ doFullUpdate()

void W3DPropBuffer::doFullUpdate ( void )
inline

Called when the view changes, and sort key needs to be recalculated.

Definition at line 127 of file W3DPropBuffer.h.

◆ drawProps()

void W3DPropBuffer::drawProps ( RenderInfoClass & rinfo)

Draws the props. Uses camera for culling.

Draws the props. Uses camera to cull.

Definition at line 327 of file W3DPropBuffer.cpp.

◆ loadPostProcess()

void W3DPropBuffer::loadPostProcess ( void )
protectedvirtual

Load post process

Implements Snapshot.

Definition at line 421 of file W3DPropBuffer.cpp.

◆ notifyShroudChanged()

void W3DPropBuffer::notifyShroudChanged ( void )

Let us know that the shroud has changed.

Sets the shroud to status, so it is recomputed.

Definition at line 311 of file W3DPropBuffer.cpp.

◆ removeProp()

void W3DPropBuffer::removeProp ( Int id)

Remove a prop.

Removes a prop.

Definition at line 260 of file W3DPropBuffer.cpp.

◆ removePropsForConstruction()

void W3DPropBuffer::removePropsForConstruction ( const Coord3D * pos,
const GeometryInfo & geom,
Real angle )

Removes any props that would be under a building.

Definition at line 281 of file W3DPropBuffer.cpp.

◆ updatePropPosition()

Bool W3DPropBuffer::updatePropPosition ( Int id,
const Coord3D & location,
Real angle,
Real scale )

Remove a prop.

Updates a prop's position

Definition at line 233 of file W3DPropBuffer.cpp.

◆ xfer()

void W3DPropBuffer::xfer ( Xfer * xfer)
protectedvirtual

Xfer Version Info: 1: Initial version

Implements Snapshot.

Definition at line 407 of file W3DPropBuffer.cpp.

Friends And Related Symbol Documentation

◆ BaseHeightMapRenderObjClass

friend class BaseHeightMapRenderObjClass
friend

Definition at line 98 of file W3DPropBuffer.h.

Member Data Documentation

◆ m_anythingChanged

Bool W3DPropBuffer::m_anythingChanged
protected

Set to true if visibility or sorting changed.

Definition at line 141 of file W3DPropBuffer.h.

◆ m_doCull

Bool W3DPropBuffer::m_doCull
protected

Definition at line 143 of file W3DPropBuffer.h.

◆ m_initialized

Bool W3DPropBuffer::m_initialized
protected

True if the subsystem initialized.

Definition at line 142 of file W3DPropBuffer.h.

◆ m_light

LightClass* W3DPropBuffer::m_light
protected

Definition at line 148 of file W3DPropBuffer.h.

◆ m_numProps

Int W3DPropBuffer::m_numProps
protected

Number of props in m_props.

Definition at line 140 of file W3DPropBuffer.h.

◆ m_numPropTypes

Int W3DPropBuffer::m_numPropTypes
protected

Number of entries in m_propTypes.

Definition at line 145 of file W3DPropBuffer.h.

◆ m_props

TProp W3DPropBuffer::m_props[MAX_PROPS]
protected

The prop buffer. All props are stored here.

Definition at line 139 of file W3DPropBuffer.h.

◆ m_propShroudMaterialPass

W3DShroudMaterialPassClass* W3DPropBuffer::m_propShroudMaterialPass
protected

Custom render pass which applies shrouds to objects.

Definition at line 146 of file W3DPropBuffer.h.

◆ m_propTypes

TPropType W3DPropBuffer::m_propTypes[MAX_TYPES]
protected

Info about a kind of prop.

Definition at line 144 of file W3DPropBuffer.h.


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