summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <mana@crushnet.org>2010-03-04 21:27:16 +0100
committerPhilipp Sehmisch <mana@crushnet.org>2010-03-04 21:38:24 +0100
commitc176df1796a7b0fd53b52b52e8bd9d4a81ff8b1a (patch)
tree1b6a239f8fcc7f7834062e76ee2cdf125e9d426d /src/resources/mapreader.cpp
parent6e68568d9fb44762e4c3257b505e8b67ac1f70fe (diff)
downloadmana-c176df1796a7b0fd53b52b52e8bd9d4a81ff8b1a.tar.gz
mana-c176df1796a7b0fd53b52b52e8bd9d4a81ff8b1a.tar.bz2
mana-c176df1796a7b0fd53b52b52e8bd9d4a81ff8b1a.tar.xz
mana-c176df1796a7b0fd53b52b52e8bd9d4a81ff8b1a.zip
Implemented markers for warp portals defined in map files in form of particle effects. Reviewed-by: Jared Adams <jaxad0127@gmail.com>
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index e71ed5a6..d8678362 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -258,8 +258,9 @@ Map *MapReader::readMap(xmlNodePtr node, const std::string &path)
std::string objType = XML::getProperty(objectNode, "type", "");
objType = toUpper(objType);
- if (objType == "WARP" || objType == "NPC" ||
- objType == "SCRIPT" || objType == "SPAWN")
+ if (objType == "NPC" ||
+ objType == "SCRIPT" ||
+ objType == "SPAWN")
{
// Silently skip server-side objects.
continue;
@@ -268,6 +269,8 @@ Map *MapReader::readMap(xmlNodePtr node, const std::string &path)
const std::string objName = XML::getProperty(objectNode, "name", "");
const int objX = XML::getProperty(objectNode, "x", 0);
const int objY = XML::getProperty(objectNode, "y", 0);
+ const int objW = XML::getProperty(objectNode, "width", 0);
+ const int objH = XML::getProperty(objectNode, "height", 0);
logger->log("- Loading object name: %s type: %s at %d:%d",
objName.c_str(), objType.c_str(),
@@ -283,7 +286,13 @@ Map *MapReader::readMap(xmlNodePtr node, const std::string &path)
map->addParticleEffect(objName,
objX + offsetX,
- objY + offsetY);
+ objY + offsetY,
+ objW, objH);
+ }
+ else if (objType == "WARP")
+ {
+ map->addParticleEffect("graphics/particles/warparea.particle.xml",
+ objX, objY, objW, objH);
}
else
{