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

This commit is contained in:
chrisf
2007-07-14 07:17:31 +00:00
parent 6cffb2ebb5
commit 9f364cfdc7
8 changed files with 13 additions and 11 deletions

View File

@@ -157,5 +157,7 @@ namespace OpenRa.FileFormats
Y = xy / 128;
Image = image;
}
public Point Location { get { return new Point(X, Y); } }
}
}

View File

@@ -10,7 +10,7 @@ namespace OpenRa.Game
{
abstract class Actor
{
public PointF location;
public float2 location;
public int palette;
public abstract Sprite[] CurrentImages { get; }
}

View File

@@ -32,7 +32,7 @@ namespace OpenRa.Game
settings.GetValue("height", desktopResolution.Height));
}
public MainWindow( Settings settings )
public MainWindow(Settings settings)
{
FormBorderStyle = FormBorderStyle.None;
BackColor = Color.Black;
@@ -59,11 +59,11 @@ namespace OpenRa.Game
foreach (TreeReference treeReference in map.Trees)
world.Add(new Tree(treeReference, treeCache, map));
world.Add(new Mcv(new PointF(24 * 5, 24 * 5), 3));
world.Add(new Mcv(new PointF(24 * 7, 24 * 5), 2));
world.Add(new Mcv(new PointF(24 * 9, 24 * 5), 1));
world.Add(new Mcv(24 * new float2(5, 5), 3));
world.Add(new Mcv(24 * new float2(7, 5), 2));
world.Add(new Mcv(24 * new float2(9, 5), 1));
world.Add(new Refinery(new PointF(24 * 5, 24 * 7), 1));
world.Add(new Refinery(24 * new float2(5, 7), 1));
sidebar = new Sidebar(Race.Soviet, renderer);
}

View File

@@ -11,7 +11,7 @@ namespace OpenRa.Game
{
static Range<int>? mcvRange = null;
public Mcv( PointF location, int palette )
public Mcv( float2 location, int palette )
{
this.location = location;
this.palette = palette;

View File

@@ -11,7 +11,7 @@ namespace OpenRa.Game
{
static Range<int>? refineryRange = null;
public Refinery(PointF location, int palette)
public Refinery(float2 location, int palette)
{
if (refineryRange == null)
refineryRange = UnitSheetBuilder.AddUnit("proc");

View File

@@ -10,7 +10,7 @@ namespace OpenRa.Game
{
public Tree(TreeReference r, TreeCache renderer, Map map)
{
location = new PointF(24 * (r.X - map.XOffset), 24 * (r.Y - map.YOffset));
location = 24 * (new float2(r.Location) - new float2(map.XOffset, map.YOffset));
currentImages = new Sprite[] { renderer.GetImage(r.Image) };
}

View File

@@ -37,7 +37,7 @@ namespace OpenRa.Game
continue;
foreach (Sprite image in images)
spriteRenderer.DrawSprite(image, a.location, a.palette);
spriteRenderer.DrawSprite(image, a.location.ToPointF(), a.palette);
}
spriteRenderer.Flush();

View File

@@ -8,7 +8,7 @@ using BluntDirectX.Direct3D;
namespace OpenRa.Game
{
[StructLayout(LayoutKind.Sequential)]
class float2
struct float2
{
public float X, Y;