pass by const ref and other fixes

pull/541/head
Nelsson Huotari 6 years ago
parent 20ab7df19f
commit 46ee639892

@ -56,8 +56,10 @@ void CSVRender::TerrainSelection::onlySelect(const std::vector<std::pair<int, in
void CSVRender::TerrainSelection::addSelect(const std::pair<int, int> localPos)
{
if (std::find(mSelection.begin(), mSelection.end(), localPos) == mSelection.end())
mSelection.emplace_back(localPos);
update();
{
mSelection.emplace_back(localPos);
update();
}
}
void CSVRender::TerrainSelection::toggleSelect(const std::vector<std::pair<int, int>> localPositions, bool toggleInProgress)
@ -115,7 +117,7 @@ void CSVRender::TerrainSelection::activate()
void CSVRender::TerrainSelection::deactivate()
{
if (mParentNode->containsNode(mSelectionNode)) mParentNode->removeChild(mSelectionNode);
mParentNode->removeChild(mSelectionNode);
}
void CSVRender::TerrainSelection::update()

@ -493,7 +493,7 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
}
}
void CSVRender::TerrainTextureMode::selectTerrainTextures(std::pair<int, int> texCoords, unsigned char selectMode, bool dragOperation)
void CSVRender::TerrainTextureMode::selectTerrainTextures(const std::pair<int, int>& texCoords, unsigned char selectMode, bool dragOperation)
{
int r = mBrushSize / 2;
std::vector<std::pair<int, int>> selections;

@ -6,8 +6,6 @@
#include <string>
#include <memory>
#include <osg/Group>
#include <QWidget>
#include <QEvent>
@ -23,6 +21,11 @@
#include "terrainselection.hpp"
namespace osg
{
class Group;
}
namespace CSVWidget
{
class SceneToolTextureBrush;
@ -82,7 +85,7 @@ namespace CSVRender
void editTerrainTextureGrid (const WorldspaceHitResult& hit);
/// \brief Handle brush mechanics for texture selection
void selectTerrainTextures (std::pair<int, int>, unsigned char, bool);
void selectTerrainTextures (const std::pair<int, int>& texCoords, unsigned char selectMode, bool dragOperation);
/// \brief Push texture edits to command macro
void pushEditToCommand (CSMWorld::LandTexturesColumn::DataType& newLandGrid, CSMDoc::Document& document,

Loading…
Cancel
Save