From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/resources/iteminfo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/resources/iteminfo.cpp') diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 5d96e382e..9fd4f2ba2 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -102,12 +102,12 @@ const std::string &ItemInfo::getSprite(const GenderT gender, { static const std::string empty; std::map::const_iterator i = - mAnimationFiles.find(static_cast(gender) + + mAnimationFiles.find(CAST_S32(gender) + toInt(race, int) * 4); if (i != mAnimationFiles.end()) return i->second; - i = mAnimationFiles.find(static_cast(gender)); + i = mAnimationFiles.find(CAST_S32(gender)); if (i != mAnimationFiles.end()) return i->second; return empty; @@ -162,7 +162,7 @@ const SoundInfo &ItemInfo::getSound(const ItemSoundEvent::Type event) const if (i == mSounds.end()) return empty; - return (!i->second.empty()) ? i->second[static_cast(rand()) + return (!i->second.empty()) ? i->second[CAST_U32(rand()) % i->second.size()] : empty; } @@ -275,7 +275,7 @@ const std::string ItemInfo::replaceColors(std::string str, str = replaceAll(str, "%color%", name); if (!name.empty()) - name[0] = static_cast(toupper(name[0])); + name[0] = CAST_S8(toupper(name[0])); return replaceAll(str, "%Color%", name); } @@ -397,7 +397,7 @@ void ItemInfo::setSprite(const std::string &animationFile, const GenderT gender, const int race) { - mAnimationFiles[static_cast(gender) + race * 4] = animationFile; + mAnimationFiles[CAST_S32(gender) + race * 4] = animationFile; } std::string ItemInfo::getColorName(const ItemColor idx) const -- cgit v1.2.3-60-g2f50