# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CTextureNear Class Reference

A texture container for lot of little lightmap. More...

#include <texture_near.h>

Inheritance diagram for NL3D::CTextureNear:

NL3D::ITexture NLMISC::CBitmap NLMISC::CRefCount NLMISC::IStreamable NLMISC::IClassable List of all members.

Public Methods

 CTextureNear (sint size)
 Constructor. More...

void doGenerate ()
 Since texture is always in memory... More...

 CTextureNear ()
 TextureNear are system. Do not need to serialize them... More...

virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 serial ITexture basic infos (clamp ...). More...

 NLMISC_DECLARE_CLASS (CTextureNear)
Tile Lightmap mgt.
sint getNbAvailableTiles ()
uint getTileAndFillRect (CRGBA map[NL_TILE_LIGHTMAP_SIZE *NL_TILE_LIGHTMAP_SIZE])
 return the id of the tile, locally in the texture. More...

void refillRect (uint id, CRGBA map[NL_TILE_LIGHTMAP_SIZE *NL_TILE_LIGHTMAP_SIZE])
 given id of the tile, refill the texture. More...

void releaseTile (uint id)
 Set a tile lightmap as free for use. It is an error to free a not allocated tile. (nlassert!!). More...


Private Attributes

std::vector< uint_FreeTiles
 The list of available tiles. More...

std::vector< bool > _AvailableTiles
 For check, Availability of tiles. More...


Detailed Description

A texture container for lot of little lightmap.

Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 51 of file texture_near.h.


Constructor & Destructor Documentation

NL3D::CTextureNear::CTextureNear sint    size
 

Constructor.

Definition at line 37 of file texture_near.cpp.

References _AvailableTiles, _FreeTiles, NL_TILE_LIGHTMAP_SIZE, nlassert, NL3D::ITexture::setFilterMode, NL3D::ITexture::setReleasable, and NL3D::ITexture::setUploadFormat.

NL3D::CTextureNear::CTextureNear   [inline]
 

TextureNear are system. Do not need to serialize them...

Definition at line 88 of file texture_near.h.

References nlstop.


Member Function Documentation

void NL3D::CTextureNear::doGenerate   [inline, virtual]
 

Since texture is always in memory...

Implements NL3D::ITexture.

Definition at line 59 of file texture_near.h.

sint NL3D::CTextureNear::getNbAvailableTiles  
 

Definition at line 65 of file texture_near.cpp.

References _FreeTiles.

Referenced by getTileAndFillRect.

uint NL3D::CTextureNear::getTileAndFillRect CRGBA    map[NL_TILE_LIGHTMAP_SIZE *NL_TILE_LIGHTMAP_SIZE]
 

return the id of the tile, locally in the texture.

nlassert() if no free tiles (use getNbAvailableTiles()). Tile coordinate in the texture can be get with: s= id% nbTilesByLine; t= id/ nbTilesByLine; where nbTilesByLine== sizeOfTextureNear/NL_TILE_LIGHTMAP_SIZE. The texture is invalidate (on this part only...)

Definition at line 70 of file texture_near.cpp.

References _AvailableTiles, _FreeTiles, getNbAvailableTiles, id, NL_TILE_LIGHTMAP_SIZE, nlassert, and refillRect.

NL3D::CTextureNear::NLMISC_DECLARE_CLASS CTextureNear   
 

void NL3D::CTextureNear::refillRect uint    id,
CRGBA    map[NL_TILE_LIGHTMAP_SIZE *NL_TILE_LIGHTMAP_SIZE]
 

given id of the tile, refill the texture.

The texture is invalidate (on this part only...)

Definition at line 85 of file texture_near.cpp.

References NLMISC::CBitmap::getPixels, NLMISC::CBitmap::getWidth, id, NL_TILE_LIGHTMAP_SIZE, s, src, and t.

Referenced by getTileAndFillRect.

void NL3D::CTextureNear::releaseTile uint    id
 

Set a tile lightmap as free for use. It is an error to free a not allocated tile. (nlassert!!).

Definition at line 107 of file texture_near.cpp.

References _AvailableTiles, _FreeTiles, id, and nlassert.

virtual void NL3D::CTextureNear::serial NLMISC::IStream   f throw (NLMISC::EStream) [inline, virtual]
 

serial ITexture basic infos (clamp ...).

Reimplemented from NL3D::ITexture.

Definition at line 89 of file texture_near.h.

References nlstop.


Member Data Documentation

std::vector<bool> NL3D::CTextureNear::_AvailableTiles [private]
 

For check, Availability of tiles.

Definition at line 96 of file texture_near.h.

Referenced by CTextureNear, getTileAndFillRect, and releaseTile.

std::vector<uint> NL3D::CTextureNear::_FreeTiles [private]
 

The list of available tiles.

Definition at line 94 of file texture_near.h.

Referenced by CTextureNear, getNbAvailableTiles, getTileAndFillRect, and releaseTile.


The documentation for this class was generated from the following files: