mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-22 08:58:43 +00:00
Saving tilebank
This commit is contained in:
parent
c4b770a7b6
commit
4bb8b3373e
7 changed files with 28 additions and 7 deletions
|
@ -459,4 +459,9 @@ QString TileBank::getTexturePath() const
|
|||
return m_pvt->m_bank.getAbsPath().c_str();
|
||||
}
|
||||
|
||||
void TileBank::serial( NLMISC::IStream &f )
|
||||
{
|
||||
m_pvt->m_bank.serial( f );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,11 @@
|
|||
|
||||
#include "tile_constants.h"
|
||||
|
||||
namespace NLMISC
|
||||
{
|
||||
class IStream;
|
||||
}
|
||||
|
||||
class TileBankPvt;
|
||||
|
||||
class TileBank
|
||||
|
@ -41,6 +46,8 @@ public:
|
|||
|
||||
void setTexturePath( const QString &path );
|
||||
QString getTexturePath() const;
|
||||
|
||||
void serial( NLMISC::IStream &f );
|
||||
|
||||
bool hasError() const{ return m_hasError; }
|
||||
QString getLastError() const{ return m_lastError; }
|
||||
|
|
|
@ -250,8 +250,7 @@ void TileEditorMainWindow::saveAs( const QString &fn )
|
|||
}
|
||||
|
||||
TileBankSaver saver;
|
||||
bool ok = true;
|
||||
//saver.save( fn.toUtf8().constData(), m_tileModel, m_lands );
|
||||
bool ok = saver.save( fn.toUtf8().constData(), m_tileModel );
|
||||
|
||||
if( !ok )
|
||||
{
|
||||
|
|
|
@ -431,6 +431,11 @@ void TileModel::setTexturePath( const QString &path )
|
|||
m_tileBank->setTexturePath( path );
|
||||
}
|
||||
|
||||
void TileModel::serial( NLMISC::IStream &f )
|
||||
{
|
||||
m_tileBank->serial( f );
|
||||
}
|
||||
|
||||
QString TileModel::getTexturePath() const
|
||||
{
|
||||
return m_tileBank->getTexturePath();
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
|
||||
#include "tile_constants.h"
|
||||
|
||||
namespace NLMISC
|
||||
{
|
||||
class IStream;
|
||||
}
|
||||
|
||||
class Node;
|
||||
class TileSetNode;
|
||||
class TileItemNode;
|
||||
|
@ -107,6 +112,8 @@ public:
|
|||
void setTexturePath( const QString &path );
|
||||
QString getTexturePath() const;
|
||||
|
||||
void serial( NLMISC::IStream &f );
|
||||
|
||||
QString getLastError() const;
|
||||
bool hasError() const;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ TileBankSaver::~TileBankSaver()
|
|||
p = NULL;
|
||||
}
|
||||
|
||||
bool TileBankSaver::save( const char *fileName, const TileModel* model, const QList< Land > &lands )
|
||||
bool TileBankSaver::save( const char *fileName, TileModel* model )
|
||||
{
|
||||
// Save to file
|
||||
NLMISC::COFile f;
|
||||
|
@ -47,7 +47,7 @@ bool TileBankSaver::save( const char *fileName, const TileModel* model, const QL
|
|||
if( !b )
|
||||
return false;
|
||||
|
||||
//p->bank.serial( f );
|
||||
model->serial( f );
|
||||
|
||||
f.flush();
|
||||
f.close();
|
||||
|
|
|
@ -20,10 +20,8 @@
|
|||
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include "land.h"
|
||||
|
||||
class TileModel;
|
||||
|
||||
class TileBankSaverPvt;
|
||||
|
||||
class TileBankSaver
|
||||
|
@ -32,7 +30,7 @@ public:
|
|||
TileBankSaver();
|
||||
~TileBankSaver();
|
||||
|
||||
bool save( const char *filename, const TileModel* model, const QList< Land > &lands );
|
||||
bool save( const char *filename, TileModel* model );
|
||||
|
||||
private:
|
||||
TileBankSaverPvt *p;
|
||||
|
|
Loading…
Reference in a new issue