1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 07:09:42 +00:00

Merge declaration and initialization

This commit is contained in:
Andrei Kortunov 2021-01-09 22:58:54 +04:00
parent 1930f8f37d
commit ad101de733

View file

@ -427,10 +427,8 @@ void CSVRender::TerrainTextureMode::editTerrainTextureGrid(const WorldspaceHitRe
{ {
if (i_cell == cellX && j_cell == cellY && abs(i-xHitInCell) < r && abs(j-yHitInCell) < r) if (i_cell == cellX && j_cell == cellY && abs(i-xHitInCell) < r && abs(j-yHitInCell) < r)
{ {
int distanceX(0); int distanceX = abs(i-xHitInCell);
int distanceY(0); int distanceY = abs(j-yHitInCell);
distanceX = abs(i-xHitInCell);
distanceY = abs(j-yHitInCell);
float distance = std::round(sqrt(pow(distanceX, 2)+pow(distanceY, 2))); float distance = std::round(sqrt(pow(distanceX, 2)+pow(distanceY, 2)));
float rf = static_cast<float>(mBrushSize) / 2; float rf = static_cast<float>(mBrushSize) / 2;
if (distance < rf) newTerrain[j*landTextureSize+i] = brushInt; if (distance < rf) newTerrain[j*landTextureSize+i] = brushInt;