Move TileSize definition to terrain info.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
0f7b24a8c0
commit
25188e849e
@@ -146,7 +146,7 @@ namespace OpenRA.Graphics
|
||||
public Viewport(WorldRenderer wr, Map map)
|
||||
{
|
||||
worldRenderer = wr;
|
||||
var grid = Game.ModData.Manifest.Get<MapGrid>();
|
||||
tileSize = map.Rules.TerrainInfo.TileSize;
|
||||
viewportSizes = Game.ModData.Manifest.Get<WorldViewportSizes>();
|
||||
graphicSettings = Game.Settings.Graphics;
|
||||
defaultScale = viewportSizes.DefaultScale;
|
||||
@@ -155,8 +155,8 @@ namespace OpenRA.Graphics
|
||||
if (wr.World.Type == WorldType.Editor)
|
||||
{
|
||||
// The full map is visible in the editor
|
||||
var width = map.MapSize.X * grid.TileSize.Width;
|
||||
var height = map.MapSize.Y * grid.TileSize.Height;
|
||||
var width = map.MapSize.X * tileSize.Width;
|
||||
var height = map.MapSize.Y * tileSize.Height;
|
||||
if (wr.World.Map.Grid.Type == MapGridType.RectangularIsometric)
|
||||
height /= 2;
|
||||
|
||||
@@ -171,8 +171,6 @@ namespace OpenRA.Graphics
|
||||
CenterLocation = (tl + br) / 2;
|
||||
}
|
||||
|
||||
tileSize = grid.TileSize;
|
||||
|
||||
UpdateViewportZooms();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenRA.Graphics
|
||||
internal WorldRenderer(ModData modData, World world)
|
||||
{
|
||||
World = world;
|
||||
TileSize = World.Map.Grid.TileSize;
|
||||
TileSize = World.Map.Rules.TerrainInfo.TileSize;
|
||||
TileScale = World.Map.Grid.TileScale;
|
||||
Viewport = new Viewport(this, world.Map);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user