mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 03:57:51 +03:00
fixing MSVC 2013 warning C4244: & C4305
conversion from 'const float' to 'int', possible loss of data conversion from 'double' to 'int', possible loss of data conversion from 'float' to 'int', possible loss of data
This commit is contained in:
parent
f2ac939e61
commit
e197f5318b
100 changed files with 457 additions and 474 deletions
|
@ -10,22 +10,22 @@ namespace ESM
|
|||
|
||||
Pathgrid::Point& Pathgrid::Point::operator=(const float rhs[3])
|
||||
{
|
||||
mX = rhs[0];
|
||||
mY = rhs[1];
|
||||
mZ = rhs[2];
|
||||
mX = static_cast<int>(rhs[0]);
|
||||
mY = static_cast<int>(rhs[1]);
|
||||
mZ = static_cast<int>(rhs[2]);
|
||||
mAutogenerated = 0;
|
||||
mConnectionNum = 0;
|
||||
mUnknown = 0;
|
||||
return *this;
|
||||
}
|
||||
Pathgrid::Point::Point(const float rhs[3])
|
||||
: mAutogenerated(0),
|
||||
: mX(static_cast<int>(rhs[0])),
|
||||
mY(static_cast<int>(rhs[1])),
|
||||
mZ(static_cast<int>(rhs[2])),
|
||||
mAutogenerated(0),
|
||||
mConnectionNum(0),
|
||||
mUnknown(0)
|
||||
{
|
||||
mX = rhs[0];
|
||||
mY = rhs[1];
|
||||
mZ = rhs[2];
|
||||
}
|
||||
Pathgrid::Point::Point():mX(0),mY(0),mZ(0),mAutogenerated(0),
|
||||
mConnectionNum(0),mUnknown(0)
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace ESM
|
|||
|
||||
int Race::MaleFemaleF::getValue (bool male) const
|
||||
{
|
||||
return male ? mMale : mFemale;
|
||||
return static_cast<int>(male ? mMale : mFemale);
|
||||
}
|
||||
|
||||
void Race::load(ESMReader &esm)
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace ESM
|
|||
// mDamage was changed to a float; ensure backwards compatibility
|
||||
T oldDamage = 0;
|
||||
esm.getHNOT(oldDamage, "STDA");
|
||||
mDamage = oldDamage;
|
||||
mDamage = static_cast<float>(oldDamage);
|
||||
|
||||
esm.getHNOT (mDamage, "STDF");
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ int ESM::VariantIntegerData::getInteger (bool default_) const
|
|||
|
||||
float ESM::VariantIntegerData::getFloat (bool default_) const
|
||||
{
|
||||
return mValue;
|
||||
return static_cast<float>(mValue);
|
||||
}
|
||||
|
||||
void ESM::VariantIntegerData::setInteger (int value)
|
||||
|
@ -202,7 +202,7 @@ void ESM::VariantIntegerData::write (ESMWriter& esm, Variant::Format format, Var
|
|||
{
|
||||
if (type==VT_Short || type==VT_Long)
|
||||
{
|
||||
float value = mValue;
|
||||
float value = static_cast<float>(mValue);
|
||||
esm.writeHNString ("FNAM", type==VT_Short ? "s" : "l");
|
||||
esm.writeHNT ("FLTV", value);
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ float ESM::VariantFloatData::getFloat (bool default_) const
|
|||
|
||||
void ESM::VariantFloatData::setInteger (int value)
|
||||
{
|
||||
mValue = value;
|
||||
mValue = static_cast<float>(value);
|
||||
}
|
||||
|
||||
void ESM::VariantFloatData::setFloat (float value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue