mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-11-08 10:09:16 +00:00
Remove unused heightmap clone
The clone of g_Map.height was only used to read its length, while all neighbor heights are read from g_Map itself. Cloning the whole heightmap on every iteration was therefore pure overhead.
This commit is contained in:
1 parent
6d77c4809d
commit
c8cf658d46
1 file changed
+2
-3
@@ -28,10 +28,9 @@ SmoothingPainter.prototype.paint = function(area)
|
||||
|
||||
for (let i = 0; i < this.iterations; ++i)
|
||||
{
|
||||
const heightmap = clone(g_Map.height);
|
||||
|
||||
// Additional complexity to process all 4 vertices of each tile, i.e the last row too
|
||||
const seen = new Array(heightmap.length).fill(0).map(zero => new Uint8Array(heightmap.length).fill(0));
|
||||
const vertexSize = g_Map.height.length;
|
||||
const seen = new Array(vertexSize).fill(0).map(zero => new Uint8Array(vertexSize).fill(0));
|
||||
|
||||
for (const point of area.getPoints())
|
||||
for (const tileVertex of g_TileVertices)
|
||||
|
||||
Reference in new issue
Block a user