mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 15:41:13 -04:00
optimize isInCellSelection calls
This commit is contained in:
parent
45d43045eb
commit
120583f443
@ -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…
x
Reference in New Issue
Block a user