diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-19 18:02:23 -0400 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-19 18:02:23 -0400 |
| commit | b318d695fddbfaa71755cec4c7d85e9e9bdca8f2 (patch) | |
| tree | 887d32cc0e60babfc49cd1420bd19c12dc4a7070 /sigmod/MapEffect.cpp | |
| parent | 86f5c9c6b4a3b76dd89e032f241e27508eaadf77 (diff) | |
| download | sigen-b318d695fddbfaa71755cec4c7d85e9e9bdca8f2.tar.gz sigen-b318d695fddbfaa71755cec4c7d85e9e9bdca8f2.tar.xz sigen-b318d695fddbfaa71755cec4c7d85e9e9bdca8f2.zip | |
Use QPainterPath for Effects and Warps on maps
Diffstat (limited to 'sigmod/MapEffect.cpp')
| -rw-r--r-- | sigmod/MapEffect.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sigmod/MapEffect.cpp b/sigmod/MapEffect.cpp index 411a52e1..dff6a370 100644 --- a/sigmod/MapEffect.cpp +++ b/sigmod/MapEffect.cpp @@ -39,7 +39,7 @@ MapEffect::MapEffect(const MapEffect& effect) : MapEffect::MapEffect(const Map* parent, const int id) : Object(parent, id), m_name(""), - m_area(0, 0, 32, 32), + m_area(), m_skin(-1), m_isGhost(false), m_script("", "") @@ -64,8 +64,7 @@ void MapEffect::validate() TEST_BEGIN(); if (m_name.isEmpty()) emit(error("Name is empty")); - TEST(area); - if (m_area.height() || m_area.width()) + if (m_area.isEmpty()) TEST(skin); TEST_END(); } @@ -92,25 +91,19 @@ QDomElement MapEffect::save() const } SETTER(MapEffect, QString&, Name, name) -SETTER(MapEffect, QRect&, Area, area) +SETTER(MapEffect, QPainterPath&, Area, area) SETTER(MapEffect, int, Skin, skin) SETTER(MapEffect, bool, IsGhost, isGhost) SETTER(MapEffect, Script&, Script, script) GETTER(MapEffect, QString, name) -GETTER(MapEffect, QRect, area) +GETTER(MapEffect, QPainterPath, area) GETTER(MapEffect, int, skin) GETTER(MapEffect, bool, isGhost) GETTER(MapEffect, Script, script) CHECK(MapEffect, QString&, name) -CHECK_BEGIN(MapEffect, QRect&, area) - const Map* map = qobject_cast<const Map*>(parent()); - TBOUNDS_MOD(area_x, 0, map->width() - 1, area.x()) - TBOUNDS_MOD(area_y, 0, map->height() - 1, area.y()) - TBOUNDS_MOD(area_width, 0, map->width() - area.x(), area.width()) - TBOUNDS_MOD(area_height, 0, map->height() - area.y(), area.height()) -CHECK_END() +CHECK(MapEffect, QPainterPath&, area) CHECK_INDEX(MapEffect, int, skin, game(), skin) CHECK(MapEffect, bool, isGhost) CHECK(MapEffect, Script&, script) |
