NL3D::CTileFarBank Class Reference

#include <tile_far_bank.h>


Detailed Description

A bank for the far textures
Author:
Cyril Corvazier

Nevrax France

Date:
2000

Definition at line 55 of file tile_far_bank.h.

Public Types

enum  TFarOrder { order0 = 0, order1 = 1, order2 = 2, orderCount }
enum  TFarType { diffuse = 0, additive = 1, alpha = 2, typeCount = 2 }

Public Member Functions

 CTileFarBank ()
 Constructor.

sint getNumTile () const
 Get number of tile in this bank.

CTileFargetTile (sint tile)
 Get a far tile pointer. Return NULL if the tile doesn't exist.

const CTileFargetTile (sint tile) const
 Get a read only far tile pointer. Return NULL if the tile doesn't exist.

void serial (class NLMISC::IStream &f) throw (NLMISC::EStream)
 Serial this bank.

void setNumTile (sint numTile)
 Resize the tile bank.


Static Public Member Functions

uint getFarTileEdgeSize (TFarOrder order)
 Get the tile size.


Data Fields

std::vector< CTileFar_TileVector
 The far tile vector.


Static Public Attributes

const sint _Version = 0x0
 The version of this class.


Member Enumeration Documentation

enum NL3D::CTileFarBank::TFarOrder
 

Enumeration values:
order0 
order1 
order2 
orderCount 

Definition at line 59 of file tile_far_bank.h.

00059 { order0=0, order1=1, order2=2, orderCount };

enum NL3D::CTileFarBank::TFarType
 

Enumeration values:
diffuse 
additive 
alpha 
typeCount 

Definition at line 60 of file tile_far_bank.h.

00060 { diffuse=0, additive=1, alpha=2, typeCount=2 };


Constructor & Destructor Documentation

NL3D::CTileFarBank::CTileFarBank  ) 
 

Constructor.

Definition at line 106 of file tile_far_bank.cpp.

00107 {
00108 }


Member Function Documentation

uint NL3D::CTileFarBank::getFarTileEdgeSize TFarOrder  order  )  [inline, static]
 

Get the tile size.

Definition at line 155 of file tile_far_bank.h.

References uint.

00156         {
00157                 return 4>>(uint)order;
00158         }

sint NL3D::CTileFarBank::getNumTile  )  const [inline]
 

Get number of tile in this bank.

Definition at line 117 of file tile_far_bank.h.

References sint.

Referenced by NL3D::CLandscape::initTileBanks().

00118         {
00119                 return (sint)_TileVector.size();
00120         }

CTileFar* NL3D::CTileFarBank::getTile sint  tile  )  [inline]
 

Get a far tile pointer. Return NULL if the tile doesn't exist.

Definition at line 142 of file tile_far_bank.h.

References sint.

00143         {
00144 #ifdef NL_DEBUG
00145                 if (tile>=(sint)_TileVector.size())
00146                         return NULL;
00147 #else // NL_DEBUG
00148                 if (_TileVector.begin()+tile>=_TileVector.end())
00149                         return NULL;
00150 #endif
00151                 return &_TileVector[tile];
00152         }

const CTileFar* NL3D::CTileFarBank::getTile sint  tile  )  const [inline]
 

Get a read only far tile pointer. Return NULL if the tile doesn't exist.

Definition at line 129 of file tile_far_bank.h.

References sint.

Referenced by NL3D::CPatchDLMContext::computeTextureFar(), NL3D::CLandscape::eraseTileFarIfNotGood(), and NL3D::CTextureFar::rebuildPatch().

00130         {
00131 #ifdef NL_DEBUG
00132                 if (tile>=(sint)_TileVector.size())
00133                         return NULL;
00134 #else // NL_DEBUG
00135                 if (_TileVector.begin()+tile>=_TileVector.end())
00136                         return NULL;
00137 #endif
00138                 return &_TileVector[tile];
00139         }

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

Serial this bank.

Definition at line 113 of file tile_far_bank.cpp.

References uint32.

Referenced by NL3D::CLandscapeUser::loadBankFiles().

00114 {
00115         // Write/Check "FAR_BANK" in header of the stream
00116         f.serialCheck ((uint32)'_RAF');
00117         f.serialCheck ((uint32)'KNAB');
00118 
00119         // Serial version
00120         (void)f.serialVersion(_Version);
00121 
00122         // Serial tiles
00123         f.serialCont (_TileVector);
00124 }

void NL3D::CTileFarBank::setNumTile sint  numTile  )  [inline]
 

Resize the tile bank.

Definition at line 123 of file tile_far_bank.h.

References sint.

00124         {
00125                 _TileVector.resize(numTile);
00126         }


Field Documentation

std::vector<CTileFar> NL3D::CTileFarBank::_TileVector
 

The far tile vector.

Definition at line 164 of file tile_far_bank.h.

const sint NL3D::CTileFarBank::_Version = 0x0 [static]
 

The version of this class.

Definition at line 111 of file tile_far_bank.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 08:04:40 2004 for NeL by doxygen 1.3.6