Unstable 1.8.4.0
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Barotrauma
|
||||
Dictionary<string, List<string>> xmlContent;
|
||||
try
|
||||
{
|
||||
xmlContent = ConvertInfoTextToXML(File.ReadAllLines(textFilePath, Encoding.UTF8));
|
||||
xmlContent = ConvertInfoTextToXML(File.ReadAllLines(textFilePath, Encoding.UTF8, catchUnauthorizedAccessExceptions: false));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -156,7 +156,7 @@ namespace Barotrauma
|
||||
List<string> xmlContent;
|
||||
try
|
||||
{
|
||||
xmlContent = ConvertInfoTextToXML(File.ReadAllLines(infoTextFiles[j], Encoding.UTF8), language);
|
||||
xmlContent = ConvertInfoTextToXML(File.ReadAllLines(infoTextFiles[j], Encoding.UTF8, catchUnauthorizedAccessExceptions: false), language);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Barotrauma
|
||||
@@ -16,4 +17,22 @@ namespace Barotrauma
|
||||
return -CompareCCW.Compare(a.WorldPos, b.WorldPos, center);
|
||||
}
|
||||
}
|
||||
|
||||
public class CompareVertexPositionColorCCW : IComparer<VertexPositionColor>
|
||||
{
|
||||
private Vector2 center;
|
||||
|
||||
public CompareVertexPositionColorCCW(Vector2 center)
|
||||
{
|
||||
this.center = center;
|
||||
}
|
||||
public int Compare(VertexPositionColor a, VertexPositionColor b)
|
||||
{
|
||||
return -CompareCW.Compare(new Vector2(a.Position.X, a.Position.Y), new Vector2(b.Position.X, b.Position.Y), center);
|
||||
}
|
||||
public static int Compare(VertexPositionColor a, VertexPositionColor b, Vector2 center)
|
||||
{
|
||||
return -CompareCW.Compare(new Vector2(a.Position.X, a.Position.Y), new Vector2(b.Position.X, b.Position.Y), center);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,11 +76,14 @@ namespace Barotrauma
|
||||
float zoom = (float)texWidth / (float)boundingBox.Width;
|
||||
int texHeight = (int)(zoom * boundingBox.Height);
|
||||
|
||||
Camera cam = new Camera();
|
||||
Camera cam = new Camera()
|
||||
{
|
||||
AutoUpdateToScreenResolution = false,
|
||||
MaxZoom = zoom,
|
||||
MinZoom = zoom * 0.5f,
|
||||
Zoom = zoom
|
||||
};
|
||||
cam.SetResolution(new Point(texWidth, texHeight));
|
||||
cam.MaxZoom = zoom;
|
||||
cam.MinZoom = zoom * 0.5f;
|
||||
cam.Zoom = zoom;
|
||||
cam.Position = boundingBox.Center.ToVector2();
|
||||
cam.UpdateTransform(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user