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:
chrisf
2007-07-13 02:06:38 +00:00
parent ee52ca58f1
commit 2a076b34bf
5 changed files with 23 additions and 23 deletions

View File

@@ -11,11 +11,24 @@ namespace OpenRa.Game
class Sheet
{
public readonly Bitmap bitmap;
public Texture texture;
readonly GraphicsDevice device;
Texture texture;
public Sheet(Bitmap b) { bitmap = b; }
public Sheet(Bitmap b, GraphicsDevice d) { bitmap = b; device = d; }
public void LoadTexture(GraphicsDevice device)
public Texture Texture
{
get
{
if (texture == null)
LoadTexture();
return texture;
}
}
void LoadTexture()
{
string tempFile = string.Format("../../../block-cache-{0}.png", suffix++);
bitmap.Save(tempFile);