mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-25 17:59:24 +01:00
only render visible layers
This commit is contained in:
parent
36b7a16e24
commit
17a5b3ec74
1 changed files with 4 additions and 2 deletions
|
@ -58,8 +58,10 @@ namespace MLEM.Extended.Tiled {
|
|||
}
|
||||
|
||||
public void Draw(SpriteBatch batch, RectangleF? frustum = null, DrawDelegate drawFunction = null) {
|
||||
for (var i = 0; i < this.map.TileLayers.Count; i++)
|
||||
this.DrawLayer(batch, i, frustum, drawFunction);
|
||||
for (var i = 0; i < this.map.TileLayers.Count; i++) {
|
||||
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) {
|
||||
|
|
Loading…
Reference in a new issue