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

This class is a tile set. More...

#include <tile_bank.h>

List of all members.

Public Types

enum  TError {
  ok = 0, topInterfaceProblem, bottomInterfaceProblem, leftInterfaceProblem,
  rightInterfaceProblem, addFirstA128128, topBottomNotTheSame, rightLeftNotTheSame,
  sizeInvalide, errorCount
}
enum  TTransition { first = 0, last = 47, count = 48, notfound = -1 }
enum  TDisplacement { FirstDisplace = 0, LastDisplace = 15, CountDisplace = 16 }
enum  TBorder {
  top = 0, bottom, left, right,
  borderCount
}
enum  TFlagBorder {
  _1111 = 0, _0111, _1110, _0001,
  _1000, _0000, dontcare = -1
}

Public Methods

 CTileSet ()
void addTile128 (int &indexInTileSet, CTileBank &bank)
void addTile256 (int &indexInTileSet, CTileBank &bank)
void removeTile128 (int indexInTileSet, CTileBank &bank)
void removeTile256 (int indexInTileSet, CTileBank &bank)
void clearTile128 (int indexInTileSet, CTile::TBitmap type, CTileBank &bank)
void clearTile256 (int indexInTileSet, CTile::TBitmap type, CTileBank &bank)
void clearTransition (TTransition transition, CTile::TBitmap type, CTileBank &bank)
void clearDisplacement (TDisplacement displacement, CTileBank &bank)
void setName (const std::string &name)
void setOriented (bool oriented)
void setTile128 (int indexInTileSet, const std::string &name, CTile::TBitmap type, CTileBank &bank)
void setTile256 (int indexInTileSet, const std::string &name, CTile::TBitmap type, CTileBank &bank)
void setTileTransition (TTransition transition, const std::string &name, CTile::TBitmap type, CTileBank &bank, const CTileBorder &border)
void setTileTransitionAlpha (TTransition transition, const std::string &name, CTileBank &bank, const CTileBorder &border, uint8 rotAlpha)
void setBorder (CTile::TBitmap type, const CTileBorder &border)
void setDisplacement (TDisplacement displacement, const std::string &fileName, CTileBank &bank)
void setTileVegetableDescFileName (const std::string &fileName)
void setTileVegetableDesc (const CTileVegetableDesc &tvd)
void loadTileVegetableDesc ()
 try to load the vegetable tile desc associated with the fileName (nlinfo() if can't) lookup into CPath. More...

TError checkTile128 (CTile::TBitmap type, const CTileBorder &border, int &pixel, int &composante)
TError checkTile256 (CTile::TBitmap type, const CTileBorder &border, int &pixel, int &composante)
TError checkTileTransition (TTransition transition, CTile::TBitmap type, const CTileBorder &border, int &indexError, int &pixel, int &composante)
const std::string & getName () const
bool getOriented () const
sint getNumTile128 () const
sint getNumTile256 () const
sint32 getTile128 (sint index) const
sint32 getTile256 (sint index) const
CTileSetTransitiongetTransition (sint index)
const CTileSetTransitiongetTransition (sint index) const
const CTileBordergetBorder128 (CTile::TBitmap bitmapType) const
const CTileBordergetBorder256 (CTile::TBitmap bitmapType) const
const std::string & getTileVegetableDescFileName () const
uint getDisplacementTile (TDisplacement displacement) const
 Return the file name of the displacement map for the map n° displacement. More...

CTileVegetableDescgetTileVegetableDesc ()
 return the TileVegetable. More...

const CTileVegetableDescgetTileVegetableDesc () const
TTransition getExistingTransitionTile (TFlagBorder _top, TFlagBorder _bottom, TFlagBorder _left, TFlagBorder _right, int reject, CTile::TBitmap type)
void cleanUnusedData ()
void addChild (const std::string &name)
void removeChild (const std::string &name)
bool isChild (const std::string &name)
void serial (NLMISC::IStream &f) throw (NLMISC::EStream)

Static Public Methods

const char * getErrorMessage (TError error)
TTransition getTransitionTile (TFlagBorder top, TFlagBorder bottom, TFlagBorder left, TFlagBorder right)
TTransition getComplementaryTransition (TTransition transition)
TFlagBorder getInvertBorder (TFlagBorder border)
TFlagBorder getOrientedBorder (TBorder where, TFlagBorder border)
TFlagBorder getEdgeType (TTransition _what, TBorder _where)
TTransition rotateTransition (TTransition transition)

Public Attributes

uint32 SurfaceData

Private Methods

void deleteBordersIfLast (const CTileBank &bank, CTile::TBitmap type)

Static Private Methods

TFlagBorder getComplementaryBorder (TFlagBorder border)

Private Attributes

std::string _Name
bool _Oriented
std::vector< sint32_Tile128
std::vector< sint32_Tile256
CTileSetTransition _TileTransition [count]
std::set< std::string > _ChildName
CTileBorder _Border128 [2]
CTileBorder _Border256 [2]
CTileBorder _BorderTransition [count][CTile::bitmapCount]
uint32 _DisplacementBitmap [CTileSet::CountDisplace]
CTileVegetableDesc _TileVegetableDesc
std::string _TileVegetableDescFileName

Static Private Attributes

const sint _Version = 5
const char * _ErrorMessage [CTileSet::errorCount]
const TFlagBorder _TransitionFlags [count][4]

Friends

class CTileBank


Detailed Description

This class is a tile set.

It handles all the tile of the same material.

Author:
Cyril Corvazier , Nevrax France
Date:
2000

Definition at line 277 of file tile_bank.h.


Member Enumeration Documentation

enum NL3D::CTileSet::TBorder
 

Enumeration values:
top 
bottom 
left 
right 
borderCount 

Definition at line 287 of file tile_bank.h.

Referenced by getEdgeType.

enum NL3D::CTileSet::TDisplacement
 

Enumeration values:
FirstDisplace 
LastDisplace 
CountDisplace 

Definition at line 286 of file tile_bank.h.

Referenced by getDisplacementTile.

enum NL3D::CTileSet::TError
 

Enumeration values:
ok 
topInterfaceProblem 
bottomInterfaceProblem 
leftInterfaceProblem 
rightInterfaceProblem 
addFirstA128128 
topBottomNotTheSame 
rightLeftNotTheSame 
sizeInvalide 
errorCount 

Definition at line 282 of file tile_bank.h.

Referenced by getErrorMessage.

enum NL3D::CTileSet::TFlagBorder
 

Enumeration values:
_1111 
_0111 
_1110 
_0001 
_1000 
_0000 
dontcare 

Definition at line 288 of file tile_bank.h.

Referenced by checkTileTransition, and getEdgeType.

enum NL3D::CTileSet::TTransition
 

Enumeration values:
first 
last 
count 
notfound 

Definition at line 285 of file tile_bank.h.

Referenced by getComplementaryTransition, and getEdgeType.


Constructor & Destructor Documentation

NL3D::CTileSet::CTileSet  
 

Definition at line 834 of file tile_bank.cpp.

References _DisplacementBitmap, _Oriented, CountDisplace, FirstDisplace, and SurfaceData.


Member Function Documentation

void NL3D::CTileSet::addChild const std::string &    name
 

Definition at line 1242 of file tile_bank.cpp.

References _ChildName.

void NL3D::CTileSet::addTile128 int &    indexInTileSet,
CTileBank   bank
 

Definition at line 934 of file tile_bank.cpp.

References _Tile128, and index.

void NL3D::CTileSet::addTile256 int &    indexInTileSet,
CTileBank   bank
 

Definition at line 993 of file tile_bank.cpp.

References _Tile256, and index.

CTileSet::TError NL3D::CTileSet::checkTile128 CTile::TBitmap    type,
const CTileBorder   border,
int &    pixel,
int &    composante
 

Definition at line 962 of file tile_bank.cpp.

References _Border128, addFirstA128128, border, bottomInterfaceProblem, leftInterfaceProblem, ok, rightInterfaceProblem, rightLeftNotTheSame, sizeInvalide, topBottomNotTheSame, topInterfaceProblem, and type.

CTileSet::TError NL3D::CTileSet::checkTile256 CTile::TBitmap    type,
const CTileBorder   border,
int &    pixel,
int &    composante
 

Definition at line 1005 of file tile_bank.cpp.

References _Border128, _Border256, addFirstA128128, border, bottomInterfaceProblem, leftInterfaceProblem, ok, rightInterfaceProblem, rightLeftNotTheSame, sizeInvalide, topBottomNotTheSame, topInterfaceProblem, and type.

CTileSet::TError NL3D::CTileSet::checkTileTransition TTransition    transition,
CTile::TBitmap    type,
const CTileBorder   border,
int &    indexError,
int &    pixel,
int &    composante
 

Definition at line 1081 of file tile_bank.cpp.

References _1111, _BorderTransition, _TransitionFlags, border, bottom, bottomInterfaceProblem, count, dontcare, getExistingTransitionTile, left, leftInterfaceProblem, nlassert, ok, right, rightInterfaceProblem, TFlagBorder, top, topInterfaceProblem, and type.

void NL3D::CTileSet::cleanUnusedData  
 

Definition at line 1463 of file tile_bank.cpp.

References _Border128, _Border256, _BorderTransition, _ChildName, _Name, and count.

void NL3D::CTileSet::clearDisplacement TDisplacement    displacement,
CTileBank   bank
 

Definition at line 1434 of file tile_bank.cpp.

References _DisplacementBitmap, FirstDisplace, id, LastDisplace, and nlassert.

void NL3D::CTileSet::clearTile128 int    indexInTileSet,
CTile::TBitmap    type,
CTileBank   bank
 

Definition at line 1335 of file tile_bank.cpp.

References _Tile128, deleteBordersIfLast, and type.

void NL3D::CTileSet::clearTile256 int    indexInTileSet,
CTile::TBitmap    type,
CTileBank   bank
 

Definition at line 1344 of file tile_bank.cpp.

References _Tile256, deleteBordersIfLast, and type.

void NL3D::CTileSet::clearTransition TTransition    transition,
CTile::TBitmap    type,
CTileBank   bank
 

Definition at line 1353 of file tile_bank.cpp.

References _BorderTransition, _TileTransition, deleteBordersIfLast, and type.

void NL3D::CTileSet::deleteBordersIfLast const CTileBank   bank,
CTile::TBitmap    type
[private]
 

Definition at line 1365 of file tile_bank.cpp.

References _Border128, _Border256, _Tile128, _Tile256, _TileTransition, count, and type.

Referenced by clearTile128, clearTile256, clearTransition, removeTile128, and removeTile256.

const CTileBorder* NL3D::CTileSet::getBorder128 CTile::TBitmap    bitmapType const [inline]
 

Definition at line 361 of file tile_bank.h.

References _Border128.

const CTileBorder* NL3D::CTileSet::getBorder256 CTile::TBitmap    bitmapType const [inline]
 

Definition at line 365 of file tile_bank.h.

References _Border256.

CTileSet::TFlagBorder NL3D::CTileSet::getComplementaryBorder TFlagBorder    border [static, private]
 

Definition at line 1265 of file tile_bank.cpp.

References _0000, _0001, _0111, _1000, _1110, _1111, border, and nlassert.

Referenced by getComplementaryTransition.

CTileSet::TTransition NL3D::CTileSet::getComplementaryTransition TTransition    transition [static]
 

Definition at line 1252 of file tile_bank.cpp.

References _TransitionFlags, bottom, first, getComplementaryBorder, getTransitionTile, last, left, nlassert, notfound, right, top, and TTransition.

uint NL3D::CTileSet::getDisplacementTile TDisplacement    displacement const [inline]
 

Return the file name of the displacement map for the map n° displacement.

This file name is relative at the absolute path.

Definition at line 375 of file tile_bank.h.

References _DisplacementBitmap, FirstDisplace, LastDisplace, nlassert, and TDisplacement.

TFlagBorder NL3D::CTileSet::getEdgeType TTransition    _what,
TBorder    _where
[inline, static]
 

Definition at line 401 of file tile_bank.h.

References _TransitionFlags, TBorder, TFlagBorder, and TTransition.

const char* NL3D::CTileSet::getErrorMessage TError    error [inline, static]
 

Definition at line 391 of file tile_bank.h.

References _ErrorMessage, and TError.

CTileSet::TTransition NL3D::CTileSet::getExistingTransitionTile TFlagBorder    _top,
TFlagBorder    _bottom,
TFlagBorder    _left,
TFlagBorder    _right,
int    reject,
CTile::TBitmap    type
 

Definition at line 1225 of file tile_bank.cpp.

References _BorderTransition, _TransitionFlags, bottom, count, dontcare, first, left, notfound, right, top, and type.

Referenced by checkTileTransition.

CTileSet::TFlagBorder NL3D::CTileSet::getInvertBorder TFlagBorder    border [static]
 

Definition at line 1287 of file tile_bank.cpp.

References _0000, _0001, _0111, _1000, _1110, _1111, border, and nlassert.

Referenced by getOrientedBorder.

const std::string & NL3D::CTileSet::getName   const
 

Definition at line 851 of file tile_bank.cpp.

References _Name.

sint NL3D::CTileSet::getNumTile128   const [inline]
 

Definition at line 337 of file tile_bank.h.

References _Tile128.

sint NL3D::CTileSet::getNumTile256   const [inline]
 

Definition at line 341 of file tile_bank.h.

References _Tile256.

bool NL3D::CTileSet::getOriented   const [inline]
 

Definition at line 333 of file tile_bank.h.

References _Oriented.

CTileSet::TFlagBorder NL3D::CTileSet::getOrientedBorder TBorder    where,
TFlagBorder    border
[static]
 

Definition at line 1309 of file tile_bank.cpp.

References _0000, border, bottom, getInvertBorder, left, nlassert, right, and top.

Referenced by rotateTransition.

sint32 NL3D::CTileSet::getTile128 sint    index const [inline]
 

Definition at line 345 of file tile_bank.h.

References _Tile128, and index.

sint32 NL3D::CTileSet::getTile256 sint    index const [inline]
 

Definition at line 349 of file tile_bank.h.

References _Tile256, and index.

const CTileVegetableDesc & NL3D::CTileSet::getTileVegetableDesc   const
 

Definition at line 1500 of file tile_bank.cpp.

References _TileVegetableDesc.

CTileVegetableDesc & NL3D::CTileSet::getTileVegetableDesc  
 

return the TileVegetable.

Definition at line 1494 of file tile_bank.cpp.

References _TileVegetableDesc.

const std::string & NL3D::CTileSet::getTileVegetableDescFileName   const
 

Definition at line 1483 of file tile_bank.cpp.

References _TileVegetableDescFileName.

const CTileSetTransition* NL3D::CTileSet::getTransition sint    index const [inline]
 

Definition at line 357 of file tile_bank.h.

References _TileTransition, and index.

CTileSetTransition* NL3D::CTileSet::getTransition sint    index [inline]
 

Definition at line 353 of file tile_bank.h.

References _TileTransition, and index.

CTileSet::TTransition NL3D::CTileSet::getTransitionTile TFlagBorder    top,
TFlagBorder    bottom,
TFlagBorder    left,
TFlagBorder    right
[static]
 

Definition at line 1210 of file tile_bank.cpp.

References _TransitionFlags, bottom, count, dontcare, first, left, notfound, right, and top.

Referenced by getComplementaryTransition, and rotateTransition.

bool NL3D::CTileSet::isChild const std::string &    name [inline]
 

Definition at line 413 of file tile_bank.h.

References _ChildName.

void NL3D::CTileSet::loadTileVegetableDesc  
 

try to load the vegetable tile desc associated with the fileName (nlinfo() if can't) lookup into CPath.

no-op if string=="".

Definition at line 1506 of file tile_bank.cpp.

References _TileVegetableDesc, _TileVegetableDescFileName, and nlinfo.

void NL3D::CTileSet::removeChild const std::string &    name
 

Definition at line 1247 of file tile_bank.cpp.

References _ChildName.

void NL3D::CTileSet::removeTile128 int    indexInTileSet,
CTileBank   bank
 

Definition at line 1172 of file tile_bank.cpp.

References _Tile128, deleteBordersIfLast, index, and nlassert.

void NL3D::CTileSet::removeTile256 int    indexInTileSet,
CTileBank   bank
 

Definition at line 1191 of file tile_bank.cpp.

References _Tile256, deleteBordersIfLast, index, and nlassert.

CTileSet::TTransition NL3D::CTileSet::rotateTransition TTransition    transition [static]
 

Definition at line 1325 of file tile_bank.cpp.

References _TransitionFlags, bottom, getOrientedBorder, getTransitionTile, left, right, and top.

void NL3D::CTileSet::serial NLMISC::IStream   f throw (NLMISC::EStream)
 

Definition at line 856 of file tile_bank.cpp.

void NL3D::CTileSet::setBorder CTile::TBitmap    type,
const CTileBorder   border
 

Definition at line 946 of file tile_bank.cpp.

References _Border128, _Border256, border, and type.

void NL3D::CTileSet::setDisplacement TDisplacement    displacement,
const std::string &    fileName,
CTileBank   bank
 

Definition at line 1450 of file tile_bank.cpp.

References _DisplacementBitmap, FirstDisplace, LastDisplace, and nlassert.

void NL3D::CTileSet::setName const std::string &    name
 

Definition at line 846 of file tile_bank.cpp.

References _Name.

void NL3D::CTileSet::setOriented bool    oriented [inline]
 

Definition at line 309 of file tile_bank.h.

References _Oriented.

void NL3D::CTileSet::setTile128 int    indexInTileSet,
const std::string &    name,
CTile::TBitmap    type,
CTileBank   bank
 

Definition at line 954 of file tile_bank.cpp.

References _Tile128, and type.

void NL3D::CTileSet::setTile256 int    indexInTileSet,
const std::string &    name,
CTile::TBitmap    type,
CTileBank   bank
 

Definition at line 1044 of file tile_bank.cpp.

References _Tile256, and type.

void NL3D::CTileSet::setTileTransition TTransition    transition,
const std::string &    name,
CTile::TBitmap    type,
CTileBank   bank,
const CTileBorder   border
 

Definition at line 1052 of file tile_bank.cpp.

References _BorderTransition, _TileTransition, border, nlassert, and type.

void NL3D::CTileSet::setTileTransitionAlpha TTransition    transition,
const std::string &    name,
CTileBank   bank,
const CTileBorder   border,
uint8    rotAlpha
 

Definition at line 1066 of file tile_bank.cpp.

References _BorderTransition, _TileTransition, border, and nlassert.

void NL3D::CTileSet::setTileVegetableDesc const CTileVegetableDesc   tvd
 

Definition at line 1488 of file tile_bank.cpp.

References _TileVegetableDesc.

void NL3D::CTileSet::setTileVegetableDescFileName const std::string &    fileName
 

Definition at line 1478 of file tile_bank.cpp.

References _TileVegetableDescFileName.


Friends And Related Function Documentation

friend class CTileBank [friend]
 

Definition at line 279 of file tile_bank.h.


Member Data Documentation

CTileBorder NL3D::CTileSet::_Border128[2] [private]
 

Definition at line 431 of file tile_bank.h.

Referenced by checkTile128, checkTile256, cleanUnusedData, deleteBordersIfLast, getBorder128, and setBorder.

CTileBorder NL3D::CTileSet::_Border256[2] [private]
 

Definition at line 432 of file tile_bank.h.

Referenced by checkTile256, cleanUnusedData, deleteBordersIfLast, getBorder256, and setBorder.

CTileBorder NL3D::CTileSet::_BorderTransition[count][CTile::bitmapCount] [private]
 

Definition at line 433 of file tile_bank.h.

Referenced by checkTileTransition, cleanUnusedData, clearTransition, getExistingTransitionTile, setTileTransition, and setTileTransitionAlpha.

std::set<std::string> NL3D::CTileSet::_ChildName [private]
 

Definition at line 430 of file tile_bank.h.

Referenced by addChild, cleanUnusedData, isChild, and removeChild.

uint32 NL3D::CTileSet::_DisplacementBitmap[CTileSet::CountDisplace] [private]
 

Definition at line 434 of file tile_bank.h.

Referenced by clearDisplacement, CTileSet, getDisplacementTile, and setDisplacement.

const char * NL3D::CTileSet::_ErrorMessage [static, private]
 

Initial value:

{
        "No error.",                                                            
        "Top interface is incompatible.",                       
        "Bottom interface is incompatible.",            
        "Left interface is incompatible.",                      
        "Right interface is incompatible.",                     
        "Add first a 128x128 tile.",                            
        "Top and bottom interface not the same.",       
        "Right and left interface not the same.",       
        "Invalide bitmap size.",                                        
}

Definition at line 762 of file tile_bank.cpp.

Referenced by getErrorMessage.

std::string NL3D::CTileSet::_Name [private]
 

Definition at line 425 of file tile_bank.h.

Referenced by cleanUnusedData, getName, and setName.

bool NL3D::CTileSet::_Oriented [private]
 

Definition at line 426 of file tile_bank.h.

Referenced by CTileSet, getOriented, and setOriented.

std::vector<sint32> NL3D::CTileSet::_Tile128 [private]
 

Definition at line 427 of file tile_bank.h.

Referenced by addTile128, clearTile128, deleteBordersIfLast, getNumTile128, getTile128, removeTile128, and setTile128.

std::vector<sint32> NL3D::CTileSet::_Tile256 [private]
 

Definition at line 428 of file tile_bank.h.

Referenced by addTile256, clearTile256, deleteBordersIfLast, getNumTile256, getTile256, removeTile256, and setTile256.

CTileSetTransition NL3D::CTileSet::_TileTransition[count] [private]
 

Definition at line 429 of file tile_bank.h.

Referenced by clearTransition, deleteBordersIfLast, getTransition, setTileTransition, and setTileTransitionAlpha.

CTileVegetableDesc NL3D::CTileSet::_TileVegetableDesc [private]
 

Definition at line 436 of file tile_bank.h.

Referenced by getTileVegetableDesc, loadTileVegetableDesc, and setTileVegetableDesc.

std::string NL3D::CTileSet::_TileVegetableDescFileName [private]
 

Definition at line 437 of file tile_bank.h.

Referenced by getTileVegetableDescFileName, loadTileVegetableDesc, and setTileVegetableDescFileName.

const CTileSet::TFlagBorder NL3D::CTileSet::_TransitionFlags [static, private]
 

Definition at line 775 of file tile_bank.cpp.

Referenced by checkTileTransition, getComplementaryTransition, getEdgeType, getExistingTransitionTile, getTransitionTile, and rotateTransition.

const sint NL3D::CTileSet::_Version = 5 [static, private]
 

Definition at line 760 of file tile_bank.cpp.

uint32 NL3D::CTileSet::SurfaceData
 

Definition at line 442 of file tile_bank.h.

Referenced by CTileSet.


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