git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1195 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-13 11:12:16 +00:00
parent 9ffe1d2845
commit d4a7e5fb9e
10 changed files with 102 additions and 100 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using BluntDirectX.Direct3D;
using OpenRa.FileFormats;
namespace OpenRa.Game
{
static class CoreSheetBuilder
{
static TileSheetBuilder<Sheet> builder;
static Size pageSize = new Size(512,512);
public static void Initialize(GraphicsDevice device)
{
Provider<Sheet> sheetProvider = delegate { return new Sheet(pageSize, device); };
builder = new TileSheetBuilder<Sheet>(pageSize, sheetProvider);
}
public static SheetRectangle<Sheet> Add(byte[] src, Size size)
{
SheetRectangle<Sheet> rect = builder.AddImage(size);
Util.CopyIntoChannel(rect, src);
return rect;
}
}
}