Texture path.

This commit is contained in:
dfighter1985 2014-08-04 21:59:05 +02:00
parent a2065bf746
commit c4b770a7b6
5 changed files with 27 additions and 6 deletions

View file

@ -449,4 +449,14 @@ unsigned long TileBank::getSurfaceData( int tileSet ) const
return set->SurfaceData;
}
void TileBank::setTexturePath( const QString &path )
{
m_pvt->m_bank.setAbsPath( path.toUtf8().constData() );
}
QString TileBank::getTexturePath() const
{
return m_pvt->m_bank.getAbsPath().c_str();
}

View file

@ -38,6 +38,9 @@ public:
void setSurfaceData( int tileSet, unsigned long data );
unsigned long getSurfaceData( int tileSet ) const;
void setTexturePath( const QString &path );
QString getTexturePath() const;
bool hasError() const{ return m_hasError; }
QString getLastError() const{ return m_lastError; }

View file

@ -816,7 +816,7 @@ void TileEditorMainWindow::onTileBankLoaded()
m_ui->listView256->reset();
m_ui->listViewTransition->reset();
QString path = m_tileModel->texturePath();
QString path = m_tileModel->getTexturePath();
if( path.isEmpty() )
m_ui->tileBankTexturePathPB->setText( "..." );
else

View file

@ -426,6 +426,16 @@ unsigned long TileModel::getSurfaceData( int tileSet ) const
return m_tileBank->getSurfaceData( tileSet );
}
void TileModel::setTexturePath( const QString &path )
{
m_tileBank->setTexturePath( path );
}
QString TileModel::getTexturePath() const
{
return m_tileBank->getTexturePath();
}
QString TileModel::getLastError() const{
return m_tileBank->getLastError();
}

View file

@ -85,9 +85,6 @@ public:
void clear();
void setTexturePath( const QString &path ){ m_texturePath = path; }
QString texturePath() const{ return m_texturePath; }
void addLand( const QString &name );
void removeLand( int idx );
void removeTileSet( int idx );
@ -107,6 +104,9 @@ public:
void setSurfaceData( int tileSet, unsigned long data );
unsigned long getSurfaceData( int tileSet ) const;
void setTexturePath( const QString &path );
QString getTexturePath() const;
QString getLastError() const;
bool hasError() const;
@ -125,8 +125,6 @@ private:
//int m_activeEditChannel;
Node *rootItem;
QString m_texturePath;
TileBank *m_tileBank;
};