#include <lod_character_manager.h>
Definition at line 66 of file lod_character_manager.h.
Public Member Functions | |
| void | build (CRGBA col) |
| void | build (const NLMISC::CBitmap &bmp) |
| CLodCharacterTmpBitmap () | |
| CRGBA | getPixel (uint8 U, uint8 V) |
| void | reset () |
Private Attributes | |
| NLMISC::CObjectVector< CRGBA > | _Bitmap |
| uint | _UShift |
| uint | _VShift |
| uint | _WidthPower |
|
|
Definition at line 792 of file lod_character_manager.cpp. References reset().
00793 {
00794 reset();
00795 }
|
|
|
Definition at line 835 of file lod_character_manager.cpp. References _Bitmap, and reset().
|
|
|
build from a bitmap (NB: converted internally). Should be not so big (eg:64*64). Width and height must be <=256 Definition at line 809 of file lod_character_manager.cpp. References _Bitmap, _UShift, _VShift, _WidthPower, NLMISC::CBitmap::convertToType(), NLMISC::CBitmap::getHeight(), NLMISC::CBitmap::getPixels(), NLMISC::getPowerOf2(), NLMISC::CObjectVector< CRGBA >::getPtr(), NLMISC::CBitmap::getWidth(), height, nlassert, NLMISC::CObjectVector< CRGBA >::resize(), sint, src, uint, and width. Referenced by NL3D::CSkeletonModel::computeLodTexture().
00810 {
00811 uint width= bmpIn.getWidth();
00812 uint height= bmpIn.getHeight();
00813 nlassert(width>0 && width<=256);
00814 nlassert(height>0 && height<=256);
00815
00816 // resize bitmap.
00817 _Bitmap.resize(width*height);
00818 _WidthPower= getPowerOf2(width);
00819 // compute shift
00820 _UShift= 8-getPowerOf2(width);
00821 _VShift= 8-getPowerOf2(height);
00822
00823 // convert the bitmap.
00824 CBitmap bmp= bmpIn;
00825 bmp.convertToType(CBitmap::RGBA);
00826 CRGBA *src= (CRGBA*)&bmp.getPixels()[0];
00827 CRGBA *dst= _Bitmap.getPtr();
00828 for(sint nPix= width*height;nPix>0;nPix--, src++, dst++)
00829 {
00830 *dst= *src;
00831 }
00832 }
|
|
||||||||||||
|
Definition at line 81 of file lod_character_manager.h. References _Bitmap, _UShift, _VShift, _WidthPower, and uint8. Referenced by NL3D::CLodCharacterManager::addTextureCompute().
00082 {
00083 U>>= _UShift;
00084 V>>= _VShift;
00085 return _Bitmap[(V<<_WidthPower) + U];
00086 }
|
|
|
Definition at line 798 of file lod_character_manager.cpp. References _Bitmap, _UShift, _VShift, _WidthPower, and NLMISC::CObjectVector< CRGBA >::resize(). Referenced by build(), CLodCharacterTmpBitmap(), and NL3D::CLodCharacterManager::endTextureCompute().
|
|
|
Definition at line 91 of file lod_character_manager.h. Referenced by build(), getPixel(), and reset(). |
|
|
Definition at line 95 of file lod_character_manager.h. Referenced by build(), getPixel(), and reset(). |
|
|
Definition at line 95 of file lod_character_manager.h. Referenced by build(), getPixel(), and reset(). |
|
|
Definition at line 93 of file lod_character_manager.h. Referenced by build(), getPixel(), and reset(). |
1.3.6