#include <W3DShroud.h>
Public Member Functions | |
| W3DShroud (void) | |
| ~W3DShroud (void) | |
| void | render (CameraClass *cam) |
| render the current shroud state as seen from camera | |
| void | init (WorldHeightMap *pMap, Real worldCellSizeX, Real worldCellSizeY) |
| void | reset (void) |
| Called on map reset. | |
| TextureClass * | getShroudTexture (void) |
| void | ReleaseResources (void) |
| release resources that can't survive D3D device reset. | |
| Bool | ReAcquireResources (void) |
| allocate resources that can't survive D3D device reset. | |
| void | fillShroudData (W3DShroudLevel level) |
| sets the state of the current shroud to some constant value | |
| Int | getNumShroudCellsY (void) |
| Int | getNumShroudCellsX (void) |
| Real | getCellWidth (void) |
| world-space width (x) of each shroud cell. | |
| Real | getCellHeight (void) |
| world-space height (y)of each shroud cell. | |
| Int | getTextureWidth (void) |
| internal use by the shader system. | |
| Int | getTextureHeight (void) |
| W3DShroudLevel | getShroudLevel (Int x, Int y) |
| void | setShroudLevel (Int x, Int y, W3DShroudLevel, Bool textureOnly=FALSE) |
| void | setShroudFilter (Bool enable) |
| turns on bilinear filtering of shroud cells. | |
| void | setBorderShroudLevel (W3DShroudLevel level) |
| color that will appear in unused border terrain. | |
| Real | getDrawOriginX (void) |
| returns ws origin of first pixel in shroud texture. | |
| Real | getDrawOriginY (void) |
| returns ws origin of first pixel in shroud texture. | |
Protected Member Functions | |
| void | interpolateFogLevels (RECT *rect) |
| fade current fog levels to actual logic side levels. | |
| void | fillBorderShroudData (W3DShroudLevel level, SurfaceClass *pDestSurface) |
| fill the destination texture with a known value | |
Protected Attributes | |
| Int | m_numCellsX |
| number of cells covering entire map | |
| Int | m_numCellsY |
| number of cells covering entire map | |
| Int | m_numMaxVisibleCellsX |
| maximum number of shroud cells that can be visible | |
| Int | m_numMaxVisibleCellsY |
| maximum number of shroud cells that can be visible | |
| Real | m_cellWidth |
| spacing between adjacent cells | |
| Real | m_cellHeight |
| spacing between adjacent cells | |
| Byte * | m_shroudData |
| holds amount of shroud per cell. | |
| IDirect3DSurface8 * | m_pSrcTexture |
| stores sysmem copy of visible shroud. | |
| void * | m_srcTextureData |
| pointer to shroud data | |
| UnsignedInt | m_srcTexturePitch |
| width (in bytes) of shroud data buffer. | |
| TextureClass * | m_pDstTexture |
| stores vidmem copy of visible shroud. | |
| Int | m_dstTextureWidth |
| dimensions of m_pDstTexture | |
| Int | m_dstTextureHeight |
| dimensions of m_pDstTexture | |
| TextureFilterClass::FilterType | m_shroudFilter |
| Real | m_drawOriginX |
| Real | m_drawOriginY |
| Bool | m_drawFogOfWar |
| switch to draw alternate fog style instead of solid black | |
| Bool | m_clearDstTexture |
| flag indicating we must clear video memory destination texture | |
| W3DShroudLevel | m_boderShroudLevel |
| color used to clear the shroud border | |
| W3DShroudLevel * | m_finalFogData |
| copy of logical shroud in an easier to access array. | |
| W3DShroudLevel * | m_currentFogData |
| copy of intermediate logical shroud while it's interpolated. | |
Terrain shroud rendering class
Definition at line 78 of file W3DShroud.h.
| W3DShroud::W3DShroud | ( | void | ) |
Definition at line 76 of file W3DShroud.cpp.
| W3DShroud::~W3DShroud | ( | void | ) |
Definition at line 97 of file W3DShroud.cpp.
|
protected |
fill the destination texture with a known value
Definition at line 418 of file W3DShroud.cpp.
| void W3DShroud::fillShroudData | ( | W3DShroudLevel | level | ) |
sets the state of the current shroud to some constant value
Quickly sets the shroud level of entire map to a single value.
Definition at line 354 of file W3DShroud.cpp.
|
inline |
world-space height (y)of each shroud cell.
Definition at line 95 of file W3DShroud.h.
|
inline |
world-space width (x) of each shroud cell.
Definition at line 94 of file W3DShroud.h.
|
inline |
returns ws origin of first pixel in shroud texture.
Definition at line 102 of file W3DShroud.h.
|
inline |
returns ws origin of first pixel in shroud texture.
Definition at line 103 of file W3DShroud.h.
|
inline |
Definition at line 93 of file W3DShroud.h.
|
inline |
Definition at line 92 of file W3DShroud.h.
| W3DShroudLevel W3DShroud::getShroudLevel | ( | Int | x, |
| Int | y ) |
Definition at line 265 of file W3DShroud.cpp.
|
inline |
Definition at line 88 of file W3DShroud.h.
|
inline |
Definition at line 97 of file W3DShroud.h.
|
inline |
internal use by the shader system.
Definition at line 96 of file W3DShroud.h.
| void W3DShroud::init | ( | WorldHeightMap * | pMap, |
| Real | worldCellSizeX, | ||
| Real | worldCellSizeY ) |
Called to initialize a new shroud for a new map. Should be done after the map is loaded into the terrain object. worldCellSize is the world-space dimensions of each shroud cell. The system will generate enough cells to cover the full map.
Definition at line 115 of file W3DShroud.cpp.
|
protected |
fade current fog levels to actual logic side levels.
Definition at line 729 of file W3DShroud.cpp.
| Bool W3DShroud::ReAcquireResources | ( | void | ) |
allocate resources that can't survive D3D device reset.
Restore resources that are lost on D3D device reset.
Definition at line 232 of file W3DShroud.cpp.
| void W3DShroud::ReleaseResources | ( | void | ) |
release resources that can't survive D3D device reset.
Release any resources that can't survive a D3D device reset.
Definition at line 225 of file W3DShroud.cpp.
| void W3DShroud::render | ( | CameraClass * | cam | ) |
render the current shroud state as seen from camera
Updates video memory surface with currently visible shroud data
Definition at line 526 of file W3DShroud.cpp.
| void W3DShroud::reset | ( | void | ) |
Called on map reset.
Definition at line 208 of file W3DShroud.cpp.
| void W3DShroud::setBorderShroudLevel | ( | W3DShroudLevel | level | ) |
color that will appear in unused border terrain.
Set the shroud color within the border area of the map
Definition at line 509 of file W3DShroud.cpp.
| void W3DShroud::setShroudFilter | ( | Bool | enable | ) |
turns on bilinear filtering of shroud cells.
Definition at line 777 of file W3DShroud.cpp.
| void W3DShroud::setShroudLevel | ( | Int | x, |
| Int | y, | ||
| W3DShroudLevel | level, | ||
| Bool | textureOnly = FALSE ) |
Definition at line 286 of file W3DShroud.cpp.
|
protected |
color used to clear the shroud border
Definition at line 124 of file W3DShroud.h.
|
protected |
spacing between adjacent cells
Definition at line 111 of file W3DShroud.h.
|
protected |
spacing between adjacent cells
Definition at line 110 of file W3DShroud.h.
|
protected |
flag indicating we must clear video memory destination texture
Definition at line 123 of file W3DShroud.h.
|
protected |
copy of intermediate logical shroud while it's interpolated.
Definition at line 126 of file W3DShroud.h.
|
protected |
switch to draw alternate fog style instead of solid black
Definition at line 122 of file W3DShroud.h.
|
protected |
Definition at line 120 of file W3DShroud.h.
|
protected |
Definition at line 121 of file W3DShroud.h.
|
protected |
dimensions of m_pDstTexture
Definition at line 118 of file W3DShroud.h.
|
protected |
dimensions of m_pDstTexture
Definition at line 117 of file W3DShroud.h.
|
protected |
copy of logical shroud in an easier to access array.
Definition at line 125 of file W3DShroud.h.
|
protected |
number of cells covering entire map
Definition at line 106 of file W3DShroud.h.
|
protected |
number of cells covering entire map
Definition at line 107 of file W3DShroud.h.
|
protected |
maximum number of shroud cells that can be visible
Definition at line 108 of file W3DShroud.h.
|
protected |
maximum number of shroud cells that can be visible
Definition at line 109 of file W3DShroud.h.
|
protected |
stores vidmem copy of visible shroud.
Definition at line 116 of file W3DShroud.h.
|
protected |
stores sysmem copy of visible shroud.
Definition at line 113 of file W3DShroud.h.
|
protected |
holds amount of shroud per cell.
Definition at line 112 of file W3DShroud.h.
|
protected |
Definition at line 119 of file W3DShroud.h.
|
protected |
pointer to shroud data
Definition at line 114 of file W3DShroud.h.
|
protected |
width (in bytes) of shroud data buffer.
Definition at line 115 of file W3DShroud.h.