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

#include <W3DShadow.h>

Public Member Functions

 W3DShadowManager (void)
 
 ~W3DShadowManager (void)
 
Bool init (void)
 initialize resources used by manager, must have valid D3D device.
 
void queueShadows (Bool state)
 flags system to process shadows on next render call.
 
void Reset (void)
 
ShadowaddShadow (RenderObjClass *robj, Shadow::ShadowTypeInfo *shadowInfo=NULL, Drawable *draw=NULL)
 adds shadow caster to rendering system.
 
void removeShadow (Shadow *shadow)
 removed shadow from rendering system and frees its resources.
 
void removeAllShadows (void)
 Remove all shadows.
 
void setShadowColor (UnsignedInt color)
 sets the shadow color and alpha, value in ARGB format.
 
UnsignedInt getShadowColor ()
 gets the shadow color and alpha, value in ARGB format.
 
void setLightPosition (Int lightIndex, Real x, Real y, Real z)
 sets the position of a specific light source.
 
void setTimeOfDay (TimeOfDay tod)
 
void invalidateCachedLightPositions (void)
 forces shadow volumes to update regardless of last lightposition
 
Vector3getLightPosWorld (Int lightIndex)
 returns the position of specified light source.
 
Bool isShadowScene (void)
 
void setStencilShadowMask (int mask)
 mask used to mask out stencil bits used for storing occlusion/playerColor
 
Int getStencilShadowMask (void)
 
void RenderShadows (void)
 
void ReleaseResources (void)
 
Bool ReAcquireResources (void)
 

Protected Attributes

Bool m_isShadowScene
 flag if current scene needs shadows. No shadows on pre-pass and 2D.
 
UnsignedInt m_shadowColor
 color and alpha for all shadows in scene.
 
Int m_stencilShadowMask
 

Detailed Description

Definition at line 37 of file W3DShadow.h.

Constructor & Destructor Documentation

◆ W3DShadowManager()

W3DShadowManager::W3DShadowManager ( void )

Definition at line 97 of file W3DShadow.cpp.

◆ ~W3DShadowManager()

W3DShadowManager::~W3DShadowManager ( void )

Definition at line 116 of file W3DShadow.cpp.

Member Function Documentation

◆ addShadow()

Shadow * W3DShadowManager::addShadow ( RenderObjClass * robj,
Shadow::ShadowTypeInfo * shadowInfo = NULL,
Drawable * draw = NULL )

adds shadow caster to rendering system.

Definition at line 175 of file W3DShadow.cpp.

◆ getLightPosWorld()

Vector3 & W3DShadowManager::getLightPosWorld ( Int lightIndex)

returns the position of specified light source.

Definition at line 222 of file W3DShadow.cpp.

◆ getShadowColor()

UnsignedInt W3DShadowManager::getShadowColor ( )
inline

gets the shadow color and alpha, value in ARGB format.

Definition at line 53 of file W3DShadow.h.

◆ getStencilShadowMask()

Int W3DShadowManager::getStencilShadowMask ( void )
inline

Definition at line 60 of file W3DShadow.h.

◆ init()

Bool W3DShadowManager::init ( void )

initialize resources used by manager, must have valid D3D device.

Do one-time initilalization of shadow systems that need to be active for full duration of game

Definition at line 126 of file W3DShadow.cpp.

◆ invalidateCachedLightPositions()

void W3DShadowManager::invalidateCachedLightPositions ( void )

forces shadow volumes to update regardless of last lightposition

Force update of all shadows even when light source and object have not moved

Definition at line 214 of file W3DShadow.cpp.

◆ isShadowScene()

Bool W3DShadowManager::isShadowScene ( void )
inline

Definition at line 58 of file W3DShadow.h.

◆ queueShadows()

void W3DShadowManager::queueShadows ( Bool state)
inline

flags system to process shadows on next render call.

Definition at line 45 of file W3DShadow.h.

◆ ReAcquireResources()

Bool W3DShadowManager::ReAcquireResources ( void )

Definition at line 155 of file W3DShadow.cpp.

◆ ReleaseResources()

void W3DShadowManager::ReleaseResources ( void )

Definition at line 167 of file W3DShadow.cpp.

◆ removeAllShadows()

void W3DShadowManager::removeAllShadows ( void )

Remove all shadows.

Definition at line 205 of file W3DShadow.cpp.

◆ removeShadow()

void W3DShadowManager::removeShadow ( Shadow * shadow)

removed shadow from rendering system and frees its resources.

Definition at line 200 of file W3DShadow.cpp.

◆ RenderShadows()

void W3DShadowManager::RenderShadows ( void )

◆ Reset()

void W3DShadowManager::Reset ( void )

Do per-map reset. This frees up shadows from all objects since they may not exist on the next map

Definition at line 146 of file W3DShadow.cpp.

◆ setLightPosition()

void W3DShadowManager::setLightPosition ( Int lightIndex,
Real x,
Real y,
Real z )

sets the position of a specific light source.

Todo
: Add support for multiple lights

Definition at line 227 of file W3DShadow.cpp.

◆ setShadowColor()

void W3DShadowManager::setShadowColor ( UnsignedInt color)
inline

sets the shadow color and alpha, value in ARGB format.

Definition at line 52 of file W3DShadow.h.

◆ setStencilShadowMask()

void W3DShadowManager::setStencilShadowMask ( int mask)
inline

mask used to mask out stencil bits used for storing occlusion/playerColor

Definition at line 59 of file W3DShadow.h.

◆ setTimeOfDay()

void W3DShadowManager::setTimeOfDay ( TimeOfDay tod)

Definition at line 235 of file W3DShadow.cpp.

Member Data Documentation

◆ m_isShadowScene

Bool W3DShadowManager::m_isShadowScene
protected

flag if current scene needs shadows. No shadows on pre-pass and 2D.

Definition at line 69 of file W3DShadow.h.

◆ m_shadowColor

UnsignedInt W3DShadowManager::m_shadowColor
protected

color and alpha for all shadows in scene.

Definition at line 70 of file W3DShadow.h.

◆ m_stencilShadowMask

Int W3DShadowManager::m_stencilShadowMask
protected

Definition at line 71 of file W3DShadow.h.


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