fixed drawpixel optimization
minor class refactoring
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user