summaryrefslogtreecommitdiff
path: root/src/resources/emotedb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-15 12:22:49 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-15 12:22:49 +0300
commita970bdd2d4d7e695f82f854c1efc81881dfebb30 (patch)
tree765948705d8cff6eef316e2dc862360985416ffb /src/resources/emotedb.cpp
parent6a396b89dba22004820fe1089705b2a182de8412 (diff)
downloadManaVerse-a970bdd2d4d7e695f82f854c1efc81881dfebb30.tar.gz
ManaVerse-a970bdd2d4d7e695f82f854c1efc81881dfebb30.tar.bz2
ManaVerse-a970bdd2d4d7e695f82f854c1efc81881dfebb30.tar.xz
ManaVerse-a970bdd2d4d7e695f82f854c1efc81881dfebb30.zip
improve emotedb file.
Diffstat (limited to 'src/resources/emotedb.cpp')
-rw-r--r--src/resources/emotedb.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp
index 8dc401716..9142b7c0e 100644
--- a/src/resources/emotedb.cpp
+++ b/src/resources/emotedb.cpp
@@ -90,10 +90,10 @@ void EmoteDB::load()
if (xmlNameEqual(spriteNode, "sprite"))
{
EmoteSprite *const currentSprite = new EmoteSprite;
- std::string file = paths.getStringValue("sprites")
- .append(std::string(reinterpret_cast<const char*>(
- spriteNode->xmlChildrenNode->content)));
- currentSprite->sprite = AnimatedSprite::load(file,
+ currentSprite->sprite = AnimatedSprite::load(
+ paths.getStringValue("sprites").append(std::string(
+ reinterpret_cast<const char*>(
+ spriteNode->xmlChildrenNode->content))),
XML::getProperty(spriteNode, "variant", 0));
currentSprite->name = XML::langProperty(
spriteNode, "name", "");
@@ -101,9 +101,8 @@ void EmoteDB::load()
}
else if (xmlNameEqual(spriteNode, "particlefx"))
{
- std::string particlefx = reinterpret_cast<const char*>(
- spriteNode->xmlChildrenNode->content);
- currentInfo->particles.push_back(particlefx);
+ currentInfo->particles.push_back(reinterpret_cast<const char*>(
+ spriteNode->xmlChildrenNode->content));
}
}
mEmoteInfos[id] = currentInfo;
@@ -146,20 +145,19 @@ void EmoteDB::load()
if (xmlNameEqual(spriteNode, "sprite"))
{
EmoteSprite *const currentSprite = new EmoteSprite;
- std::string file = paths.getStringValue("sprites")
- .append(std::string(reinterpret_cast<const char*>(
- spriteNode->xmlChildrenNode->content)));
- currentSprite->sprite = AnimatedSprite::load(file,
- XML::getProperty(spriteNode, "variant", 0));
+ currentSprite->sprite = AnimatedSprite::load(
+ paths.getStringValue("sprites").append(std::string(
+ reinterpret_cast<const char*>(
+ spriteNode->xmlChildrenNode->content))),
+ XML::getProperty(spriteNode, "variant", 0));
currentSprite->name = XML::langProperty(
spriteNode, "name", "");
currentInfo->sprites.push_back(currentSprite);
}
else if (xmlNameEqual(spriteNode, "particlefx"))
{
- std::string particlefx = reinterpret_cast<const char*>(
- spriteNode->xmlChildrenNode->content);
- currentInfo->particles.push_back(particlefx);
+ currentInfo->particles.push_back(reinterpret_cast<const char*>(
+ spriteNode->xmlChildrenNode->content));
}
}
mEmoteInfos[id] = currentInfo;
@@ -237,7 +235,7 @@ const AnimatedSprite *EmoteDB::getAnimation2(int id, const bool allowNull)
return getAnimation(id, allowNull);
}
-AnimatedSprite *EmoteDB::getClone(int id, const bool allowNull)
+AnimatedSprite *EmoteDB::getClone(const int id, const bool allowNull)
{
const AnimatedSprite *const sprite = getAnimation2(id, allowNull);
if (sprite)