fixed unnecessary write to texture if no changes happened

This commit is contained in:
2025-04-27 13:49:35 +02:00
parent 572e02956c
commit 4ce265e722
2 changed files with 11 additions and 3 deletions

View File

@@ -157,9 +157,8 @@ public class Level {
for (int y = 0; y < chunkResY; y++) {
// TODO: multithreading here! use Chunk.DrawLevel() and stitch images together
Element e = chunks[cx, cy].Elements[x, y];
if (e.WasMoved())
image.SetPixel(cx*chunkResX + x, cy*chunkResY + y, e.Color);
if (chunks[cx, cy].Elements[x, y].WasMoved())
image.SetPixel(cx*chunkResX + x, cy*chunkResY + y, chunks[cx, cy].Elements[x, y].Color);
}
}
}