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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user