diff --git a/OpenRa.Game/SheetBuilder.cs b/OpenRa.Game/SheetBuilder.cs index b532fd1c3a..06a1a76df7 100644 --- a/OpenRa.Game/SheetBuilder.cs +++ b/OpenRa.Game/SheetBuilder.cs @@ -7,13 +7,11 @@ using OpenRa.FileFormats; namespace OpenRa.Game { - delegate T Provider(); - static class SheetBuilder { - public static void Initialize(GraphicsDevice device) + public static void Initialize(GraphicsDevice d) { - pageProvider = delegate { return new Sheet(new Size(512,512), device); }; + device = d; } public static Sprite Add(byte[] src, Size size) @@ -32,7 +30,12 @@ namespace OpenRa.Game return Add(data, size); } - static Provider pageProvider; + static Sheet NewSheet() + { + return new Sheet(new Size(512, 512), device); + } + + static GraphicsDevice device; static Sheet current = null; static int rowHeight = 0; static Point p; @@ -58,7 +61,7 @@ namespace OpenRa.Game { if (current == null) { - current = pageProvider(); + current = NewSheet(); channel = NextChannel(null); } @@ -76,7 +79,7 @@ namespace OpenRa.Game if (null == (channel = NextChannel(channel))) { - current = pageProvider(); + current = NewSheet(); channel = NextChannel(channel); }