git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1119 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
29
OpenRa.Game/Sheet.cs
Normal file
29
OpenRa.Game/Sheet.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using BluntDirectX.Direct3D;
|
||||
using System.IO;
|
||||
using System.Drawing.Imaging;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
class Sheet
|
||||
{
|
||||
public readonly Bitmap bitmap;
|
||||
public Texture texture;
|
||||
|
||||
public Sheet(Bitmap b) { bitmap = b; }
|
||||
|
||||
public void LoadTexture(GraphicsDevice device)
|
||||
{
|
||||
string tempFile = string.Format("../../../block-cache-{0}.bmp", suffix++);
|
||||
bitmap.Save(tempFile);
|
||||
|
||||
using( Stream s = File.OpenRead(tempFile) )
|
||||
texture = Texture.Create(s, device);
|
||||
}
|
||||
|
||||
static int suffix = 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user