1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 12:58:33 +01:00

only render visible layers

This commit is contained in:
Ellpeck 2020-04-30 15:57:20 +02:00
parent 36b7a16e24
commit 17a5b3ec74

View file

@ -58,8 +58,10 @@ namespace MLEM.Extended.Tiled {
} }
public void Draw(SpriteBatch batch, RectangleF? frustum = null, DrawDelegate drawFunction = null) { public void Draw(SpriteBatch batch, RectangleF? frustum = null, DrawDelegate drawFunction = null) {
for (var i = 0; i < this.map.TileLayers.Count; i++) for (var i = 0; i < this.map.TileLayers.Count; i++) {
this.DrawLayer(batch, i, frustum, drawFunction); if (this.map.TileLayers[i].IsVisible)
this.DrawLayer(batch, i, frustum, drawFunction);
}
} }
public void DrawLayer(SpriteBatch batch, int layerIndex, RectangleF? frustum = null, DrawDelegate drawFunction = null) { public void DrawLayer(SpriteBatch batch, int layerIndex, RectangleF? frustum = null, DrawDelegate drawFunction = null) {