diff --git a/apps/opencs/view/render/terrainselection.cpp b/apps/opencs/view/render/terrainselection.cpp index ab94da354..359338c67 100644 --- a/apps/opencs/view/render/terrainselection.cpp +++ b/apps/opencs/view/render/terrainselection.cpp @@ -56,8 +56,10 @@ void CSVRender::TerrainSelection::onlySelect(const std::vector 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> 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() diff --git a/apps/opencs/view/render/terraintexturemode.cpp b/apps/opencs/view/render/terraintexturemode.cpp index 8218d6596..ad13e80be 100644 --- a/apps/opencs/view/render/terraintexturemode.cpp +++ b/apps/opencs/view/render/terraintexturemode.cpp @@ -493,7 +493,7 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe } } -void CSVRender::TerrainTextureMode::selectTerrainTextures(std::pair texCoords, unsigned char selectMode, bool dragOperation) +void CSVRender::TerrainTextureMode::selectTerrainTextures(const std::pair& texCoords, unsigned char selectMode, bool dragOperation) { int r = mBrushSize / 2; std::vector> selections; diff --git a/apps/opencs/view/render/terraintexturemode.hpp b/apps/opencs/view/render/terraintexturemode.hpp index 72e7df9de..d2ad99aaf 100644 --- a/apps/opencs/view/render/terraintexturemode.hpp +++ b/apps/opencs/view/render/terraintexturemode.hpp @@ -6,8 +6,6 @@ #include #include -#include - #include #include @@ -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, unsigned char, bool); + void selectTerrainTextures (const std::pair& texCoords, unsigned char selectMode, bool dragOperation); /// \brief Push texture edits to command macro void pushEditToCommand (CSMWorld::LandTexturesColumn::DataType& newLandGrid, CSMDoc::Document& document,