summaryrefslogtreecommitdiffstats
path: root/sigmod/Tile.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-11-08 06:15:08 +0000
committerBen Boeckel <MathStuf@gmail.com>2008-11-08 06:15:08 +0000
commit8bad37e82371bd41864903ac0d6f49808ad119bf (patch)
tree77f0cb46059654cefb357d6eb4064c5740edf3d4 /sigmod/Tile.cpp
parentc127c0dae65a7600e0ab30b634f25d4915c61d16 (diff)
downloadsigen-8bad37e82371bd41864903ac0d6f49808ad119bf.tar.gz
sigen-8bad37e82371bd41864903ac0d6f49808ad119bf.tar.xz
sigen-8bad37e82371bd41864903ac0d6f49808ad119bf.zip
[FIX] No more asserts in sigmod
[FIX] Moved to using *ById instead of *Index methods in sigmod [FIX] Tilemaps are now collaged (not completely done on the editing side yet) [FIX] Removed the resource files (drawn natively instead) [FIX] ATBTimer now uses the built-in QTimer in a QObject [FIX] Coordinates are now edited on the map for warps, trainers, and effects [FIX] Tiles are now completely scripted [FIX] Config is now thread-safe git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@308 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'sigmod/Tile.cpp')
-rw-r--r--sigmod/Tile.cpp41
1 files changed, 2 insertions, 39 deletions
diff --git a/sigmod/Tile.cpp b/sigmod/Tile.cpp
index 56215332..3646dbd3 100644
--- a/sigmod/Tile.cpp
+++ b/sigmod/Tile.cpp
@@ -21,7 +21,6 @@
// Sigmod includes
#include "Macros.h"
#include "Sigmod.h"
-#include "Sprite.h"
Sigmod::Tile::Tile(const Tile& tile) :
Object(tile.parent(), tile.id())
@@ -32,24 +31,18 @@ Sigmod::Tile::Tile(const Tile& tile) :
Sigmod::Tile::Tile(const Sigmod* parent, const int id) :
Object(parent, id),
m_name(""),
- m_sprite(-1),
- m_from(D_Right - D_Up + 1),
m_script("", "")
{
- for (int i = 0; i < m_from.size(); ++i)
- m_from[i] = false;
}
Sigmod::Tile::Tile(const Tile& tile, const Sigmod* parent, const int id) :
- Object(parent, id),
- m_from(D_Right - D_Up + 1)
+ Object(parent, id)
{
*this = tile;
}
Sigmod::Tile::Tile(const QDomElement& xml, const Sigmod* parent, const int id) :
- Object(parent, id),
- m_from(D_Right - D_Up + 1)
+ Object(parent, id)
{
LOAD_ID();
load(xml);
@@ -60,7 +53,6 @@ void Sigmod::Tile::validate()
TEST_BEGIN();
if (m_name.isEmpty())
emit(error("Name is empty"));
- TEST(setSprite, sprite);
TEST_END();
}
@@ -68,8 +60,6 @@ void Sigmod::Tile::load(const QDomElement& xml)
{
LOAD_BEGIN();
LOAD(name);
- LOAD(sprite);
- LOAD_ARRAY(from);
LOAD(script);
}
@@ -77,8 +67,6 @@ QDomElement Sigmod::Tile::save() const
{
SAVE_CREATE();
SAVE(name);
- SAVE(sprite);
- SAVE_ARRAY(from);
SAVE(script);
return xml;
}
@@ -88,19 +76,6 @@ void Sigmod::Tile::setName(const QString& name)
CHECK(name);
}
-void Sigmod::Tile::setSprite(const int sprite)
-{
- if (qobject_cast<const Sigmod*>(sigmod())->spriteIndex(sprite) == INT_MAX)
- emit(error(bounds("sprite")));
- else
- CHECK(sprite);
-}
-
-void Sigmod::Tile::setFrom(const Direction direction, const bool state)
-{
- CHECK_ARRAY(from[direction], state);
-}
-
void Sigmod::Tile::setScript(const Sigcore::Script& script)
{
CHECK(script);
@@ -111,16 +86,6 @@ QString Sigmod::Tile::name() const
return m_name;
}
-int Sigmod::Tile::sprite() const
-{
- return m_sprite;
-}
-
-bool Sigmod::Tile::from(const Direction direction) const
-{
- return m_from[direction];
-}
-
Sigcore::Script Sigmod::Tile::script() const
{
return m_script;
@@ -131,8 +96,6 @@ Sigmod::Tile& Sigmod::Tile::operator=(const Tile& rhs)
if (this == &rhs)
return *this;
COPY(name);
- COPY(sprite);
- COPY(from);
COPY(script);
return *this;
}