1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-29 22:20:33 +00:00

Do not copy QVectors twice

This commit is contained in:
Andrei Kortunov 2023-08-01 15:45:18 +04:00
parent c86eecb2ea
commit 0723b44a65

View File

@ -368,10 +368,9 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
if (mBrushShape == CSVWidget::BrushShape_Point)
{
CSMWorld::LandTexturesColumn::DataType newTerrainPointer
CSMWorld::LandTexturesColumn::DataType newTerrain
= landTable.data(landTable.getModelIndex(mCellId, textureColumn))
.value<CSMWorld::LandTexturesColumn::DataType>();
CSMWorld::LandTexturesColumn::DataType newTerrain(newTerrainPointer);
if (allowLandTextureEditing(mCellId))
{
@ -403,10 +402,9 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
iteratedCellId = CSMWorld::CellCoordinates::generateId(i_cell, j_cell);
if (allowLandTextureEditing(iteratedCellId))
{
CSMWorld::LandTexturesColumn::DataType newTerrainPointer
CSMWorld::LandTexturesColumn::DataType newTerrain
= landTable.data(landTable.getModelIndex(iteratedCellId, textureColumn))
.value<CSMWorld::LandTexturesColumn::DataType>();
CSMWorld::LandTexturesColumn::DataType newTerrain(newTerrainPointer);
for (int i = 0; i < landTextureSize; i++)
{
for (int j = 0; j < landTextureSize; j++)
@ -467,10 +465,9 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
iteratedCellId = CSMWorld::CellCoordinates::generateId(i_cell, j_cell);
if (allowLandTextureEditing(iteratedCellId))
{
CSMWorld::LandTexturesColumn::DataType newTerrainPointer
CSMWorld::LandTexturesColumn::DataType newTerrain
= landTable.data(landTable.getModelIndex(iteratedCellId, textureColumn))
.value<CSMWorld::LandTexturesColumn::DataType>();
CSMWorld::LandTexturesColumn::DataType newTerrain(newTerrainPointer);
for (int i = 0; i < landTextureSize; i++)
{
for (int j = 0; j < landTextureSize; j++)
@ -516,10 +513,9 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
if (mBrushShape == CSVWidget::BrushShape_Custom)
{
CSMWorld::LandTexturesColumn::DataType newTerrainPointer
CSMWorld::LandTexturesColumn::DataType newTerrain
= landTable.data(landTable.getModelIndex(mCellId, textureColumn))
.value<CSMWorld::LandTexturesColumn::DataType>();
CSMWorld::LandTexturesColumn::DataType newTerrain(newTerrainPointer);
if (allowLandTextureEditing(mCellId) && !mCustomBrushShape.empty())
{
@ -541,10 +537,9 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
= CSMWorld::CellCoordinates::generateId(cellX + cellXDifference, cellY + cellYDifference);
if (allowLandTextureEditing(cellId))
{
CSMWorld::LandTexturesColumn::DataType newTerrainPointerOtherCell
CSMWorld::LandTexturesColumn::DataType newTerrainOtherCell
= landTable.data(landTable.getModelIndex(cellId, textureColumn))
.value<CSMWorld::LandTexturesColumn::DataType>();
CSMWorld::LandTexturesColumn::DataType newTerrainOtherCell(newTerrainPointerOtherCell);
newTerrainOtherCell[yInOtherCell * landTextureSize + xInOtherCell] = brushInt;
pushEditToCommand(newTerrainOtherCell, document, landTable, cellId);
}