fixed unnecessary write to texture if no changes happened
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user