diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-18 14:45:29 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-18 14:45:29 -0400 |
| commit | 5c4c6284b385e55819bcbe396b8efd0d1c657c5f (patch) | |
| tree | 9735299873f869c1ca74082519d40d4985766394 /sigmod/Tile.cpp | |
| parent | 6d1422a0908042219ae03377b54585e27d3ff7a5 (diff) | |
| download | sigen-5c4c6284b385e55819bcbe396b8efd0d1c657c5f.tar.gz sigen-5c4c6284b385e55819bcbe396b8efd0d1c657c5f.tar.xz sigen-5c4c6284b385e55819bcbe396b8efd0d1c657c5f.zip | |
Add a preview sprite to Tile for the editor
Diffstat (limited to 'sigmod/Tile.cpp')
| -rw-r--r-- | sigmod/Tile.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sigmod/Tile.cpp b/sigmod/Tile.cpp index b478dbdf..84a6dc6d 100644 --- a/sigmod/Tile.cpp +++ b/sigmod/Tile.cpp @@ -39,7 +39,8 @@ Tile::Tile(const Game* parent, const int id) : Object(parent, id), m_name(""), m_walkable(true), - m_script("", "") + m_script("", ""), + m_preview(-1) { } @@ -70,6 +71,7 @@ void Tile::load(const QDomElement& xml) LOAD(name); LOAD(walkable); LOAD(script); + LOAD(preview); } QDomElement Tile::save() const @@ -78,20 +80,24 @@ QDomElement Tile::save() const SAVE(name); SAVE(walkable); SAVE(script); + SAVE(preview); return xml; } SETTER(Tile, QString&, Name, name) SETTER(Tile, bool, Walkable, walkable) SETTER(Tile, Script&, Script, script) +SETTER(Tile, int, Preview, preview) GETTER(Tile, QString, name) GETTER(Tile, bool, walkable) GETTER(Tile, Script, script) +GETTER(Tile, int, preview) CHECK(Tile, QString&, name) CHECK(Tile, bool, walkable) CHECK(Tile, Script&, script) +CHECK_INDEX(Tile, int, preview, game(), sprite) Tile& Tile::operator=(const Tile& rhs) { @@ -100,5 +106,6 @@ Tile& Tile::operator=(const Tile& rhs) COPY(name); COPY(walkable); COPY(script); + COPY(preview); return *this; } |
