#include <tile_element.h>
Nevrax France
Definition at line 64 of file tile_element.h.
Public Types | |
enum | TVegetableInfo { AboveWater = 0, UnderWater, IntersectWater, VegetableDisabled, VegetInfoLast } |
Micro vegetation position. Above water is the default. More... | |
Public Member Functions | |
void | copyFlagsFromOther (const CTileElement &other) |
Copy this tile flags from an other tile. | |
void | getTile256Info (bool &is256x256, uint8 &uvOff) const |
uint8 | getTileOrient (sint i) const |
uint8 | getTileSubNoise () const |
TVegetableInfo | getVegetableState () const |
Get the micro vegetable state for this tile. | |
void | serial (NLMISC::IStream &f) |
void | setTile256Info (bool is256x256, uint8 uvOff=0) |
void | setTileOrient (sint i, uint8 orient) |
void | setTileSubNoise (uint8 subNoise) |
void | setVegetableState (TVegetableInfo state) |
Set the micro vegetation state. | |
Data Fields | |
uint16 | Tile [3] |
Private Attributes | |
uint16 | Flags |
|
Micro vegetation position. Above water is the default.
Definition at line 125 of file tile_element.h. Referenced by getVegetableState().
00125 { AboveWater = 0, UnderWater, IntersectWater, VegetableDisabled, VegetInfoLast }; |
|
Copy this tile flags from an other tile.
Definition at line 72 of file tile_element.h. References Flags.
|
|
Get the tile 256x256 information. Definition at line 64 of file tile_element.cpp. References NL_TILE_ELM_MASK_UVINFO, NL_TILE_ELM_OFFSET_UVINFO, sint, and uint8. Referenced by NL3D::CPatchDLMContext::computeTextureFar(), NL3D::CTextureFar::rebuildPatch(), and NL3D::CPatchInfo::transform().
00065 { 00066 sint where= NL_TILE_ELM_OFFSET_UVINFO; 00067 sint info= ((Flags>>where) & NL_TILE_ELM_MASK_UVINFO); 00068 uvOff= info&3; 00069 is256x256= (info&4)?true:false; 00070 } |
|
Get the tile orientation of pass i. orient E [0,3]. The rotation is CCW. Definition at line 46 of file tile_element.cpp. References NL_TILE_ELM_MASK_ROTATE, NL_TILE_ELM_OFFSET_ROTATE, NL_TILE_ELM_SIZE_ROTATE, nlassert, sint, and uint8. Referenced by NL3D::CPatchDLMContext::computeTextureFar(), NL3D::CTextureFar::rebuildPatch(), and NL3D::CPatchInfo::transform().
00047 { 00048 nlassert(i>=0 && i<=2); 00049 sint where= NL_TILE_ELM_SIZE_ROTATE*i+NL_TILE_ELM_OFFSET_ROTATE; 00050 return uint8 ((Flags>>where) & NL_TILE_ELM_MASK_ROTATE); 00051 } |
|
Get the tile SubNoise information. Definition at line 116 of file tile_element.h. References NL_TILE_ELM_MASK_SUBNOISE, NL_TILE_ELM_OFFSET_SUBNOISE, and uint8.
00117 { 00118 return ((Flags>>NL_TILE_ELM_OFFSET_SUBNOISE) & NL_TILE_ELM_MASK_SUBNOISE); 00119 } |
|
Get the micro vegetable state for this tile.
Definition at line 131 of file tile_element.h. References NL_TILE_ELM_MASK_VEGETABLE, NL_TILE_ELM_OFFSET_VEGETABLE, and TVegetableInfo. Referenced by NL3D::CZoneLighter::setTileFlagsToDefault().
00132 { 00133 return (TVegetableInfo) ((Flags >> NL_TILE_ELM_OFFSET_VEGETABLE) & NL_TILE_ELM_MASK_VEGETABLE); 00134 } |
|
Definition at line 82 of file tile_element.cpp. References NLMISC::IStream::xmlSerial().
|
|
Set the tile 256x256 information of pass 0. NB: During UV computing, orient is applied first, then tile256x256 uvOffset (only if the tile is 256x256).
Definition at line 54 of file tile_element.cpp. References NL_TILE_ELM_MASK_UVINFO, NL_TILE_ELM_OFFSET_UVINFO, nlassert, sint, and uint8. Referenced by NL3D::CPatchInfo::transform().
00055 { 00056 nlassert(uvOff<=3); 00057 sint where= NL_TILE_ELM_OFFSET_UVINFO; 00058 sint info= uvOff+(is256x256?4:0); 00059 Flags&= ~(NL_TILE_ELM_MASK_UVINFO<<where); 00060 Flags|= info<<where; 00061 } |
|
Set the tile orientation of pass i, to "orient". orient E [0,3]. The rotation is CCW. Definition at line 36 of file tile_element.cpp. References NL_TILE_ELM_MASK_ROTATE, NL_TILE_ELM_OFFSET_ROTATE, NL_TILE_ELM_SIZE_ROTATE, nlassert, sint, and uint8. Referenced by NL3D::CPatchInfo::transform().
00037 { 00038 nlassert(i>=0 && i<=2); 00039 nlassert(orient<=3); 00040 sint where= NL_TILE_ELM_SIZE_ROTATE*i+NL_TILE_ELM_OFFSET_ROTATE; 00041 Flags&= ~(NL_TILE_ELM_MASK_ROTATE<<where); 00042 Flags|= orient<<where; 00043 } |
|
Set the tile SubNoise. subNoise E [0, 15]. Definition at line 73 of file tile_element.cpp. References NL_TILE_ELM_MASK_SUBNOISE, NL_TILE_ELM_OFFSET_SUBNOISE, nlassert, sint, and uint8.
00074 { 00075 nlassert(subNoise<=15); 00076 sint where= NL_TILE_ELM_OFFSET_SUBNOISE; 00077 Flags&= ~(NL_TILE_ELM_MASK_SUBNOISE<<where); 00078 Flags|= subNoise<<where; 00079 } |
|
Set the micro vegetation state.
Definition at line 89 of file tile_element.cpp. References NL_TILE_ELM_MASK_VEGETABLE, NL_TILE_ELM_OFFSET_VEGETABLE, nlassert, uint16, and VegetInfoLast. Referenced by NL3D::CZoneLighter::computeTileFlagsForPositionTowardWater(), and NL3D::CZoneLighter::setTileFlagsToDefault().
00090 { 00091 nlassert(state < VegetInfoLast); 00092 const uint16 mask = NL_TILE_ELM_MASK_VEGETABLE << NL_TILE_ELM_OFFSET_VEGETABLE; 00093 Flags = (Flags & ~mask) | ((uint16) state << NL_TILE_ELM_OFFSET_VEGETABLE); 00094 } |
|
Definition at line 67 of file tile_element.h. Referenced by copyFlagsFromOther(). |
|
The three tile ident. NL_TILE_ELM_LAYER_EMPTY means no Tile for this pass. Tile[0] should be !=NL_TILE_ELM_LAYER_EMPTY. Else cross are drawn... Definition at line 77 of file tile_element.h. Referenced by NL3D::CPatchDLMContext::computeTextureFar(), NL3D::CVisualCollisionEntity::getSurfaceInfo(), NL3D::CTextureFar::rebuildPatch(), and NL3D::CPatchInfo::transform(). |