git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1228 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
@@ -157,5 +157,7 @@ namespace OpenRa.FileFormats
|
||||
Y = xy / 128;
|
||||
Image = image;
|
||||
}
|
||||
|
||||
public Point Location { get { return new Point(X, Y); } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace OpenRa.Game
|
||||
{
|
||||
abstract class Actor
|
||||
{
|
||||
public PointF location;
|
||||
public float2 location;
|
||||
public int palette;
|
||||
public abstract Sprite[] CurrentImages { get; }
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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) };
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -8,7 +8,7 @@ using BluntDirectX.Direct3D;
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
class float2
|
||||
struct float2
|
||||
{
|
||||
public float X, Y;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user