|
|
@ -198,6 +198,7 @@ TileBank::TileBank()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_pvt = new TileBankPvt();
|
|
|
|
m_pvt = new TileBankPvt();
|
|
|
|
resetError();
|
|
|
|
resetError();
|
|
|
|
|
|
|
|
m_rotation = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TileBank::~TileBank()
|
|
|
|
TileBank::~TileBank()
|
|
|
@ -378,6 +379,16 @@ bool TileBank::setTile( int tileset, int tile, const QString &name, const QVaria
|
|
|
|
NL3D::CTileBorder border;
|
|
|
|
NL3D::CTileBorder border;
|
|
|
|
m_pvt->buildBorder( pm, border );
|
|
|
|
m_pvt->buildBorder( pm, border );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( ( type == TileConstants::TileTransition ) && ( channel == TileConstants::TileAlpha ) )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int rotBits = m_rotation;
|
|
|
|
|
|
|
|
while( rotBits > 0 )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
border.rotate();
|
|
|
|
|
|
|
|
rotBits--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QString msg;
|
|
|
|
QString msg;
|
|
|
|
NL3D::CTileSet::TError error = m_pvt->checkTile( set, tile, type, border, channelToTBitmap( channel ), msg );
|
|
|
|
NL3D::CTileSet::TError error = m_pvt->checkTile( set, tile, type, border, channelToTBitmap( channel ), msg );
|
|
|
|
|
|
|
|
|
|
|
@ -387,7 +398,7 @@ bool TileBank::setTile( int tileset, int tile, const QString &name, const QVaria
|
|
|
|
if( error == NL3D::CTileSet::addFirstA128128 )
|
|
|
|
if( error == NL3D::CTileSet::addFirstA128128 )
|
|
|
|
set->setBorder( channelToTBitmap( channel ), border );
|
|
|
|
set->setBorder( channelToTBitmap( channel ), border );
|
|
|
|
|
|
|
|
|
|
|
|
m_pvt->setTile( set, tile, 0 /* rotation */, name, channelToTBitmap( channel ), type, border );
|
|
|
|
m_pvt->setTile( set, tile, m_rotation, name, channelToTBitmap( channel ), type, border );
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -618,6 +629,11 @@ QString TileBank::getTexturePath() const
|
|
|
|
return m_pvt->m_bank.getAbsPath().c_str();
|
|
|
|
return m_pvt->m_bank.getAbsPath().c_str();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TileBank::setRotation( int rotation )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_rotation = rotation;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TileBank::serial( NLMISC::IStream &f )
|
|
|
|
void TileBank::serial( NLMISC::IStream &f )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_pvt->m_bank.serial( f );
|
|
|
|
m_pvt->m_bank.serial( f );
|
|
|
|