mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +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,9 +58,11 @@ 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++) {
|
||||||
|
if (this.map.TileLayers[i].IsVisible)
|
||||||
this.DrawLayer(batch, i, frustum, drawFunction);
|
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) {
|
||||||
var frust = frustum ?? new RectangleF(0, 0, float.MaxValue, float.MaxValue);
|
var frust = frustum ?? new RectangleF(0, 0, float.MaxValue, float.MaxValue);
|
||||||
|
|
Loading…
Reference in a new issue