Texture path.

This commit is contained in:
dfighter1985 2014-08-04 21:59:05 +02:00
parent 716903fd5f
commit 1309834e49
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; 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 ); void setSurfaceData( int tileSet, unsigned long data );
unsigned long getSurfaceData( int tileSet ) const; unsigned long getSurfaceData( int tileSet ) const;
void setTexturePath( const QString &path );
QString getTexturePath() const;
bool hasError() const{ return m_hasError; } bool hasError() const{ return m_hasError; }
QString getLastError() const{ return m_lastError; } QString getLastError() const{ return m_lastError; }

View file

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

View file

@ -426,6 +426,16 @@ unsigned long TileModel::getSurfaceData( int tileSet ) const
return m_tileBank->getSurfaceData( tileSet ); 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{ QString TileModel::getLastError() const{
return m_tileBank->getLastError(); return m_tileBank->getLastError();
} }

View file

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