mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 18:09:39 +00:00
optimize isInCellSelection calls
This commit is contained in:
parent
45d43045eb
commit
120583f443
1 changed files with 10 additions and 3 deletions
|
@ -1047,9 +1047,16 @@ void CSVRender::TerrainShapeMode::handleSelection(int globalSelectionX, int glob
|
||||||
int moduloY = globalSelectionY % (ESM::Land::LAND_SIZE - 1);
|
int moduloY = globalSelectionY % (ESM::Land::LAND_SIZE - 1);
|
||||||
bool xIsAtCellBorder = moduloX == 0;
|
bool xIsAtCellBorder = moduloX == 0;
|
||||||
bool yIsAtCellBorder = moduloY == 0;
|
bool yIsAtCellBorder = moduloY == 0;
|
||||||
if (isInCellSelection(globalSelectionX - 1, globalSelectionY) && xIsAtCellBorder && !yIsAtCellBorder) selections->emplace_back(globalSelectionX, globalSelectionY);
|
if (!xIsAtCellBorder && !yIsAtCellBorder)
|
||||||
if (isInCellSelection(globalSelectionX, globalSelectionY - 1) && !xIsAtCellBorder && yIsAtCellBorder) selections->emplace_back(globalSelectionX, globalSelectionY);
|
return;
|
||||||
if (isInCellSelection(globalSelectionX - 1, globalSelectionY - 1) && xIsAtCellBorder && yIsAtCellBorder) selections->emplace_back(globalSelectionX, globalSelectionY);
|
int selectionX = globalSelectionX;
|
||||||
|
int selectionY = globalSelectionY;
|
||||||
|
if (xIsAtCellBorder)
|
||||||
|
selectionX--;
|
||||||
|
if (yIsAtCellBorder)
|
||||||
|
selectionY--;
|
||||||
|
if (isInCellSelection(selectionX, selectionY))
|
||||||
|
selections->emplace_back(globalSelectionX, globalSelectionY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue