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

This commit is contained in:
chrisf
2008-03-13 05:24:42 +00:00
parent f06bac7134
commit 9dc6383a6c
5 changed files with 20 additions and 12 deletions

View File

@@ -11,6 +11,7 @@ namespace OpenRa.Game
public readonly Sheet sheet;
public readonly TextureChannel channel;
public readonly RectangleF uv;
public readonly float2 size;
internal Sprite(Sheet sheet, Rectangle bounds, TextureChannel channel)
{
@@ -23,6 +24,8 @@ namespace OpenRa.Game
(float)(bounds.Top + 0.5f) / sheet.Size.Height,
(float)(bounds.Width) / sheet.Size.Width,
(float)(bounds.Height) / sheet.Size.Height);
this.size = new float2(bounds.Size);
}
public float2 MapTextureCoords(float2 p)
@@ -31,6 +34,8 @@ namespace OpenRa.Game
p.X > 0 ? uv.Right : uv.Left,
p.Y > 0 ? uv.Bottom : uv.Top);
}
public float2 Size { get { return size; } }
}
public enum TextureChannel