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:
commit
d92af43696
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue