Drop unnecessary `this' uses from Viewport.

This commit is contained in:
Paul Chote
2011-07-22 21:17:48 +12:00
parent 6183621a72
commit 0b0e3d5f14

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Graphics
var newScrollPosition = scrollPosition + d; var newScrollPosition = scrollPosition + d;
if(!ignoreBorders) if(!ignoreBorders)
newScrollPosition = this.NormalizeScrollPosition(newScrollPosition); newScrollPosition = NormalizeScrollPosition(newScrollPosition);
scrollPosition = newScrollPosition; scrollPosition = newScrollPosition;
} }
@@ -83,11 +83,11 @@ namespace OpenRA.Graphics
{ {
this.screenSize = screenSize; this.screenSize = screenSize;
this.renderer = renderer; this.renderer = renderer;
this.adjustedMapBounds = new Rectangle(Game.CellSize*mapBounds.X - screenSize.X/2, adjustedMapBounds = new Rectangle(Game.CellSize*mapBounds.X - screenSize.X/2,
Game.CellSize*mapBounds.Y - screenSize.Y/2, Game.CellSize*mapBounds.Y - screenSize.Y/2,
Game.CellSize*mapBounds.Width, Game.CellSize*mapBounds.Width,
Game.CellSize*mapBounds.Height); Game.CellSize*mapBounds.Height);
this.scrollPosition = new int2(adjustedMapBounds.Location) + new int2(adjustedMapBounds.Size)/2; scrollPosition = new int2(adjustedMapBounds.Location) + new int2(adjustedMapBounds.Size)/2;
} }
public void DrawRegions( WorldRenderer wr, IInputHandler inputHandler ) public void DrawRegions( WorldRenderer wr, IInputHandler inputHandler )
@@ -132,7 +132,7 @@ namespace OpenRA.Graphics
public void Center(float2 loc) public void Center(float2 loc)
{ {
scrollPosition = this.NormalizeScrollPosition((Game.CellSize*loc - 1f/(2*Zoom)*screenSize.ToFloat2()).ToInt2()); scrollPosition = NormalizeScrollPosition((Game.CellSize*loc - 1f/(2*Zoom)*screenSize.ToFloat2()).ToInt2());
} }
public void Center(IEnumerable<Actor> actors) public void Center(IEnumerable<Actor> actors)
@@ -142,7 +142,7 @@ namespace OpenRA.Graphics
var avgPos = actors var avgPos = actors
.Select(a => a.CenterLocation) .Select(a => a.CenterLocation)
.Aggregate((a, b) => a + b) / actors.Count(); .Aggregate((a, b) => a + b) / actors.Count();
scrollPosition = this.NormalizeScrollPosition((avgPos - 1f/(2*Zoom)*screenSize.ToFloat2()).ToInt2()); scrollPosition = NormalizeScrollPosition((avgPos - 1f/(2*Zoom)*screenSize.ToFloat2()).ToInt2());
} }
// Rectangle (in viewport coords) that contains things to be drawn // Rectangle (in viewport coords) that contains things to be drawn