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

This commit is contained in:
(no author)
2007-07-20 04:18:02 +00:00
parent df4e71e89e
commit db17062511
5 changed files with 28 additions and 22 deletions

View File

@@ -20,8 +20,6 @@ namespace OpenRa.Game
{
fromCell = toCell = cell;
this.renderOffset = renderOffset;
// HACK: display the mcv centered in it's cell;
renderLocation = ( cell * 24 ).ToFloat2() - renderOffset;
this.palette = palette;
}
@@ -101,17 +99,6 @@ namespace OpenRa.Game
}
}
}
float2 location;
if( moveFraction > 0 )
location = 24 * float2.Lerp( fromCell.ToFloat2(), toCell.ToFloat2(),
(float)moveFraction / moveFractionTotal );
else
location = 24 * fromCell.ToFloat2();
renderLocation = location - renderOffset;
renderLocation = renderLocation.Round();
};
}
@@ -130,5 +117,16 @@ namespace OpenRa.Game
{
get { return toCell; }
}
public override float2 RenderLocation
{
get
{
float fraction = (moveFraction > 0) ? (float)moveFraction / moveFractionTotal : 0f;
float2 location = 24 * float2.Lerp( fromCell.ToFloat2(), toCell.ToFloat2(), fraction );
return ( location - renderOffset ).Round(); ;
}
}
}
}