Simple MapEntity visibility culling (structures outside the camera view or items with nothing to render aren't drawn)
Could be optimized further, but already gives a pretty nice performance boost
This commit is contained in:
@@ -888,6 +888,11 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsVisible(Rectangle worldView)
|
||||
{
|
||||
return drawableComponents.Count > 0 || body == null || body.Enabled;
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch, bool editing, bool back = true)
|
||||
{
|
||||
if (!Visible) return;
|
||||
|
||||
Reference in New Issue
Block a user