Build 1.1.4.0
This commit is contained in:
@@ -92,9 +92,6 @@ namespace Barotrauma.Items.Components
|
||||
rect.Height = (int)(rect.Height * (1.0f - openState));
|
||||
}
|
||||
|
||||
//only merge the door's convex hull with overlapping wall segments if it's fully open or fully closed
|
||||
//it's the heaviest part of changing the convex hull, and doesn't need to be done while the door is still in motion
|
||||
bool mergeOverlappingSegments = openState <= 0.0f || openState >= 1.0f;
|
||||
if (Window.Height > 0 && Window.Width > 0)
|
||||
{
|
||||
if (IsHorizontal)
|
||||
@@ -117,7 +114,7 @@ namespace Barotrauma.Items.Components
|
||||
else
|
||||
{
|
||||
convexHull2.Enabled = true;
|
||||
convexHull2.SetVertices(GetConvexHullCorners(rect2), mergeOverlappingSegments);
|
||||
SetVertices(convexHull2, rect2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,7 +138,7 @@ namespace Barotrauma.Items.Components
|
||||
else
|
||||
{
|
||||
convexHull2.Enabled = true;
|
||||
convexHull2.SetVertices(GetConvexHullCorners(rect2), mergeOverlappingSegments);
|
||||
SetVertices(convexHull2, rect2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,13 +153,28 @@ namespace Barotrauma.Items.Components
|
||||
else
|
||||
{
|
||||
convexHull.Enabled = true;
|
||||
convexHull.SetVertices(GetConvexHullCorners(rect), mergeOverlappingSegments);
|
||||
SetVertices(convexHull, rect);
|
||||
}
|
||||
convexHull.IsExteriorWall = !linkedGap.IsRoomToRoom;
|
||||
if (convexHull2 != null) { convexHull2.IsExteriorWall = convexHull.IsExteriorWall; }
|
||||
}
|
||||
|
||||
|
||||
private void SetVertices(ConvexHull convexHull, Rectangle rect)
|
||||
{
|
||||
var verts = GetConvexHullCorners(rect);
|
||||
Vector2 center = (verts[0] + verts[2]) / 2;
|
||||
convexHull.SetVertices(
|
||||
verts,
|
||||
IsHorizontal ?
|
||||
new Vector2[] { new Vector2(verts[0].X, center.Y), new Vector2(verts[2].X, center.Y) } :
|
||||
new Vector2[] { new Vector2(center.X, verts[0].Y), new Vector2(center.X, verts[2].Y) });
|
||||
}
|
||||
|
||||
partial void UpdateProjSpecific(float deltaTime)
|
||||
{
|
||||
convexHull.IsExteriorWall = !linkedGap.IsRoomToRoom;
|
||||
if (convexHull2 != null) { convexHull2.IsExteriorWall = convexHull.IsExteriorWall; }
|
||||
if (shakeTimer > 0.0f)
|
||||
{
|
||||
shakeTimer -= deltaTime;
|
||||
@@ -182,7 +194,7 @@ namespace Barotrauma.Items.Components
|
||||
if (brokenSprite == null)
|
||||
{
|
||||
//broken doors turn black if no broken sprite has been configured
|
||||
color *= (item.Condition / item.MaxCondition);
|
||||
color = color.Multiply(item.Condition / item.MaxCondition);
|
||||
color.A = 255;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user