# 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::CTileBank Class Reference

This class manage tile texture. More...

#include <tile_bank.h>

List of all members.

Public Types

enum  TTileType { _128x128 = 0, _256x256, transition, undefined }

Public Methods

 CTileBank ()
sint getLandCount () const
const CTileLandgetLand (int landIndex) const
CTileLandgetLand (int landIndex)
sint getTileSetCount () const
const CTileSetgetTileSet (int tileIndex) const
CTileSetgetTileSet (int tileIndex)
sint getTileCount () const
const CTilegetTile (int tileIndex) const
CTilegetTile (int tileIndex)
sint addLand (const std::string &name)
void removeLand (sint landIndex)
sint addTileSet (const std::string &name)
void removeTileSet (sint landIndex)
void xchgTileset (sint first, sint second)
void clear ()
sint getNumBitmap (CTile::TBitmap bitmap) const
void computeXRef ()
void cleanUnusedData ()
void getTileXRef (int tile, int &tileSet, int &number, TTileType &type) const
 Return the xref for a tile. More...

uint getDisplacementMapCount () const
const char * getDisplacementMap (uint noiseMap)
void setDisplacementMap (uint noiseMap, const char *newName)
uint getDisplacementMap (const std::string &fileName)
void removeDisplacementMap (uint mapId)
void makeAllPathRelative ()
void makeAllExtensionDDS ()
 This method change ".tga" of texture filename, to ".dds". Do this only for Additive and Diffuse part (not alpha). More...

void setAbsPath (const std::string &newPath)
const std::string & getAbsPath () const
void serial (class NLMISC::IStream &f) throw (NLMISC::EStream)
Vegetable
CTileNoiseMapgetTileNoiseMap (uint tileNumber, uint tileSubNoise)
 Return the tilenoisemap pointer for this tile and subnoise tile. More...

const CTileVegetableDescgetTileVegetableDesc (uint tileNumber) const
 return the TileVegetable desc for this tile. More...

void loadTileVegetableDescs ()
 you should call this method, after serialising the TileBank, and before CLandscape::initTileBanks() You must call CLandscape::initTileBanks() after calling this method for each tileSet call CTileSet::loadTileVegetableDesc(). More...

void initTileVegetableDescs (CVegetableManager *vegetableManager)
 register all CVegetable to the Manager. More...


Private Methods

sint createTile ()
void freeTile (int tileIndex)

Private Attributes

std::vector< CTileLand_LandVector
std::vector< CTileSet_TileSetVector
std::vector< CTile_TileVector
std::vector< CTileXRef_TileXRef
std::vector< CTileNoise_DisplacementMap
std::string _AbsPath

Static Private Attributes

const sint _Version = 4

Friends

class CTileSet


Detailed Description

This class manage tile texture.

It can load banktile description file (*.bank), and then gives access to land infos.

Author:
Cyril Corvazier , Nevrax France
Date:
2000

Definition at line 494 of file tile_bank.h.


Member Enumeration Documentation

enum NL3D::CTileBank::TTileType
 

Enumeration values:
_128x128 
_256x256 
transition 
undefined 

Definition at line 498 of file tile_bank.h.

Referenced by getTileXRef.


Constructor & Destructor Documentation

NL3D::CTileBank::CTileBank  
 

Definition at line 90 of file tile_bank.cpp.

References _DisplacementMap.


Member Function Documentation

sint NL3D::CTileBank::addLand const std::string &    name
 

Definition at line 172 of file tile_bank.cpp.

References _LandVector.

sint NL3D::CTileBank::addTileSet const std::string &    name
 

Definition at line 189 of file tile_bank.cpp.

References _TileSetVector, createTile, and CTileSet.

void NL3D::CTileBank::cleanUnusedData  
 

Definition at line 426 of file tile_bank.cpp.

References _LandVector, and _TileSetVector.

void NL3D::CTileBank::clear  
 

Definition at line 216 of file tile_bank.cpp.

References _LandVector, _TileSetVector, and _TileVector.

void NL3D::CTileBank::computeXRef  
 

Definition at line 285 of file tile_bank.cpp.

References _128x128, _256x256, _TileSetVector, _TileVector, _TileXRef, CTileSet, getTileSet, index, s, t, and transition.

sint NL3D::CTileBank::createTile   [private]
 

Definition at line 223 of file tile_bank.cpp.

References _TileVector.

Referenced by addTileSet.

void NL3D::CTileBank::freeTile int    tileIndex [private]
 

Definition at line 245 of file tile_bank.cpp.

References _TileVector, and nlassert.

Referenced by removeTileSet.

const std::string& NL3D::CTileBank::getAbsPath   const [inline]
 

Definition at line 619 of file tile_bank.h.

References _AbsPath.

Referenced by getTileNoiseMap.

uint NL3D::CTileBank::getDisplacementMap const std::string &    fileName
 

const char * NL3D::CTileBank::getDisplacementMap uint    noiseMap
 

Definition at line 616 of file tile_bank.cpp.

References _DisplacementMap.

uint NL3D::CTileBank::getDisplacementMapCount   const
 

Definition at line 626 of file tile_bank.cpp.

References _DisplacementMap.

CTileLand* NL3D::CTileBank::getLand int    landIndex [inline]
 

Definition at line 512 of file tile_bank.h.

References _LandVector.

const CTileLand* NL3D::CTileBank::getLand int    landIndex const [inline]
 

Definition at line 508 of file tile_bank.h.

References _LandVector.

sint NL3D::CTileBank::getLandCount   const [inline]
 

Definition at line 504 of file tile_bank.h.

References _LandVector.

sint NL3D::CTileBank::getNumBitmap CTile::TBitmap    bitmap const
 

Definition at line 265 of file tile_bank.cpp.

References _TileVector, and NLMISC::strlwr.

CTile* NL3D::CTileBank::getTile int    tileIndex [inline]
 

Definition at line 536 of file tile_bank.h.

References _TileVector.

const CTile* NL3D::CTileBank::getTile int    tileIndex const [inline]
 

Definition at line 532 of file tile_bank.h.

References _TileVector.

sint NL3D::CTileBank::getTileCount   const [inline]
 

Definition at line 528 of file tile_bank.h.

References _TileVector.

CTileNoiseMap * NL3D::CTileBank::getTileNoiseMap uint    tileNumber,
uint    tileSubNoise
 

Return the tilenoisemap pointer for this tile and subnoise tile.

Definition at line 439 of file tile_bank.cpp.

References _DisplacementMap, _TileSetVector, _TileVector, _TileXRef, getAbsPath, NL3D_TILE_NOISE_MAP_SIZE, nlassert, and nlwarning.

CTileSet* NL3D::CTileBank::getTileSet int    tileIndex [inline]
 

Definition at line 524 of file tile_bank.h.

References _TileSetVector, and CTileSet.

const CTileSet* NL3D::CTileBank::getTileSet int    tileIndex const [inline]
 

Definition at line 520 of file tile_bank.h.

References _TileSetVector, and CTileSet.

Referenced by computeXRef.

sint NL3D::CTileBank::getTileSetCount   const [inline]
 

Definition at line 516 of file tile_bank.h.

References _TileSetVector.

const CTileVegetableDesc & NL3D::CTileBank::getTileVegetableDesc uint    tileNumber const
 

return the TileVegetable desc for this tile.

Definition at line 633 of file tile_bank.cpp.

References _TileSetVector, _TileVector, and _TileXRef.

void NL3D::CTileBank::getTileXRef int    tile,
int &    tileSet,
int &    number,
TTileType   type
const [inline]
 

Return the xref for a tile.

Parameters:
tile  is the tile number.
tileSet  will receive the tile set number in which the tile is. -1 if the tile is not used.
number  will receive the number of the tile in the tileset.
type  is the type of tile.

Definition at line 560 of file tile_bank.h.

References _TileXRef, nlassert, TTileType, and type.

void NL3D::CTileBank::initTileVegetableDescs CVegetableManager   vegetableManager
 

register all CVegetable to the Manager.

called by CLandscape::initTileBanks()

Definition at line 670 of file tile_bank.cpp.

References _TileSetVector.

void NL3D::CTileBank::loadTileVegetableDescs  
 

you should call this method, after serialising the TileBank, and before CLandscape::initTileBanks() You must call CLandscape::initTileBanks() after calling this method for each tileSet call CTileSet::loadTileVegetableDesc().

Definition at line 656 of file tile_bank.cpp.

References _TileSetVector.

void NL3D::CTileBank::makeAllExtensionDDS  
 

This method change ".tga" of texture filename, to ".dds". Do this only for Additive and Diffuse part (not alpha).

Definition at line 387 of file tile_bank.cpp.

References _TileVector.

void NL3D::CTileBank::makeAllPathRelative  
 

Definition at line 352 of file tile_bank.cpp.

References _DisplacementMap, _TileVector, and NL3D::TroncFileName.

void NL3D::CTileBank::removeDisplacementMap uint    mapId
 

Definition at line 543 of file tile_bank.cpp.

References _DisplacementMap, _TileSetVector, and nlassert.

void NL3D::CTileBank::removeLand sint    landIndex
 

Definition at line 180 of file tile_bank.cpp.

References _LandVector, and nlassert.

void NL3D::CTileBank::removeTileSet sint    landIndex
 

Definition at line 201 of file tile_bank.cpp.

References _TileSetVector, freeTile, index, and nlassert.

void NL3D::CTileBank::serial class NLMISC::IStream   f throw (NLMISC::EStream)
 

Definition at line 99 of file tile_bank.cpp.

References nlassert, and type.

void NL3D::CTileBank::setAbsPath const std::string &    newPath [inline]
 

Definition at line 615 of file tile_bank.h.

References _AbsPath.

void NL3D::CTileBank::setDisplacementMap uint    noiseMap,
const char *    newName
 

Definition at line 621 of file tile_bank.cpp.

References _DisplacementMap.

void NL3D::CTileBank::xchgTileset sint    first,
sint    second
 

Definition at line 323 of file tile_bank.cpp.

References _TileSetVector, CTileSet, and nlassert.


Friends And Related Function Documentation

friend class CTileSet [friend]
 

Definition at line 496 of file tile_bank.h.

Referenced by addTileSet, computeXRef, getTileSet, and xchgTileset.


Member Data Documentation

std::string NL3D::CTileBank::_AbsPath [private]
 

Definition at line 650 of file tile_bank.h.

Referenced by getAbsPath, and setAbsPath.

std::vector<CTileNoise> NL3D::CTileBank::_DisplacementMap [private]
 

Definition at line 649 of file tile_bank.h.

Referenced by CTileBank, getDisplacementMap, getDisplacementMapCount, getTileNoiseMap, makeAllPathRelative, removeDisplacementMap, and setDisplacementMap.

std::vector<CTileLand> NL3D::CTileBank::_LandVector [private]
 

Definition at line 645 of file tile_bank.h.

Referenced by addLand, cleanUnusedData, clear, getLand, getLandCount, and removeLand.

std::vector<CTileSet> NL3D::CTileBank::_TileSetVector [private]
 

Definition at line 646 of file tile_bank.h.

Referenced by addTileSet, cleanUnusedData, clear, computeXRef, getTileNoiseMap, getTileSet, getTileSetCount, getTileVegetableDesc, initTileVegetableDescs, loadTileVegetableDescs, removeDisplacementMap, removeTileSet, and xchgTileset.

std::vector<CTile> NL3D::CTileBank::_TileVector [private]
 

Definition at line 647 of file tile_bank.h.

Referenced by clear, computeXRef, createTile, freeTile, getNumBitmap, getTile, getTileCount, getTileNoiseMap, getTileVegetableDesc, makeAllExtensionDDS, and makeAllPathRelative.

std::vector<CTileXRef> NL3D::CTileBank::_TileXRef [private]
 

Definition at line 648 of file tile_bank.h.

Referenced by computeXRef, getTileNoiseMap, getTileVegetableDesc, and getTileXRef.

const sint NL3D::CTileBank::_Version = 4 [static, private]
 

Definition at line 88 of file tile_bank.cpp.


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