# 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>

Collaboration diagram for NL3D::CTileSet:

Collaboration graph
[legend]
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

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)
void setName (const std::string& name)
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)
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)
bool isDisplacement (TDisplacement displacement)
const std::string& getName () 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 std::string& getDisplacementFileName (TDisplacement displacement)
 Return the file name of the displacement map for the map n° displacement. More...

TTransition getExistingTransitionTile (TFlagBorder _top, TFlagBorder _bottom, TFlagBorder _left, TFlagBorder _right, int reject, CTile::TBitmap type)
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)

Private Methods

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

Private Attributes

std::string _Name
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]
std::string _DisplacementFileName [CTileSet::CountDisplace]

Static Private Methods

TFlagBorder getComplementaryBorder (TFlagBorder border)

Static Private Attributes

const sint _Version = 1
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(s):
Cyril Corvazier , Nevrax France
Date:
2000

Definition at line 272 of file tile_bank.h.


Member Enumeration Documentation

enum NL3D::CTileSet::TBorder
 

Enumeration values:
top  
bottom  
left  
right  
borderCount  

Definition at line 281 of file tile_bank.h.

enum NL3D::CTileSet::TDisplacement
 

Enumeration values:
FirstDisplace  
LastDisplace  
CountDisplace  

Definition at line 280 of file tile_bank.h.

enum NL3D::CTileSet::TError
 

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

Definition at line 276 of file tile_bank.h.

enum NL3D::CTileSet::TFlagBorder
 

Enumeration values:
_1111  
_0111  
_1110  
_0001  
_1000  
_0000  
dontcare  

Definition at line 282 of file tile_bank.h.

enum NL3D::CTileSet::TTransition
 

Enumeration values:
first  
last  
count  
notfound  

Definition at line 279 of file tile_bank.h.


Member Function Documentation

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

Definition at line 921 of file tile_bank.cpp.

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

Definition at line 613 of file tile_bank.cpp.

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

Definition at line 672 of file tile_bank.cpp.

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

Definition at line 641 of file tile_bank.cpp.

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

Definition at line 684 of file tile_bank.cpp.

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

Definition at line 760 of file tile_bank.cpp.

void NL3D::CTileSet::clearDisplacement ( TDisplacement displacement )
 

Definition at line 1113 of file tile_bank.cpp.

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

Definition at line 1014 of file tile_bank.cpp.

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

Definition at line 1023 of file tile_bank.cpp.

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

Definition at line 1032 of file tile_bank.cpp.

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

Definition at line 1044 of file tile_bank.cpp.

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

Definition at line 944 of file tile_bank.cpp.

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

Definition at line 931 of file tile_bank.cpp.

const std::string & NL3D::CTileSet::getDisplacementFileName ( TDisplacement displacement ) [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 355 of file tile_bank.h.

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

Definition at line 376 of file tile_bank.h.

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

Definition at line 366 of file tile_bank.h.

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

Definition at line 904 of file tile_bank.cpp.

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

Definition at line 966 of file tile_bank.cpp.

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

Definition at line 553 of file tile_bank.cpp.

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

Definition at line 326 of file tile_bank.h.

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

Definition at line 330 of file tile_bank.h.

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

Definition at line 988 of file tile_bank.cpp.

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

Definition at line 334 of file tile_bank.h.

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

Definition at line 338 of file tile_bank.h.

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

Definition at line 346 of file tile_bank.h.

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

Definition at line 342 of file tile_bank.h.

CTileSet::TTransition NL3D::CTileSet::getTransitionTile ( TFlagBorder _top,
TFlagBorder _bottom,
TFlagBorder _left,
TFlagBorder _right ) [static]
 

Definition at line 889 of file tile_bank.cpp.

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

Definition at line 385 of file tile_bank.h.

bool NL3D::CTileSet::isDisplacement ( TDisplacement displacement ) [inline]
 

Definition at line 314 of file tile_bank.h.

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

Definition at line 926 of file tile_bank.cpp.

void NL3D::CTileSet::removeTile128 ( int indexInTileSet,
CTileBank & bank )
 

Definition at line 851 of file tile_bank.cpp.

void NL3D::CTileSet::removeTile256 ( int indexInTileSet,
CTileBank & bank )
 

Definition at line 870 of file tile_bank.cpp.

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

Definition at line 1004 of file tile_bank.cpp.

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

Definition at line 558 of file tile_bank.cpp.

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

Definition at line 625 of file tile_bank.cpp.

void NL3D::CTileSet::setDisplacement ( TDisplacement displacement,
const std::string & fileName )
 

Definition at line 1123 of file tile_bank.cpp.

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

Definition at line 548 of file tile_bank.cpp.

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

Definition at line 633 of file tile_bank.cpp.

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

Definition at line 723 of file tile_bank.cpp.

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

Definition at line 731 of file tile_bank.cpp.

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

Definition at line 745 of file tile_bank.cpp.


Friends And Related Function Documentation

class CTileBank [friend]
 

Definition at line 274 of file tile_bank.h.


Member Data Documentation

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

Definition at line 402 of file tile_bank.h.

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

Definition at line 403 of file tile_bank.h.

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

Definition at line 404 of file tile_bank.h.

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

Definition at line 401 of file tile_bank.h.

std::string NL3D::CTileSet::_DisplacementFileName[CTileSet::CountDisplace] [private]
 

Definition at line 405 of file tile_bank.h.

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

Initializer:

{
        "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 476 of file tile_bank.cpp.

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

Definition at line 397 of file tile_bank.h.

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

Definition at line 398 of file tile_bank.h.

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

Definition at line 399 of file tile_bank.h.

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

Definition at line 400 of file tile_bank.h.

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

Definition at line 489 of file tile_bank.cpp.

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

Definition at line 474 of file tile_bank.cpp.


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