1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 16:45:33 +00:00

Merge pull request #2763 from akortunov/warnfix

Fix int/float conversions in the CSVRender::BrushDraw
This commit is contained in:
Andrei Kortunov 2020-04-07 13:57:43 +04:00 committed by GitHub
commit d92af43696
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,8 +21,9 @@ CSVRender::BrushDraw::BrushDraw(osg::ref_ptr<osg::Group> parentNode, bool textur
mBrushDrawNode->addChild(mGeometry); mBrushDrawNode->addChild(mGeometry);
mParentNode->addChild(mBrushDrawNode); mParentNode->addChild(mBrushDrawNode);
if (mTextureMode) if (mTextureMode)
mLandSizeFactor = ESM::Land::REAL_SIZE / ESM::Land::LAND_TEXTURE_SIZE; mLandSizeFactor = static_cast<float>(ESM::Land::REAL_SIZE) / static_cast<float>(ESM::Land::LAND_TEXTURE_SIZE);
else mLandSizeFactor = ESM::Land::REAL_SIZE / ESM::Land::LAND_SIZE; else
mLandSizeFactor = static_cast<float>(ESM::Land::REAL_SIZE) / static_cast<float>(ESM::Land::LAND_SIZE);
} }
CSVRender::BrushDraw::~BrushDraw() CSVRender::BrushDraw::~BrushDraw()
@ -121,7 +122,7 @@ void CSVRender::BrushDraw::buildSquareGeometry(const float& radius, const osg::V
const float brushOutlineHeight (1.0f); const float brushOutlineHeight (1.0f);
float diameter = radius * 2; float diameter = radius * 2;
int resolution = (diameter / mLandSizeFactor) * 2; //half a vertex resolution int resolution = static_cast<int>(2.f * diameter / mLandSizeFactor); //half a vertex resolution
float resAdjustedLandSizeFactor = mLandSizeFactor / 2; float resAdjustedLandSizeFactor = mLandSizeFactor / 2;
osg::Vec4f lineColor(1.0f, 1.0f, 1.0f, 0.6f); osg::Vec4f lineColor(1.0f, 1.0f, 1.0f, 0.6f);