From 9ea296c34d20757bc1ea6941cd1f7ecfa09b6144 Mon Sep 17 00:00:00 2001 From: chrisf Date: Sat, 14 Jul 2007 06:01:12 +0000 Subject: [PATCH] git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1219 993157c7-ee19-0410-b2c4-bb4e9862e678 --- OpenRa.Game/SheetBuilder.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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); }