fix failed refactoring, and round renderLocation to avoid pixel-jumping

git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1284 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
bob
2007-07-16 01:14:39 +00:00
parent acba1dc8e4
commit ee8b3d82b9
2 changed files with 4 additions and 3 deletions

View File

@@ -89,8 +89,6 @@ namespace OpenRa.Game
if (e.Button == MouseButtons.Left)
{
//MoveOrder order = new MoveOrder(lastPos + viewport.Location);
//myUnit.Accept(order);
int x = (int)( ( e.X + viewport.Location.X ) / 24 );
int y = (int)( ( e.Y + viewport.Location.Y ) / 24 );
myUnit.Order( x, y ).Apply();

View File

@@ -77,7 +77,7 @@ namespace OpenRa.Game
if( currentOrder == null )
return;
if( float2.WithinEpsilon( renderLocation, currentOrder.Destination, 1.0f ) )
if( float2.WithinEpsilon( location, currentOrder.Destination, 1.0f ) )
{
currentOrder = null;
return;
@@ -99,6 +99,9 @@ namespace OpenRa.Game
facing = ( facing + 1 ) % 32;
renderLocation = location - new float2( 12, 12 ); // HACK: center mcv in it's cell
renderLocation.X = (float)Math.Round( renderLocation.X );
renderLocation.Y = (float)Math.Round( renderLocation.Y );
}
public MoveOrder Order( int x, int y )