diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-10 18:58:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-10 18:58:54 +0300 |
commit | 793a119a7a36f9680dad108e75075c8c4bd4a0d0 (patch) | |
tree | f995b989135dda75bcd45d8214571b4b4ed4e871 /src/resources | |
parent | bad730dd0de24b2b17b91922c0c7f2b31b7b4d9b (diff) | |
download | plus-793a119a7a36f9680dad108e75075c8c4bd4a0d0.tar.gz plus-793a119a7a36f9680dad108e75075c8c4bd4a0d0.tar.bz2 plus-793a119a7a36f9680dad108e75075c8c4bd4a0d0.tar.xz plus-793a119a7a36f9680dad108e75075c8c4bd4a0d0.zip |
Replace all xmlNodePtr to XmlNodePtr.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/chardb.cpp | 4 | ||||
-rw-r--r-- | src/resources/chardb.h | 2 | ||||
-rw-r--r-- | src/resources/colordb.cpp | 4 | ||||
-rw-r--r-- | src/resources/emotedb.cpp | 2 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 22 | ||||
-rw-r--r-- | src/resources/mapdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 14 | ||||
-rw-r--r-- | src/resources/mapreader.h | 8 | ||||
-rw-r--r-- | src/resources/monsterdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/npcdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/specialdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/spritedef.cpp | 14 | ||||
-rw-r--r-- | src/resources/spritedef.h | 10 |
13 files changed, 44 insertions, 44 deletions
diff --git a/src/resources/chardb.cpp b/src/resources/chardb.cpp index 30408c239..4be2e2b04 100644 --- a/src/resources/chardb.cpp +++ b/src/resources/chardb.cpp @@ -44,7 +44,7 @@ void CharDB::load() unload(); XML::Document *doc = new XML::Document("charcreation.xml"); - xmlNodePtr root = doc->rootNode(); + XmlNodePtr root = doc->rootNode(); if (!root || !xmlStrEqual(root->name, BAD_CAST "chars")) { @@ -76,7 +76,7 @@ void CharDB::load() mLoaded = true; } -void CharDB::loadMinMax(xmlNodePtr node, unsigned *min, unsigned *max) +void CharDB::loadMinMax(XmlNodePtr node, unsigned *min, unsigned *max) { *min = XML::getProperty(node, "min", 1); *max = XML::getProperty(node, "max", 10); diff --git a/src/resources/chardb.h b/src/resources/chardb.h index c668c1a73..60ff31084 100644 --- a/src/resources/chardb.h +++ b/src/resources/chardb.h @@ -42,7 +42,7 @@ namespace CharDB */ void unload(); - void loadMinMax(xmlNodePtr node, unsigned *min, unsigned *max); + void loadMinMax(XmlNodePtr node, unsigned *min, unsigned *max); unsigned getMinHairColor(); diff --git a/src/resources/colordb.cpp b/src/resources/colordb.cpp index 2a79f0554..cdbfbeba8 100644 --- a/src/resources/colordb.cpp +++ b/src/resources/colordb.cpp @@ -49,7 +49,7 @@ void ColorDB::load() void ColorDB::loadHair() { XML::Document *doc = new XML::Document("hair.xml"); - xmlNodePtr root = doc->rootNode(); + XmlNodePtr root = doc->rootNode(); bool hairXml = true; if (!root || !xmlStrEqual(root->name, BAD_CAST "colors")) @@ -97,7 +97,7 @@ void ColorDB::loadHair() void ColorDB::loadColorLists() { XML::Document *doc = new XML::Document("itemcolors.xml"); - xmlNodePtr root = doc->rootNode(); + XmlNodePtr root = doc->rootNode(); if (!root) { delete doc; diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index c456c49e4..163d8b879 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.cpp @@ -52,7 +52,7 @@ void EmoteDB::load() logger->log1("Initializing emote database..."); XML::Document doc("emotes.xml"); - xmlNodePtr rootNode = doc.rootNode(); + XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "emotes")) { diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 2c381286a..fcc20613d 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -47,11 +47,11 @@ namespace } // Forward declarations -static void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node); -static void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node); -static void loadFloorSprite(SpriteDisplay *display, xmlNodePtr node); -static void loadReplaceSprite(ItemInfo *itemInfo, xmlNodePtr replaceNode); -static void loadOrderSprite(ItemInfo *itemInfo, xmlNodePtr node, +static void loadSpriteRef(ItemInfo *itemInfo, XmlNodePtr node); +static void loadSoundRef(ItemInfo *itemInfo, XmlNodePtr node); +static void loadFloorSprite(SpriteDisplay *display, XmlNodePtr node); +static void loadReplaceSprite(ItemInfo *itemInfo, XmlNodePtr replaceNode); +static void loadOrderSprite(ItemInfo *itemInfo, XmlNodePtr node, bool drawAfter); static int parseSpriteName(std::string name); static int parseDirectionName(std::string name); @@ -172,7 +172,7 @@ void ItemDB::load() mUnknown->addTag(mTags["All"]); XML::Document doc("items.xml"); - xmlNodePtr rootNode = doc.rootNode(); + XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "items")) { @@ -593,7 +593,7 @@ int parseDirectionName(std::string name) return id; } -void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node) +void loadSpriteRef(ItemInfo *itemInfo, XmlNodePtr node) { std::string gender = XML::getProperty(node, "gender", "unisex"); std::string filename = reinterpret_cast<const char*>( @@ -605,7 +605,7 @@ void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node) itemInfo->setSprite(filename, GENDER_FEMALE); } -void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) +void loadSoundRef(ItemInfo *itemInfo, XmlNodePtr node) { std::string event = XML::getProperty(node, "event", ""); std::string filename = reinterpret_cast<const char*>( @@ -626,7 +626,7 @@ void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) } } -void loadFloorSprite(SpriteDisplay *display, xmlNodePtr floorNode) +void loadFloorSprite(SpriteDisplay *display, XmlNodePtr floorNode) { for_each_xml_child_node(spriteNode, floorNode) { @@ -648,7 +648,7 @@ void loadFloorSprite(SpriteDisplay *display, xmlNodePtr floorNode) } } -void loadReplaceSprite(ItemInfo *itemInfo, xmlNodePtr replaceNode) +void loadReplaceSprite(ItemInfo *itemInfo, XmlNodePtr replaceNode) { std::string removeSprite = XML::getProperty(replaceNode, "sprite", ""); int direction = parseDirectionName(XML::getProperty( @@ -766,7 +766,7 @@ void loadReplaceSprite(ItemInfo *itemInfo, xmlNodePtr replaceNode) } } -void loadOrderSprite(ItemInfo *itemInfo, xmlNodePtr node, bool drawAfter) +void loadOrderSprite(ItemInfo *itemInfo, XmlNodePtr node, bool drawAfter) { int sprite = parseSpriteName(XML::getProperty(node, "name", "")); int priority = XML::getProperty(node, "priority", 0); diff --git a/src/resources/mapdb.cpp b/src/resources/mapdb.cpp index 1da3dd908..aa10aff85 100644 --- a/src/resources/mapdb.cpp +++ b/src/resources/mapdb.cpp @@ -43,7 +43,7 @@ void MapDB::load() XML::Document *doc = new XML::Document( paths.getStringValue("maps") + "remap.xml"); - xmlNodePtr root = doc->rootNode(); + XmlNodePtr root = doc->rootNode(); if (!root) { delete doc; diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 8c8bf2f9d..aa7bce59d 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -222,7 +222,7 @@ Map *MapReader::readMap(const std::string &filename, XML::Document doc(reinterpret_cast<char*>(inflated), inflatedSize); free(inflated); - xmlNodePtr node = doc.rootNode(); + XmlNodePtr node = doc.rootNode(); // Parse the inflated map data if (node) @@ -247,7 +247,7 @@ Map *MapReader::readMap(const std::string &filename, return map; } -Map *MapReader::readMap(xmlNodePtr node, const std::string &path) +Map *MapReader::readMap(XmlNodePtr node, const std::string &path) { if (!node) return nullptr; @@ -379,7 +379,7 @@ Map *MapReader::readMap(xmlNodePtr node, const std::string &path) return map; } -void MapReader::readProperties(xmlNodePtr node, Properties *props) +void MapReader::readProperties(XmlNodePtr node, Properties *props) { if (!node || !props) return; @@ -442,7 +442,7 @@ inline static void setTile(Map *map, MapLayer *layer, int x, int y, int gid) } } -void MapReader::readLayer(xmlNodePtr node, Map *map) +void MapReader::readLayer(XmlNodePtr node, Map *map) { // Layers are not necessarily the same size as the map const int w = XML::getProperty(node, "width", map->getWidth()); @@ -491,7 +491,7 @@ void MapReader::readLayer(xmlNodePtr node, Map *map) } // Read base64 encoded map file - xmlNodePtr dataChild = childNode->xmlChildrenNode; + XmlNodePtr dataChild = childNode->xmlChildrenNode; if (!dataChild) continue; @@ -576,7 +576,7 @@ void MapReader::readLayer(xmlNodePtr node, Map *map) } else if (encoding == "csv") { - xmlNodePtr dataChild = childNode->xmlChildrenNode; + XmlNodePtr dataChild = childNode->xmlChildrenNode; if (!dataChild) continue; @@ -646,7 +646,7 @@ void MapReader::readLayer(xmlNodePtr node, Map *map) } -Tileset *MapReader::readTileset(xmlNodePtr node, const std::string &path, +Tileset *MapReader::readTileset(XmlNodePtr node, const std::string &path, Map *map) { if (!map) diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h index 8fc11e70f..c9c742ecd 100644 --- a/src/resources/mapreader.h +++ b/src/resources/mapreader.h @@ -47,7 +47,7 @@ class MapReader * Read an XML map from a parsed XML tree. The path is used to find the * location of referenced tileset images. */ - static Map *readMap(xmlNodePtr node, const std::string &path); + static Map *readMap(XmlNodePtr node, const std::string &path); private: /** @@ -57,17 +57,17 @@ class MapReader * @param props The Properties instance to which the properties will * be assigned. */ - static void readProperties(xmlNodePtr node, Properties* props); + static void readProperties(XmlNodePtr node, Properties* props); /** * Reads a map layer and adds it to the given map. */ - static void readLayer(xmlNodePtr node, Map *map); + static void readLayer(XmlNodePtr node, Map *map); /** * Reads a tile set. */ - static Tileset *readTileset(xmlNodePtr node, const std::string &path, + static Tileset *readTileset(XmlNodePtr node, const std::string &path, Map *map); }; diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index b994ea57f..e6901fa2f 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -52,7 +52,7 @@ void MonsterDB::load() logger->log1("Initializing monster database..."); XML::Document doc("monsters.xml"); - xmlNodePtr rootNode = doc.rootNode(); + XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "monsters")) { diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index 71834e2bc..b823620f0 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -46,7 +46,7 @@ void NPCDB::load() logger->log1("Initializing NPC database..."); XML::Document doc("npcs.xml"); - xmlNodePtr rootNode = doc.rootNode(); + XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "npcs")) { diff --git a/src/resources/specialdb.cpp b/src/resources/specialdb.cpp index e771c3738..eb4a81c9a 100644 --- a/src/resources/specialdb.cpp +++ b/src/resources/specialdb.cpp @@ -55,7 +55,7 @@ void SpecialDB::load() logger->log("Initializing special database..."); XML::Document doc("specials.xml"); - xmlNodePtr root = doc.rootNode(); + XmlNodePtr root = doc.rootNode(); if (!root || !xmlStrEqual(root->name, BAD_CAST "specials")) { diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index 40bdb64c8..7ff74ac18 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -81,7 +81,7 @@ SpriteDef *SpriteDef::load(const std::string &animationFile, int variant) palettes = animationFile.substr(pos + 1); XML::Document doc(animationFile.substr(0, pos)); - xmlNodePtr rootNode = doc.rootNode(); + XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "sprite")) { @@ -134,7 +134,7 @@ void SpriteDef::substituteActions() substituteAction(SpriteAction::SPAWN, SpriteAction::STAND); } -void SpriteDef::loadSprite(xmlNodePtr spriteNode, int variant, +void SpriteDef::loadSprite(XmlNodePtr spriteNode, int variant, const std::string &palettes) { // Get the variant @@ -158,7 +158,7 @@ void SpriteDef::loadSprite(xmlNodePtr spriteNode, int variant, } } -void SpriteDef::loadImageSet(xmlNodePtr node, const std::string &palettes) +void SpriteDef::loadImageSet(XmlNodePtr node, const std::string &palettes) { const std::string name = XML::getProperty(node, "name", ""); @@ -186,7 +186,7 @@ void SpriteDef::loadImageSet(xmlNodePtr node, const std::string &palettes) mImageSets[name] = imageSet; } -void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) +void SpriteDef::loadAction(XmlNodePtr node, int variant_offset) { const std::string actionName = XML::getProperty(node, "name", ""); const std::string imageSetName = XML::getProperty(node, "imageset", ""); @@ -228,7 +228,7 @@ void SpriteDef::loadAction(xmlNodePtr node, int variant_offset) } } -void SpriteDef::loadAnimation(xmlNodePtr animationNode, +void SpriteDef::loadAnimation(XmlNodePtr animationNode, Action *action, ImageSet *imageSet, int variant_offset) { @@ -346,7 +346,7 @@ void SpriteDef::loadAnimation(xmlNodePtr animationNode, } // for frameNode } -void SpriteDef::includeSprite(xmlNodePtr includeNode) +void SpriteDef::includeSprite(XmlNodePtr includeNode) { std::string filename = XML::getProperty(includeNode, "file", ""); @@ -363,7 +363,7 @@ void SpriteDef::includeSprite(xmlNodePtr includeNode) mProcessedFiles.insert(filename); XML::Document doc(filename); - xmlNodePtr rootNode = doc.rootNode(); + XmlNodePtr rootNode = doc.rootNode(); if (!rootNode || !xmlStrEqual(rootNode->name, BAD_CAST "sprite")) { diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 3f656be0d..0490bdcb3 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -145,30 +145,30 @@ class SpriteDef : public Resource /** * Loads a sprite element. */ - void loadSprite(xmlNodePtr spriteNode, int variant, + void loadSprite(XmlNodePtr spriteNode, int variant, const std::string &palettes = ""); /** * Loads an imageset element. */ - void loadImageSet(xmlNodePtr node, const std::string &palettes); + void loadImageSet(XmlNodePtr node, const std::string &palettes); /** * Loads an action element. */ - void loadAction(xmlNodePtr node, int variant_offset); + void loadAction(XmlNodePtr node, int variant_offset); /** * Loads an animation element. */ - void loadAnimation(xmlNodePtr animationNode, + void loadAnimation(XmlNodePtr animationNode, Action *action, ImageSet *imageSet, int variant_offset); /** * Include another sprite into this one. */ - void includeSprite(xmlNodePtr includeNode); + void includeSprite(XmlNodePtr includeNode); /** * Complete missing actions by copying existing ones. |