reduces duplication; textures get put in hardware on demand now.
git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1187 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -16,11 +16,11 @@ namespace OpenRa.Game
|
||||
static List<Sheet> sheets = new List<Sheet>();
|
||||
static Size pageSize = new Size(1024, 512);
|
||||
|
||||
static UnitSheetBuilder()
|
||||
public static void Initialize( GraphicsDevice device )
|
||||
{
|
||||
Provider<Sheet> sheetProvider = delegate
|
||||
{
|
||||
Sheet sheet = new Sheet(new Bitmap(pageSize.Width, pageSize.Height));
|
||||
Sheet sheet = new Sheet(new Bitmap(pageSize.Width, pageSize.Height), device);
|
||||
sheets.Add(sheet);
|
||||
return sheet;
|
||||
};
|
||||
@@ -28,12 +28,6 @@ namespace OpenRa.Game
|
||||
builder = new TileSheetBuilder<Sheet>(pageSize, sheetProvider);
|
||||
}
|
||||
|
||||
public static void Resolve( GraphicsDevice device )
|
||||
{
|
||||
foreach (Sheet sheet in sheets)
|
||||
sheet.LoadTexture(device);
|
||||
}
|
||||
|
||||
public static void AddUnit( string name, Palette pal )
|
||||
{
|
||||
ShpReader reader = new ShpReader( unitsPackage.GetContent( name + ".shp" ) );
|
||||
|
||||
Reference in New Issue
Block a user