summaryrefslogtreecommitdiffstats
path: root/sigmod/MapWarp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sigmod/MapWarp.cpp')
-rw-r--r--sigmod/MapWarp.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/sigmod/MapWarp.cpp b/sigmod/MapWarp.cpp
index ac3906b1..b57edbd7 100644
--- a/sigmod/MapWarp.cpp
+++ b/sigmod/MapWarp.cpp
@@ -41,7 +41,7 @@ MapWarp::MapWarp(const MapWarp& warp) :
MapWarp::MapWarp(const Map* parent, const int id) :
Object(parent, id),
m_name(""),
- m_area(0, 0, 32, 32),
+ m_area(),
m_type(Door),
m_toMap(INT_MAX),
m_toWarp(INT_MAX),
@@ -67,7 +67,6 @@ void MapWarp::validate()
TEST_BEGIN();
if (m_name.isEmpty())
emit(error("Name is empty"));
- TEST(area);
TEST(toMap);
TEST(toWarp);
TEST_END();
@@ -97,27 +96,21 @@ QDomElement MapWarp::save() const
}
SETTER(MapWarp, QString&, Name, name)
-SETTER(MapWarp, QRect&, Area, area)
+SETTER(MapWarp, QPainterPath&, Area, area)
SETTER(MapWarp, Type, Type, type)
SETTER(MapWarp, int, ToMap, toMap)
SETTER(MapWarp, int, ToWarp, toWarp)
SETTER(MapWarp, Script&, Script, script)
GETTER(MapWarp, QString, name)
-GETTER(MapWarp, QRect, area)
+GETTER(MapWarp, QPainterPath, area)
GETTER(MapWarp, MapWarp::Type, type)
GETTER(MapWarp, int, toMap)
GETTER(MapWarp, int, toWarp)
GETTER(MapWarp, Script, script)
CHECK(MapWarp, QString&, name)
-CHECK_BEGIN(MapWarp, 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, 1, map->width() - area.x(), area.width())
- TBOUNDS_MOD(area_height, 1, map->height() - area.y(), area.height())
-CHECK_END()
+CHECK(MapWarp, QPainterPath&, area)
CHECK(MapWarp, Type, type)
CHECK_INDEX(MapWarp, int, toMap, game(), map)
CHECK_BEGIN(MapWarp, int, toWarp)