#include <tile_far_bank.h>
Public Member Functions | |
CTileFar () | |
Default constructor. | |
void | erasePixels (TFarType type) |
Erase a pixel array type. | |
const NLMISC::CRGBA * | getPixels (TFarType type, TFarOrder order) const |
Return the pointer on the pixels data. Call this method only if isFill () returns true. | |
uint | getSize (TFarType type, TFarOrder order) const |
Return the pixel array size. Should be 0 for empty, 64 for a 128x128 tile and 256 for a 256x256 tile. | |
bool | isFill (TFarType type) const |
Return true if pixel value are presents, else return false. | |
void | serial (class NLMISC::IStream &f) throw (NLMISC::EStream) |
Serial this tile. | |
void | setPixels (TFarType type, TFarOrder order, NLMISC::CRGBA *pixels, uint size) |
Set the pixel array of a far Tile. | |
Private Attributes | |
std::vector< NLMISC::CRGBA > | _Pixels [typeCount][orderCount] |
RGBA Pixels vector. | |
Static Private Attributes | |
const sint | _Version = 0x0 |
The version of this class. | |
Friends | |
class | CTileFarBank |
|
Default constructor.
Definition at line 72 of file tile_far_bank.h.
00073 { 00074 } |
|
Erase a pixel array type.
Definition at line 98 of file tile_far_bank.h. References _Pixels, NLMISC::contReset(), and type.
00099 { 00100 NLMISC::contReset (_Pixels[type][order0]); 00101 NLMISC::contReset (_Pixels[type][order1]); 00102 NLMISC::contReset (_Pixels[type][order2]); 00103 } |
|
Return the pointer on the pixels data. Call this method only if isFill () returns true.
Definition at line 77 of file tile_far_bank.h. Referenced by NL3D::CPatchDLMContext::computeTextureFar(), and NL3D::CTextureFar::rebuildPatch().
|
|
Return the pixel array size. Should be 0 for empty, 64 for a 128x128 tile and 256 for a 256x256 tile.
Definition at line 89 of file tile_far_bank.h. References _Pixels, type, and uint.
|
|
Return true if pixel value are presents, else return false.
Definition at line 83 of file tile_far_bank.h. Referenced by NL3D::CPatchDLMContext::computeTextureFar(), and NL3D::CTextureFar::rebuildPatch().
|
|
Serial this tile.
Definition at line 47 of file tile_far_bank.cpp. References size.
00048 { 00049 // Serial version 00050 (void)f.serialVersion(_Version); 00051 00052 // Serial pixels 00053 f.serialCont (_Pixels[diffuse][order0]); 00054 f.serialCont (_Pixels[diffuse][order1]); 00055 f.serialCont (_Pixels[diffuse][order2]); 00056 f.serialCont (_Pixels[additive][order0]); 00057 f.serialCont (_Pixels[additive][order1]); 00058 f.serialCont (_Pixels[additive][order2]); 00059 00060 #ifdef NEL_FORCE_WHITE_FAR_TEXTURE 00061 int size = _Pixels[diffuse][order0].size (); 00062 _Pixels[diffuse][order0].resize (0); 00063 _Pixels[diffuse][order0].resize (size, CRGBA::White); 00064 size = _Pixels[diffuse][order1].size (); 00065 _Pixels[diffuse][order1].resize (0); 00066 _Pixels[diffuse][order1].resize (size, CRGBA::White); 00067 size = _Pixels[diffuse][order2].size (); 00068 _Pixels[diffuse][order2].resize (0); 00069 _Pixels[diffuse][order2].resize (size, CRGBA::White); 00070 #endif // NEL_FORCE_WHITE_FAR_TEXTURE 00071 } |
|
Set the pixel array of a far Tile.
Definition at line 73 of file tile_far_bank.cpp. References _Pixels, NLMISC::CRGBA::A, alpha, size, type, and uint.
00074 { 00075 // Mode alpha ? 00076 if (type==alpha) 00077 { 00078 _Pixels[diffuse][order].resize (size); 00079 _Pixels[additive][order].resize (size); 00080 00081 // Copy only the alpha channel 00082 for (uint p=0; p<size; p++) 00083 { 00084 _Pixels[diffuse][order][p].A=pixels[p].A; 00085 _Pixels[additive][order][p].A=pixels[p].A; 00086 } 00087 } 00088 else 00089 { 00090 // Resize this array 00091 _Pixels[type][order].resize (size); 00092 00093 // Copy all the channels 00094 memcpy (&_Pixels[type][order][0], pixels, size*sizeof(NLMISC::CRGBA)); 00095 } 00096 } |
|
Definition at line 69 of file tile_far_bank.h. |
|
RGBA Pixels vector.
Definition at line 110 of file tile_far_bank.h. Referenced by erasePixels(), getPixels(), getSize(), isFill(), and setPixels(). |
|
The version of this class.
Definition at line 45 of file tile_far_bank.cpp. |