diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj
index 6d2a0a9cd..adfef498b 100644
--- a/Subsurface/Barotrauma.csproj
+++ b/Subsurface/Barotrauma.csproj
@@ -176,6 +176,7 @@
+
@@ -422,6 +423,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -852,12 +856,18 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
diff --git a/Subsurface/Content/Characters/Human/fhead8.png b/Subsurface/Content/Characters/Human/fhead8.png
new file mode 100644
index 000000000..39c08ea85
Binary files /dev/null and b/Subsurface/Content/Characters/Human/fhead8.png differ
diff --git a/Subsurface/Content/Characters/Human/human.xml b/Subsurface/Content/Characters/Human/human.xml
index 28b9914fe..b0f000efd 100644
--- a/Subsurface/Content/Characters/Human/human.xml
+++ b/Subsurface/Content/Characters/Human/human.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/Subsurface/Content/Particles/FlameRoundParticleSheet.png b/Subsurface/Content/Particles/FlameRoundParticleSheet.png
new file mode 100644
index 000000000..8b6c84a46
Binary files /dev/null and b/Subsurface/Content/Particles/FlameRoundParticleSheet.png differ
diff --git a/Subsurface/Content/Particles/ParticlePrefabs.xml b/Subsurface/Content/Particles/ParticlePrefabs.xml
index 7182505bc..36fbedd31 100644
--- a/Subsurface/Content/Particles/ParticlePrefabs.xml
+++ b/Subsurface/Content/Particles/ParticlePrefabs.xml
@@ -111,19 +111,20 @@
-
-
+ velocitychange="0.0, 2.5"
+ animduration="1.2"
+ loopanim="false">
+
-
+ collisionradius="80.0"
+ velocitychange="0.0, 2.5"
+ animduration="4"
+ restitution="0.98"
+ loopanim="false">
+
[
@@ -101,15 +105,38 @@ namespace Barotrauma
var newSprite = new BackgroundSprite(prefab,
new Vector3((Vector2)pos, Rand.Range(prefab.DepthRange.X, prefab.DepthRange.Y, false)), Rand.Range(prefab.Scale.X, prefab.Scale.Y, false), rotation);
+
+ //calculate the positions of the corners of the rotated sprite
+ Vector2 halfSize = newSprite.Prefab.Sprite.size * newSprite.Scale / 2;
+ var spriteCorners = new Vector2[]
+ {
+ -halfSize, new Vector2(-halfSize.X, halfSize.Y),
+ halfSize, new Vector2(halfSize.X, -halfSize.Y)
+ };
- Vector2 spriteSize = newSprite.Prefab.Sprite.size * newSprite.Scale;
+ Vector2 pivotOffset = newSprite.Prefab.Sprite.Origin * newSprite.Scale - halfSize;
+ pivotOffset.X = -pivotOffset.X;
+ pivotOffset = new Vector2(
+ (float)(pivotOffset.X * Math.Cos(-rotation) - pivotOffset.Y * Math.Sin(-rotation)),
+ (float)(pivotOffset.X * Math.Sin(-rotation) + pivotOffset.Y * Math.Cos(-rotation)));
- int minX = (int)Math.Floor((newSprite.Position.X - spriteSize.X / 2 - newSprite.Position.Z) / GridSize);
- int maxX = (int)Math.Floor((newSprite.Position.X + spriteSize.X / 2 + newSprite.Position.Z) / GridSize);
+ for (int j = 0; j < 4; j++)
+ {
+ spriteCorners[j] = new Vector2(
+ (float)(spriteCorners[j].X * Math.Cos(-rotation) - spriteCorners[j].Y * Math.Sin(-rotation)),
+ (float)(spriteCorners[j].X * Math.Sin(-rotation) + spriteCorners[j].Y * Math.Cos(-rotation)));
+
+ spriteCorners[j] += (Vector2)pos + pivotOffset;
+ }
+
+ //newSprite.spriteCorners = spriteCorners;
+
+ int minX = (int)Math.Floor((spriteCorners.Min(c => c.X) - newSprite.Position.Z) / GridSize);
+ int maxX = (int)Math.Floor((spriteCorners.Max(c => c.X) + newSprite.Position.Z) / GridSize);
if (minX < 0 || maxX >= sprites.GetLength(0)) continue;
- int minY = (int)Math.Floor((newSprite.Position.Y - spriteSize.Y / 2 - newSprite.Position.Z) / GridSize);
- int maxY = (int)Math.Floor((newSprite.Position.Y + spriteSize.Y / 2 + newSprite.Position.Z) / GridSize);
+ int minY = (int)Math.Floor((spriteCorners.Min(c => c.Y) - newSprite.Position.Z) / GridSize);
+ int maxY = (int)Math.Floor((spriteCorners.Max(c => c.Y) + newSprite.Position.Z) / GridSize);
if (minY < 0 || maxY >= sprites.GetLength(1)) continue;
for (int x = minX; x <= maxX; x++)
@@ -266,7 +293,7 @@ namespace Barotrauma
}
foreach (BackgroundSprite sprite in visibleSprites)
- {
+ {
Vector2 camDiff = new Vector2(sprite.Position.X, sprite.Position.Y) - cam.WorldViewCenter;
camDiff.Y = -camDiff.Y;
@@ -279,6 +306,14 @@ namespace Barotrauma
SpriteEffects.None,
z);
+ /*for (int i = 0; i < 4; i++)
+ {
+ GUI.DrawLine(spriteBatch,
+ new Vector2(sprite.spriteCorners[i].X, -sprite.spriteCorners[i].Y),
+ new Vector2(sprite.spriteCorners[(i + 1) % 4].X, -sprite.spriteCorners[(i + 1) % 4].Y),
+ Color.White, 0, 5);
+ }*/
+
if (GameMain.DebugDraw)
{
GUI.DrawRectangle(spriteBatch, new Vector2(sprite.Position.X, -sprite.Position.Y), new Vector2(10.0f, 10.0f), Color.Red, true);
diff --git a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs
index 1568b2caf..f3df1563d 100644
--- a/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs
+++ b/Subsurface/Source/Characters/BackgroundSprite/BackgroundSpritePrefab.cs
@@ -43,7 +43,7 @@ namespace Barotrauma
Scale.X = ToolBox.GetAttributeFloat(element, "minsize", 1.0f);
Scale.Y = ToolBox.GetAttributeFloat(element, "maxsize", 1.0f);
- DepthRange = ToolBox.GetAttributeVector2(element, "depthrange", Vector2.Zero);
+ DepthRange = ToolBox.GetAttributeVector2(element, "depthrange", new Vector2(0.0f, 1.0f));
AlignWithSurface = ToolBox.GetAttributeBool(element, "alignwithsurface", false);
diff --git a/Subsurface/Source/GUI/GUITextBlock.cs b/Subsurface/Source/GUI/GUITextBlock.cs
index 8b3569a50..be8af4dba 100644
--- a/Subsurface/Source/GUI/GUITextBlock.cs
+++ b/Subsurface/Source/GUI/GUITextBlock.cs
@@ -187,21 +187,21 @@ namespace Barotrauma
public void SetTextPos()
{
- if (text==null) return;
+ if (text == null) return;
wrappedText = text;
Vector2 size = MeasureText(text);
-
- if (Wrap && rect.Width>0)
+
+ if (Wrap && rect.Width > 0)
{
- wrappedText = ToolBox.WrapText(text, rect.Width - padding.X - padding.Z, Font);
+ wrappedText = ToolBox.WrapText(text, rect.Width - padding.X - padding.Z, Font, textScale);
Vector2 newSize = MeasureText(wrappedText);
size = newSize;
}
-
+
if (LimitText && text.Length>1 && size.Y > rect.Height)
{
string[] lines = text.Split('\n');
diff --git a/Subsurface/Source/GameMain.cs b/Subsurface/Source/GameMain.cs
index 7ab1ff275..78fc56525 100644
--- a/Subsurface/Source/GameMain.cs
+++ b/Subsurface/Source/GameMain.cs
@@ -69,6 +69,7 @@ namespace Barotrauma
public static GameSettings Config;
+ private CoroutineHandle loadingCoroutine;
private bool hasLoaded;
private GameTime fixedTime;
@@ -203,7 +204,7 @@ namespace Barotrauma
loadingScreenOpen = true;
TitleScreen = new LoadingScreen(GraphicsDevice);
- CoroutineManager.StartCoroutine(Load());
+ loadingCoroutine = CoroutineManager.StartCoroutine(Load());
}
public IEnumerable