summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-07 16:18:13 +0300
commit9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch)
tree798117abd4dc7e610997d59d530a96ddc1509f53 /src/resources/iteminfo.cpp
parent4429cb14e9e187edef27aba692a4266733f79c17 (diff)
downloadmv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz
mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2
mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz
mv-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp10
1 files changed, 5 insertions, 5 deletions
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<int, std::string>::const_iterator i =
- mAnimationFiles.find(static_cast<int>(gender) +
+ mAnimationFiles.find(CAST_S32(gender) +
toInt(race, int) * 4);
if (i != mAnimationFiles.end())
return i->second;
- i = mAnimationFiles.find(static_cast<int>(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<unsigned int>(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<signed char>(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<int>(gender) + race * 4] = animationFile;
+ mAnimationFiles[CAST_S32(gender) + race * 4] = animationFile;
}
std::string ItemInfo::getColorName(const ItemColor idx) const