mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 21:39:40 +00:00
Merge pull request #2597 from akortunov/coverity
CoverityScan fixes, part 2
This commit is contained in:
commit
454b9f1964
2 changed files with 8 additions and 8 deletions
|
@ -1439,8 +1439,12 @@ void CSVRender::TerrainShapeMode::setBrushShape(CSVWidget::BrushShape brushShape
|
||||||
selectionCenterY = selectionCenterY + value.second;
|
selectionCenterY = selectionCenterY + value.second;
|
||||||
++selectionAmount;
|
++selectionAmount;
|
||||||
}
|
}
|
||||||
selectionCenterX = selectionCenterX / selectionAmount;
|
|
||||||
selectionCenterY = selectionCenterY / selectionAmount;
|
if (selectionAmount != 0)
|
||||||
|
{
|
||||||
|
selectionCenterX /= selectionAmount;
|
||||||
|
selectionCenterY /= selectionAmount;
|
||||||
|
}
|
||||||
|
|
||||||
mCustomBrushShape.clear();
|
mCustomBrushShape.clear();
|
||||||
std::pair<int, int> differentialPos {};
|
std::pair<int, int> differentialPos {};
|
||||||
|
|
|
@ -527,9 +527,7 @@ void Water::createSimpleWaterStateSet(osg::Node* node, float alpha)
|
||||||
|
|
||||||
// Add animated textures
|
// Add animated textures
|
||||||
std::vector<osg::ref_ptr<osg::Texture2D> > textures;
|
std::vector<osg::ref_ptr<osg::Texture2D> > textures;
|
||||||
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
|
int frameCount = std::max(0, std::min(Fallback::Map::getInt("Water_SurfaceFrameCount"), 320));
|
||||||
frameCount = std::min(std::max(frameCount, 0), 320);
|
|
||||||
|
|
||||||
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
||||||
for (int i=0; i<frameCount; ++i)
|
for (int i=0; i<frameCount; ++i)
|
||||||
{
|
{
|
||||||
|
@ -645,9 +643,7 @@ Water::~Water()
|
||||||
|
|
||||||
void Water::listAssetsToPreload(std::vector<std::string> &textures)
|
void Water::listAssetsToPreload(std::vector<std::string> &textures)
|
||||||
{
|
{
|
||||||
int frameCount = Fallback::Map::getInt("Water_SurfaceFrameCount");
|
int frameCount = std::max(0, std::min(Fallback::Map::getInt("Water_SurfaceFrameCount"), 320));
|
||||||
frameCount = std::min(std::max(frameCount, 0), 320);
|
|
||||||
|
|
||||||
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
const std::string& texture = Fallback::Map::getString("Water_SurfaceTexture");
|
||||||
for (int i=0; i<frameCount; ++i)
|
for (int i=0; i<frameCount; ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue