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:
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) {
|
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) {
|
||||||
|
|
Loading…
Reference in a new issue