Unlock expanded venues and manage concurrent fleet voyages
This commit is contained in:
@@ -252,27 +252,39 @@ namespace Soundings
|
||||
|
||||
private static void PaintMapCoast(Painter2D pen, MapProjection projection)
|
||||
{
|
||||
float reach = projection.Dimensions.x / (2 * projection.Scale);
|
||||
int first = Mathf.FloorToInt((projection.Center.x - reach + 180) / 360);
|
||||
int last = Mathf.FloorToInt((projection.Center.x + reach + 180) / 360);
|
||||
Vector2 margin = Vector2.one * 2;
|
||||
Vector2 reach = (projection.Dimensions * .5f + margin) / projection.Scale;
|
||||
Vector2 lower = projection.Center - reach, upper = projection.Center + reach;
|
||||
int first = Mathf.FloorToInt((lower.x + 180) / 360);
|
||||
int last = Mathf.FloorToInt((upper.x + 180) / 360);
|
||||
pen.fillColor = new Color(.14f, .27f, .28f);
|
||||
pen.strokeColor = new Color(.48f, .61f, .51f, .73f);
|
||||
pen.lineWidth = 1.1f;
|
||||
Vector2[][] shapes = WorldCoastlines.Shapes;
|
||||
Rect[] bounds = WorldCoastlines.Bounds;
|
||||
for (int zone = first; zone <= last; zone++)
|
||||
foreach (Vector2[] coast in WorldCoastlines.Shapes)
|
||||
{
|
||||
pen.BeginPath();
|
||||
for (int i = 0; i < coast.Length; i++)
|
||||
float shift = zone * 360;
|
||||
for (int ring = 0; ring < shapes.Length; ring++)
|
||||
{
|
||||
Vector2 visual = projection.Pixel(new Vector2(coast[i].x * 360 - 180 + zone * 360, coast[i].y * 137 - 76));
|
||||
if (i == 0)
|
||||
pen.MoveTo(visual);
|
||||
else
|
||||
pen.LineTo(visual);
|
||||
Rect extent = bounds[ring];
|
||||
if (extent.xMax + shift < lower.x || extent.xMin + shift > upper.x || extent.yMax < lower.y || extent.yMin > upper.y)
|
||||
continue;
|
||||
|
||||
Vector2[] coast = shapes[ring];
|
||||
pen.BeginPath();
|
||||
for (int i = 0; i < coast.Length; i++)
|
||||
{
|
||||
Vector2 visual = projection.Pixel(new Vector2(coast[i].x * 360 - 180 + shift, coast[i].y * 137 - 76));
|
||||
if (i == 0)
|
||||
pen.MoveTo(visual);
|
||||
else
|
||||
pen.LineTo(visual);
|
||||
}
|
||||
pen.ClosePath();
|
||||
pen.Fill();
|
||||
pen.Stroke();
|
||||
}
|
||||
pen.ClosePath();
|
||||
pen.Fill();
|
||||
pen.Stroke();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user