mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-17 21:11:39 +00:00
Saving tilebank
--HG-- branch : gsoc2014-dfighter
This commit is contained in:
parent
92e850d296
commit
8bead3f3fd
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();
|
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"
|
#include "tile_constants.h"
|
||||||
|
|
||||||
|
namespace NLMISC
|
||||||
|
{
|
||||||
|
class IStream;
|
||||||
|
}
|
||||||
|
|
||||||
class TileBankPvt;
|
class TileBankPvt;
|
||||||
|
|
||||||
class TileBank
|
class TileBank
|
||||||
|
@ -42,6 +47,8 @@ public:
|
||||||
void setTexturePath( const QString &path );
|
void setTexturePath( const QString &path );
|
||||||
QString getTexturePath() const;
|
QString getTexturePath() const;
|
||||||
|
|
||||||
|
void serial( NLMISC::IStream &f );
|
||||||
|
|
||||||
bool hasError() const{ return m_hasError; }
|
bool hasError() const{ return m_hasError; }
|
||||||
QString getLastError() const{ return m_lastError; }
|
QString getLastError() const{ return m_lastError; }
|
||||||
void resetError(){
|
void resetError(){
|
||||||
|
|
|
@ -250,8 +250,7 @@ void TileEditorMainWindow::saveAs( const QString &fn )
|
||||||
}
|
}
|
||||||
|
|
||||||
TileBankSaver saver;
|
TileBankSaver saver;
|
||||||
bool ok = true;
|
bool ok = saver.save( fn.toUtf8().constData(), m_tileModel );
|
||||||
//saver.save( fn.toUtf8().constData(), m_tileModel, m_lands );
|
|
||||||
|
|
||||||
if( !ok )
|
if( !ok )
|
||||||
{
|
{
|
||||||
|
|
|
@ -431,6 +431,11 @@ void TileModel::setTexturePath( const QString &path )
|
||||||
m_tileBank->setTexturePath( path );
|
m_tileBank->setTexturePath( path );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TileModel::serial( NLMISC::IStream &f )
|
||||||
|
{
|
||||||
|
m_tileBank->serial( f );
|
||||||
|
}
|
||||||
|
|
||||||
QString TileModel::getTexturePath() const
|
QString TileModel::getTexturePath() const
|
||||||
{
|
{
|
||||||
return m_tileBank->getTexturePath();
|
return m_tileBank->getTexturePath();
|
||||||
|
|
|
@ -23,6 +23,11 @@
|
||||||
|
|
||||||
#include "tile_constants.h"
|
#include "tile_constants.h"
|
||||||
|
|
||||||
|
namespace NLMISC
|
||||||
|
{
|
||||||
|
class IStream;
|
||||||
|
}
|
||||||
|
|
||||||
class Node;
|
class Node;
|
||||||
class TileSetNode;
|
class TileSetNode;
|
||||||
class TileItemNode;
|
class TileItemNode;
|
||||||
|
@ -107,6 +112,8 @@ public:
|
||||||
void setTexturePath( const QString &path );
|
void setTexturePath( const QString &path );
|
||||||
QString getTexturePath() const;
|
QString getTexturePath() const;
|
||||||
|
|
||||||
|
void serial( NLMISC::IStream &f );
|
||||||
|
|
||||||
QString getLastError() const;
|
QString getLastError() const;
|
||||||
bool hasError() const;
|
bool hasError() const;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ TileBankSaver::~TileBankSaver()
|
||||||
p = NULL;
|
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
|
// Save to file
|
||||||
NLMISC::COFile f;
|
NLMISC::COFile f;
|
||||||
|
@ -47,7 +47,7 @@ bool TileBankSaver::save( const char *fileName, const TileModel* model, const QL
|
||||||
if( !b )
|
if( !b )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//p->bank.serial( f );
|
model->serial( f );
|
||||||
|
|
||||||
f.flush();
|
f.flush();
|
||||||
f.close();
|
f.close();
|
||||||
|
|
|
@ -20,10 +20,8 @@
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include "land.h"
|
|
||||||
|
|
||||||
class TileModel;
|
class TileModel;
|
||||||
|
|
||||||
class TileBankSaverPvt;
|
class TileBankSaverPvt;
|
||||||
|
|
||||||
class TileBankSaver
|
class TileBankSaver
|
||||||
|
@ -32,7 +30,7 @@ public:
|
||||||
TileBankSaver();
|
TileBankSaver();
|
||||||
~TileBankSaver();
|
~TileBankSaver();
|
||||||
|
|
||||||
bool save( const char *filename, const TileModel* model, const QList< Land > &lands );
|
bool save( const char *filename, TileModel* model );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TileBankSaverPvt *p;
|
TileBankSaverPvt *p;
|
||||||
|
|
Loading…
Reference in a new issue