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:
Regalis
2016-11-30 21:09:11 +02:00
parent 42ff4a0d9a
commit a2442bfcb8
5 changed files with 61 additions and 41 deletions

View File

@@ -319,6 +319,11 @@ namespace Barotrauma
mapEntityList.Insert(i, this);
}
public virtual bool IsVisible(Rectangle worldView)
{
return true;
}
public virtual void Draw(SpriteBatch spriteBatch, bool editing, bool back=true) {}
public virtual void DrawDamage(SpriteBatch spriteBatch, Effect damageEffect) {}