fixed drawpixel optimization

minor class refactoring
This commit is contained in:
2025-04-27 14:50:23 +02:00
parent abf948a310
commit da3afd22fc
5 changed files with 33 additions and 18 deletions

View File

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