diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-18 17:48:29 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-18 17:49:00 +0200 |
commit | f98d003e354a1792117b7cbc771d1dd91475a156 (patch) | |
tree | dc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/resources/itemdb.cpp | |
parent | bb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff) | |
download | manaplus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz manaplus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2 manaplus-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz manaplus-f98d003e354a1792117b7cbc771d1dd91475a156.zip |
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/resources/itemdb.cpp')
-rw-r--r-- | src/resources/itemdb.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 4ba254cf3..c7515fc6b 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -510,22 +510,20 @@ int parseSpriteName(std::string &name) void loadSpriteRef(ItemInfo *itemInfo, xmlNodePtr node) { std::string gender = XML::getProperty(node, "gender", "unisex"); - std::string filename = (const char*) node->xmlChildrenNode->content; + std::string filename = reinterpret_cast<const char*>( + node->xmlChildrenNode->content); if (gender == "male" || gender == "unisex") - { itemInfo->setSprite(filename, GENDER_MALE); - } if (gender == "female" || gender == "unisex") - { itemInfo->setSprite(filename, GENDER_FEMALE); - } } void loadSoundRef(ItemInfo *itemInfo, xmlNodePtr node) { std::string event = XML::getProperty(node, "event", ""); - std::string filename = (const char*) node->xmlChildrenNode->content; + std::string filename = reinterpret_cast<const char*>( + node->xmlChildrenNode->content); if (event == "hit") { @@ -549,16 +547,16 @@ void loadFloorSprite(SpriteDisplay *display, xmlNodePtr floorNode) if (xmlStrEqual(spriteNode->name, BAD_CAST "sprite")) { SpriteReference *currentSprite = new SpriteReference; - currentSprite->sprite - = (const char*)spriteNode->xmlChildrenNode->content; + currentSprite->sprite = reinterpret_cast<const char*>( + spriteNode->xmlChildrenNode->content); currentSprite->variant = XML::getProperty(spriteNode, "variant", 0); display->sprites.push_back(currentSprite); } else if (xmlStrEqual(spriteNode->name, BAD_CAST "particlefx")) { - std::string particlefx - = (const char*)spriteNode->xmlChildrenNode->content; + std::string particlefx = reinterpret_cast<const char*>( + spriteNode->xmlChildrenNode->content); display->particles.push_back(particlefx); } } |