summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-19 01:11:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-19 01:11:52 +0300
commit0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b (patch)
tree4d03ab1e6b655bccafbad06e5cc3386a4f6480d7 /src/resources/db
parent29a93440367af32463f285ae5f0bd2aa23aadc92 (diff)
downloadplus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.tar.gz
plus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.tar.bz2
plus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.tar.xz
plus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.zip
Move itemsoundevent into separate file.
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/itemdb.cpp24
-rw-r--r--src/resources/db/monsterdb.cpp24
2 files changed, 28 insertions, 20 deletions
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index 234225fb0..c077f58fe 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -45,7 +45,7 @@ namespace
bool mConstructed = false;
StringVect mTagNames;
std::map<std::string, int> mTags;
- std::map<std::string, ItemSoundEvent> mSoundNames;
+ std::map<std::string, ItemSoundEvent::Type> mSoundNames;
} // namespace
extern int serverVersion;
@@ -184,16 +184,16 @@ static ItemType::Type itemTypeFromString(const std::string &name)
static void initStatic()
{
mConstructed = true;
- mSoundNames["hit"] = SOUND_EVENT_HIT;
- mSoundNames["strike"] = SOUND_EVENT_MISS;
- mSoundNames["miss"] = SOUND_EVENT_MISS;
- mSoundNames["use"] = SOUND_EVENT_USE;
- mSoundNames["equip"] = SOUND_EVENT_EQUIP;
- mSoundNames["unequip"] = SOUND_EVENT_UNEQUIP;
- mSoundNames["drop"] = SOUND_EVENT_DROP;
- mSoundNames["pickup"] = SOUND_EVENT_PICKUP;
- mSoundNames["take"] = SOUND_EVENT_TAKE;
- mSoundNames["put"] = SOUND_EVENT_PUT;
+ mSoundNames["hit"] = ItemSoundEvent::HIT;
+ mSoundNames["strike"] = ItemSoundEvent::MISS;
+ mSoundNames["miss"] = ItemSoundEvent::MISS;
+ mSoundNames["use"] = ItemSoundEvent::USE;
+ mSoundNames["equip"] = ItemSoundEvent::EQUIP;
+ mSoundNames["unequip"] = ItemSoundEvent::UNEQUIP;
+ mSoundNames["drop"] = ItemSoundEvent::DROP;
+ mSoundNames["pickup"] = ItemSoundEvent::PICKUP;
+ mSoundNames["take"] = ItemSoundEvent::TAKE;
+ mSoundNames["put"] = ItemSoundEvent::PUT;
}
void ItemDB::load()
@@ -763,7 +763,7 @@ void loadSoundRef(ItemInfo *const itemInfo, const XmlNodePtr node)
node->xmlChildrenNode->content);
const int delay = XML::getProperty(node, "delay", 0);
- const std::map<std::string, ItemSoundEvent>::const_iterator
+ const std::map<std::string, ItemSoundEvent::Type>::const_iterator
it = mSoundNames.find(event);
if (it != mSoundNames.end())
{
diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp
index ec68e5731..d29cac7e9 100644
--- a/src/resources/db/monsterdb.cpp
+++ b/src/resources/db/monsterdb.cpp
@@ -164,35 +164,43 @@ void MonsterDB::loadXmlFile(const std::string &fileName)
if (event == "hit")
{
- currentInfo->addSound(SOUND_EVENT_HIT, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::HIT,
+ filename, delay);
}
else if (event == "miss")
{
- currentInfo->addSound(SOUND_EVENT_MISS, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::MISS,
+ filename, delay);
}
else if (event == "hurt")
{
- currentInfo->addSound(SOUND_EVENT_HURT, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::HURT,
+ filename, delay);
}
else if (event == "die")
{
- currentInfo->addSound(SOUND_EVENT_DIE, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::DIE,
+ filename, delay);
}
else if (event == "move")
{
- currentInfo->addSound(SOUND_EVENT_MOVE, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::MOVE,
+ filename, delay);
}
else if (event == "sit")
{
- currentInfo->addSound(SOUND_EVENT_SIT, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::SIT,
+ filename, delay);
}
else if (event == "sittop")
{
- currentInfo->addSound(SOUND_EVENT_SITTOP, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::SITTOP,
+ filename, delay);
}
else if (event == "spawn")
{
- currentInfo->addSound(SOUND_EVENT_SPAWN, filename, delay);
+ currentInfo->addSound(ItemSoundEvent::SPAWN,
+ filename, delay);
}
else
{