Lazily generate buffer in Sheet.

The managed byte buffer is created on demand, meaning a newly allocated sheet will not waste memory holding onto the buffer until some changes are actually required to be written. This avoids a newly allocated sheet wasting memory on buffers that do not differ from their backing texture.
This commit is contained in:
RoosterDragon
2014-10-13 21:09:28 +01:00
committed by RoosterDragon
parent e6852e2b50
commit ff16690b86
7 changed files with 44 additions and 25 deletions

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Graphics
public static Sheet AllocateSheet()
{
return new Sheet(new Size(Renderer.SheetSize, Renderer.SheetSize), true);
return new Sheet(new Size(Renderer.SheetSize, Renderer.SheetSize));
}
public SheetBuilder(SheetType t)