From ee8b3d82b97296059bde09a6987e632ac26a3b91 Mon Sep 17 00:00:00 2001 From: bob Date: Mon, 16 Jul 2007 01:14:39 +0000 Subject: [PATCH] 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 --- OpenRa.Game/MainWindow.cs | 2 -- OpenRa.Game/Mcv.cs | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRa.Game/MainWindow.cs b/OpenRa.Game/MainWindow.cs index 3aac970a29..1bd6bc1a06 100644 --- a/OpenRa.Game/MainWindow.cs +++ b/OpenRa.Game/MainWindow.cs @@ -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(); diff --git a/OpenRa.Game/Mcv.cs b/OpenRa.Game/Mcv.cs index a825ef1ebe..b20891b64f 100644 --- a/OpenRa.Game/Mcv.cs +++ b/OpenRa.Game/Mcv.cs @@ -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 )