|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CTextureFar Class ReferenceA CTextureFar is a set of NL_NUM_FAR_PATCHES_BY_TEXTURE texture used to map a whole patch when it is in far Mode.
More...
#include <texture_far.h>
Inheritance diagram for NL3D::CTextureFar:
List of all members.
Public Methods |
| CTextureFar () |
| Constructor. More...
|
virtual | ~CTextureFar () |
void | setSizeOfFarPatch (sint width, sint height) |
| Set the size of the patch stored in this texture far. More...
|
bool | addPatch (CPatch *pPatch, float &far1UScale, float &far1VScale, float &far1UBias, float &far1VBias, bool &bRot) |
| Add a patch in the CTexture Patch. More...
|
bool | removePatch (CPatch *pPatch) |
| Remove a patch in the CTexture Patch. More...
|
virtual void | doGenerate () |
| Generate the texture. More...
|
uint | touchPatch (uint patchId) |
| Touch a patch by its id in texture (call touchRect()). More...
|
void | linkBeforeUL (CTextureFar *textNext) |
| For lighting update, insert this before textNext (CiruclarList). textNext must be !NULL. More...
|
void | unlinkUL () |
| For lighting update, unlink (CiruclarList). More...
|
CTextureFar * | getNextUL () const |
| For lighting update, get Next (CiruclarList). If ==this, then list is empty. More...
|
Public Attributes |
std::vector< CPatchIdent > | _Patches |
| Vector of patches which texture far is stored in this CTextureFar Should be == to _WidthPatches*_HeightPatches. More...
|
uint32 | _PatchCount |
CTileFarBank * | _Bank |
| A pointer on the far bank. More...
|
Private Methods |
void | rebuildRectangle (uint x, uint y) |
| Rebuild the rectangle passed in parameter. More...
|
virtual void | serial (NLMISC::IStream &f) throw (NLMISC::EStream) |
| From IStreamable. More...
|
| NLMISC_DECLARE_CLASS (CTextureFar) |
Private Attributes |
uint32 | _OriginalWidth |
| The original size. More...
|
uint32 | _OriginalHeight |
CTextureFar * | _ULPrec |
| UpdateLighting. CiruclarList. More...
|
CTextureFar * | _ULNext |
Static Private Attributes |
NLMISC::CRGBA | _LightmapExpanded [] |
uint8 | _LumelExpanded [] |
NLMISC::CRGBA | _TileTLIColors [] |
Detailed Description
A CTextureFar is a set of NL_NUM_FAR_PATCHES_BY_TEXTURE texture used to map a whole patch when it is in far Mode.
(ie not in tile mode). A CTextureFar handle several patch texture.\
Before adding patch to the texture, you must call setSizeOfFarPatch, to intialize the texture.
TODO: keeping the far texture level1 alive when the tile pass in level0 (tile mode), don't erase it. TODO: add an hysteresis to avoid swap of far texture on boundaries of levels TODO: set the upload format in rgba565
-
Author:
-
Cyril Corvazier , Nevrax France
-
Date:
-
2000
Definition at line 67 of file texture_far.h.
Constructor & Destructor Documentation
NL3D::CTextureFar::CTextureFar |
( |
|
) |
|
|
NL3D::CTextureFar::~CTextureFar |
( |
|
) |
[virtual] |
|
Member Function Documentation
bool NL3D::CTextureFar::addPatch |
( |
CPatch * |
pPatch, |
|
|
float & |
far1UScale, |
|
|
float & |
far1VScale, |
|
|
float & |
far1UBias, |
|
|
float & |
far1VBias, |
|
|
bool & |
bRot |
|
) |
|
|
void NL3D::CTextureFar::doGenerate |
( |
|
) |
[virtual] |
|
|
Generate the texture.
See ITexture::doGenerate().
-
See also:
-
ITexture::doGenerate()
Implements NL3D::ITexture.
Definition at line 225 of file texture_far.cpp.
References NLMISC::CBitmap::_Height, NL3D::ITexture::_ListInvalidRect, _OriginalHeight, _OriginalWidth, _Patches, NLMISC::CBitmap::_Width, NL_NUM_FAR_PATCHES_BY_EDGE, NL_NUM_FAR_PATCHES_BY_EDGE_SHIFT, nlassert, rebuildRectangle, NLMISC::CBitmap::RGBA, x, and y. |
CTextureFar* NL3D::CTextureFar::getNextUL |
( |
|
) |
const [inline] |
|
void NL3D::CTextureFar::linkBeforeUL |
( |
CTextureFar * |
textNext |
) |
|
|
NL3D::CTextureFar::NLMISC_DECLARE_CLASS |
( |
CTextureFar |
|
) |
[private] |
|
void NL3D::CTextureFar::rebuildRectangle |
( |
uint |
x, |
|
|
uint |
y |
|
) |
[private] |
|
|
Rebuild the rectangle passed in parameter.
Definition at line 272 of file texture_far.cpp.
References _Bank, NLMISC::CBitmap::_Height, _LightmapExpanded, _LumelExpanded, _Patches, _TileTLIColors, NLMISC::CBitmap::_Width, NL3D_CComputeTileFar::AsmMMX, NL3D_CExpandLightmap::ColorTile, NL3D_CComputeTileFar::DstDeltaX, NL3D_CComputeTileFar::DstDeltaY, NL3D_CComputeTileFar::DstPixels, NL3D_CExpandLightmap::DstPixels, NLMISC::CBitmap::getPixelFormat, NLMISC::CBitmap::getPixels, NLMISC::CSystemInfo::hasMMX, NL3D_CExpandLightmap::Height, NLAISCRIPT::l, NL3D_CExpandLightmap::LumelTile, min, NL3D_CExpandLightmap::MulFactor, NL3D_drawFarTileInFarTexture, NL3D_drawFarTileInFarTextureAdditive, NL3D_drawFarTileInFarTextureAdditiveAlpha, NL3D_drawFarTileInFarTextureAlpha, NL3D_expandLightmap, NL_NUM_FAR_PATCHES_BY_EDGE, NL_NUM_FAR_PATCHES_BY_EDGE_SHIFT, NL_NUM_PIXELS_ON_FAR_TILE_EDGE, NL_TILE_ELM_LAYER_EMPTY, nlassert, nlwarning, NLMISC::CBitmap::RGBA, s, NL3D_CComputeTileFar::Size, size, NL3D_CComputeTileFar::SrcAdditivePixels, NL3D_CComputeTileFar::SrcDeltaX, NL3D_CComputeTileFar::SrcDeltaY, NL3D_CComputeTileFar::SrcDiffusePixels, NL3D_CComputeTileFar::SrcLightingDeltaY, NL3D_CComputeTileFar::SrcLightingPixels, NL3D_CExpandLightmap::StaticLightColor, t, NL3D_CExpandLightmap::TLIColor, NL3D_CExpandLightmap::Width, x, and y.
Referenced by doGenerate. |
bool NL3D::CTextureFar::removePatch |
( |
CPatch * |
pPatch |
) |
|
|
void NL3D::CTextureFar::setSizeOfFarPatch |
( |
sint |
width, |
|
|
sint |
height |
|
) |
|
|
|
Set the size of the patch stored in this texture far.
Note that width must be larger than height. For patch with a bigger height than width, invert width and height value. So, in this texture far, you can store patches with a size of width*height but also patches with a size of height*width. -
Parameters:
-
width |
is the width of the texture far stored in this texture. Can be 64, 32, 16, 8, 4 or 2 |
height |
is the height of the texture far stored in this texture. Can be 64, 32, 16, 8, 4 or 2 |
Definition at line 88 of file texture_far.cpp.
References _OriginalHeight, _OriginalWidth, _PatchCount, _Patches, NL3D::ITexture::Clamp, NLMISC::contReset, height, NL3D::ITexture::Linear, NL3D::ITexture::LinearMipMapOff, NL_NUM_FAR_PATCHES_BY_EDGE, NL_NUM_FAR_PATCHES_BY_TEXTURE, NL3D::ITexture::RGB565, NL3D::ITexture::setFilterMode, NL3D::ITexture::setUploadFormat, NL3D::ITexture::setWrapS, NL3D::ITexture::setWrapT, and width. |
uint NL3D::CTextureFar::touchPatch |
( |
uint |
patchId |
) |
|
|
void NL3D::CTextureFar::unlinkUL |
( |
|
) |
|
|
Member Data Documentation
CRGBA NL3D::CTextureFar::_LightmapExpanded [static, private]
|
|
uint8 NL3D::CTextureFar::_LumelExpanded [static, private]
|
|
uint32 NL3D::CTextureFar::_OriginalHeight [private]
|
|
uint32 NL3D::CTextureFar::_OriginalWidth [private]
|
|
uint32 NL3D::CTextureFar::_PatchCount
|
|
CRGBA NL3D::CTextureFar::_TileTLIColors [static, private]
|
|
CTextureFar* NL3D::CTextureFar::_ULNext [private]
|
|
CTextureFar* NL3D::CTextureFar::_ULPrec [private]
|
|
The documentation for this class was generated from the following files:
|
|