Add support for only rendering effects inside screen bounds

This commit is contained in:
Matthias Mailänder
2016-02-19 19:57:16 +01:00
committed by Paul Chote
parent 8ca43e3d6b
commit 1aebf9857c
5 changed files with 74 additions and 3 deletions

View File

@@ -51,10 +51,15 @@ namespace OpenRA.Primitives
MutateBins(item, itemBounds[item] = bounds, addItem);
}
public void Remove(T item)
public bool Remove(T item)
{
MutateBins(item, itemBounds[item], removeItem);
Rectangle bounds;
if (!itemBounds.TryGetValue(item, out bounds))
return false;
MutateBins(item, bounds, removeItem);
itemBounds.Remove(item);
return true;
}
Dictionary<T, Rectangle> BinAt(int row, int col)