diff --git a/Barotrauma/BarotraumaClient/BarotraumaClient.csproj b/Barotrauma/BarotraumaClient/BarotraumaClient.csproj
index 3503eb0a8..e0f8c8219 100644
--- a/Barotrauma/BarotraumaClient/BarotraumaClient.csproj
+++ b/Barotrauma/BarotraumaClient/BarotraumaClient.csproj
@@ -1,7 +1,7 @@
- Debug
+ ReleaseLinux
x86
8.0.30703
2.0
@@ -9,7 +9,7 @@
WinExe
Properties
Barotrauma
- Barotrauma
+ BarotraumaClient
512
false
publish\
@@ -28,37 +28,47 @@
true
v4.5
-
-
- x86
- true
- full
- false
- ..\bin\Windows\Debug\
- TRACE;DEBUG;WINDOWS;CLIENT
- prompt
- 4
- false
-
-
- x86
- pdbonly
- true
- ..\bin\Windows\Release\
- TRACE;WINDOWS;CLIENT
-
-
- .allowedextension
-
- prompt
- 4
- false
+ 0.7.0.1
..\BarotraumaShared\Icon.ico
+
+ true
+ pdbonly
+ true
+ ..\bin\ReleaseLinux\
+ TRACE;LINUX;CLIENT
+ 4
+ x86
+
+
+ true
+ full
+ false
+ ..\bin\DebugLinux\
+ TRACE;LINUX;CLIENT;DEBUG
+ 4
+ x86
+
+
+ true
+ pdbonly
+ true
+ ..\bin\ReleaseWindows\
+ TRACE;WINDOWS;CLIENT
+ 4
+ x86
+
+
+ true
+ full
+ false
+ ..\bin\DebugWindows\
+ TRACE;WINDOWS;CLIENT;DEBUG
+ 4
+ x86
+
@@ -221,31 +231,30 @@
-
+
..\..\Libraries\NuGet\MonoGame.Framework.WindowsDX.3.6.0.1625\lib\net40\MonoGame.Framework.dll
- True
-
- False
+
+ ..\..\Libraries\NuGet\SharpDX.4.0.1\lib\net45\SharpDX.dll
+
+
..\..\Libraries\NuGet\NVorbis.0.8.5.0\lib\NVorbis.dll
False
..\..\Libraries\NuGet\OpenTK.2.0.0\lib\net20\OpenTK.dll
-
-
- ..\..\Libraries\NuGet\RestSharp.105.2.3\lib\net45\RestSharp.dll
-
-
- False
- ..\..\Libraries\NuGet\MonoGame.Framework.WindowsDX.3.6.0.1625\lib\net40\SharpDX.dll
-
+
+ ..\..\Libraries\NuGet\RestSharp.105.2.3\lib\net45\RestSharp.dll
+
+
+ ..\..\Libraries\NuGet\MonoGame.Framework.DesktopGL.3.6.0.1625\lib\net40\MonoGame.Framework.dll
+
@@ -257,6 +266,15 @@
PreserveNewest
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
@@ -281,10 +299,6 @@
-
- {0aad36e3-51a5-4a07-ab60-5c8a66bd38b7}
- Farseer Physics MonoGame
-
{3b8f9edb-6e5e-450c-abc2-ec49075d0b50}
Hyper.ComponentModel
@@ -297,9 +311,12 @@
{c293db32-fa42-486d-b128-5a12522fae4e}
SharpFont
+
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}
+ Farseer Physics MonoGame
+
-
@@ -312,4 +329,4 @@
-->
-
\ No newline at end of file
+
diff --git a/Barotrauma/BarotraumaClient/MonoGame.Framework.dll.config b/Barotrauma/BarotraumaClient/MonoGame.Framework.dll.config
new file mode 100644
index 000000000..f8abd6e60
--- /dev/null
+++ b/Barotrauma/BarotraumaClient/MonoGame.Framework.dll.config
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/Barotrauma/BarotraumaClient/SharpFont.dll.config b/Barotrauma/BarotraumaClient/SharpFont.dll.config
new file mode 100755
index 000000000..719e30c78
--- /dev/null
+++ b/Barotrauma/BarotraumaClient/SharpFont.dll.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs
index 8f5912e56..349d4b4b3 100644
--- a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs
+++ b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs
@@ -1,4 +1,4 @@
-using Barotrauma.Networking;
+using Barotrauma.Networking;
using Barotrauma.Particles;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
@@ -290,7 +290,15 @@ namespace Barotrauma
string name = Info.DisplayName;
if (controlled == null && name != Info.Name) name += " (Disguised)";
- Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(name) * 0.5f / cam.Zoom;
+ Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(Info.Name) * 0.5f / cam.Zoom;
+ Vector2 screenSize = new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight);
+ Vector2 viewportSize = new Vector2(cam.WorldView.Width, cam.WorldView.Height);
+ namePos.X -= cam.WorldView.X; namePos.Y += cam.WorldView.Y;
+ namePos *= screenSize / viewportSize;
+ namePos.X = (float)Math.Floor(namePos.X); namePos.Y = (float)Math.Floor(namePos.Y);
+ namePos *= viewportSize / screenSize;
+ namePos.X += cam.WorldView.X; namePos.Y -= cam.WorldView.Y;
+
Color nameColor = Color.White;
if (Controlled != null && TeamID != Controlled.TeamID)
diff --git a/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs b/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs
index 51d728219..4c6641fbe 100644
--- a/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs
+++ b/Barotrauma/BarotraumaClient/Source/Characters/CharacterNetworking.cs
@@ -145,6 +145,10 @@ namespace Barotrauma
float rotation = msg.ReadFloat();
+ ReadStatus(msg);
+
+ msg.ReadPadBits();
+
int index = 0;
if (GameMain.NetworkMember.Character == this)
{
@@ -193,9 +197,6 @@ namespace Barotrauma
IsRemotePlayer = ownerID > 0;
}
break;
- case 2:
- ReadStatus(msg);
- break;
}
break;
diff --git a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs
index 539531cd2..fcaf6de3f 100644
--- a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs
+++ b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs
@@ -28,7 +28,7 @@ namespace Barotrauma
static GUIFrame frame;
static GUIListBox listBox;
static GUITextBox textBox;
-
+
public static void Init(GameWindow window)
{
int x = 20, y = 20;
@@ -47,7 +47,7 @@ namespace Barotrauma
return true;
};
-
+
NewMessage("Press F3 to open/close the debug console", Color.Cyan);
NewMessage("Enter \"help\" for a list of available console commands", Color.Cyan);
@@ -111,7 +111,7 @@ namespace Barotrauma
{
textBox.Text = AutoComplete(textBox.Text);
}
-
+
if (PlayerInput.KeyHit(Keys.Enter))
{
ExecuteCommand(textBox.Text);
@@ -164,7 +164,7 @@ namespace Barotrauma
{
listBox.children.RemoveRange(0, listBox.children.Count - MaxMessages);
}
-
+
Messages.Add(msg);
if (Messages.Count > MaxMessages)
{
@@ -190,10 +190,27 @@ namespace Barotrauma
private static void InitProjectSpecific()
{
+ commands.Add(new Command("autohull", "", (string[] args) =>
+ {
+ if (Screen.Selected != GameMain.SubEditorScreen) return;
+
+ if (MapEntity.mapEntityList.Any(e => e is Hull || e is Gap))
+ {
+ ShowQuestionPrompt("This submarine already has hulls and/or gaps. This command will delete them. Do you want to continue? Y/N",
+ (option) => {
+ if (option.ToLower() == "y") GameMain.SubEditorScreen.AutoHull();
+ });
+ }
+ else
+ {
+ GameMain.SubEditorScreen.AutoHull();
+ }
+ }));
+
commands.Add(new Command("startclient", "", (string[] args) =>
{
if (args.Length == 0) return;
-
+
if (GameMain.Client == null)
{
GameMain.NetworkMember = new GameClient("Name");
@@ -227,7 +244,7 @@ namespace Barotrauma
}
GameMain.SubEditorScreen.Select();
}));
-
+
commands.Add(new Command("editcharacter", "", (string[] args) =>
{
GameMain.CharacterEditorScreen.Select();
diff --git a/Barotrauma/BarotraumaClient/Source/GUI/GUI.cs b/Barotrauma/BarotraumaClient/Source/GUI/GUI.cs
index 5b758ad98..940e4779f 100644
--- a/Barotrauma/BarotraumaClient/Source/GUI/GUI.cs
+++ b/Barotrauma/BarotraumaClient/Source/GUI/GUI.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -427,12 +427,15 @@ namespace Barotrauma
ScreenOverlayColor, true);
}
- if (GameMain.DebugDraw)
+ if (GameMain.ShowFPS || GameMain.DebugDraw)
{
- DrawString(spriteBatch, new Vector2(10, 10),
+ DrawString(spriteBatch, new Vector2(10, 10),
"FPS: " + (int)GameMain.FrameCounter.AverageFramesPerSecond,
Color.White, Color.Black * 0.5f, 0, SmallFont);
+ }
+ if (GameMain.DebugDraw)
+ {
DrawString(spriteBatch, new Vector2(10, 25),
"Physics: " + GameMain.World.UpdateTime,
Color.White, Color.Black * 0.5f, 0, SmallFont);
diff --git a/Barotrauma/BarotraumaClient/Source/GUI/GUIComponent.cs b/Barotrauma/BarotraumaClient/Source/GUI/GUIComponent.cs
index c4ac9c6bd..79feedd6e 100644
--- a/Barotrauma/BarotraumaClient/Source/GUI/GUIComponent.cs
+++ b/Barotrauma/BarotraumaClient/Source/GUI/GUIComponent.cs
@@ -1,4 +1,4 @@
-using EventInput;
+using EventInput;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -129,7 +129,38 @@ namespace Barotrauma
{
get { return new Vector2(rect.Center.X, rect.Center.Y); }
}
-
+
+ protected Rectangle ClampRect(Rectangle r)
+ {
+ if (parent == null) return r;
+ Rectangle parentRect = parent.ClampRect(parent.rect);
+ if (parentRect.Width <= 0 || parentRect.Height <= 0) return Rectangle.Empty;
+ if (parentRect.X > r.X)
+ {
+ int diff = parentRect.X - r.X;
+ r.X = parentRect.X;
+ r.Width -= diff;
+ }
+ if (parentRect.Y > r.Y)
+ {
+ int diff = parentRect.Y - r.Y;
+ r.Y = parentRect.Y;
+ r.Height -= diff;
+ }
+ if (parentRect.X + parentRect.Width < r.X + r.Width)
+ {
+ int diff = (r.X + r.Width) - (parentRect.X + parentRect.Width);
+ r.Width -= diff;
+ }
+ if (parentRect.Y + parentRect.Height < r.Y + r.Height)
+ {
+ int diff = (r.Y + r.Height) - (parentRect.Y + parentRect.Height);
+ r.Height -= diff;
+ }
+ if (r.Width <= 0 || r.Height <= 0) return Rectangle.Empty;
+ return r;
+ }
+
public virtual Rectangle Rect
{
get { return rect; }
@@ -162,7 +193,7 @@ namespace Barotrauma
public virtual Rectangle MouseRect
{
- get { return CanBeFocused ? rect : Rectangle.Empty; }
+ get { return CanBeFocused ? ClampRect(rect) : Rectangle.Empty; }
}
public Dictionary> sprites;
diff --git a/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs b/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs
index dc45399d9..541f5376a 100644
--- a/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs
+++ b/Barotrauma/BarotraumaClient/Source/GUI/GUIListBox.cs
@@ -283,7 +283,7 @@ namespace Barotrauma
{
get
{
- return rect;
+ return ClampRect(rect);
}
}
diff --git a/Barotrauma/BarotraumaClient/Source/GUI/GUIMessage.cs b/Barotrauma/BarotraumaClient/Source/GUI/GUIMessage.cs
index de437566d..157aa47fd 100644
--- a/Barotrauma/BarotraumaClient/Source/GUI/GUIMessage.cs
+++ b/Barotrauma/BarotraumaClient/Source/GUI/GUIMessage.cs
@@ -54,7 +54,7 @@ namespace Barotrauma
public GUIMessage(string text, Color color, Vector2 position, float lifeTime, Alignment textAlignment, bool autoCenter)
{
- coloredText = new ColoredText(text, color);
+ coloredText = new ColoredText(text, color, false);
pos = position;
this.lifeTime = lifeTime;
this.Alignment = textAlignment;
diff --git a/Barotrauma/BarotraumaClient/Source/GUI/GUITickBox.cs b/Barotrauma/BarotraumaClient/Source/GUI/GUITickBox.cs
index e6e0f5734..363e4904b 100644
--- a/Barotrauma/BarotraumaClient/Source/GUI/GUITickBox.cs
+++ b/Barotrauma/BarotraumaClient/Source/GUI/GUITickBox.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Barotrauma
@@ -63,7 +63,7 @@ namespace Barotrauma
public override Rectangle MouseRect
{
- get { return box.Rect; }
+ get { return ClampRect(box.Rect); }
}
public override ScalableFont Font
diff --git a/Barotrauma/BarotraumaClient/Source/GameMain.cs b/Barotrauma/BarotraumaClient/Source/GameMain.cs
index 16dbcd0c8..2e6deadeb 100644
--- a/Barotrauma/BarotraumaClient/Source/GameMain.cs
+++ b/Barotrauma/BarotraumaClient/Source/GameMain.cs
@@ -1,4 +1,4 @@
-using Barotrauma.Networking;
+using Barotrauma.Networking;
using Barotrauma.Particles;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
@@ -14,6 +14,7 @@ namespace Barotrauma
{
class GameMain : Game
{
+ public static bool ShowFPS = true;
public static bool DebugDraw;
public static FrameCounter FrameCounter;
diff --git a/Barotrauma/BarotraumaClient/Source/Items/Item.cs b/Barotrauma/BarotraumaClient/Source/Items/Item.cs
index 00657a557..3b57c72d0 100644
--- a/Barotrauma/BarotraumaClient/Source/Items/Item.cs
+++ b/Barotrauma/BarotraumaClient/Source/Items/Item.cs
@@ -470,7 +470,7 @@ namespace Barotrauma
}
else
{
- body.FarseerBody.Enabled = false;
+ body.Enabled = false;
}
if ((newPosition - SimPosition).Length() > body.LinearVelocity.Length() * 2.0f)
diff --git a/Barotrauma/BarotraumaClient/Source/Map/FireSource.cs b/Barotrauma/BarotraumaClient/Source/Map/FireSource.cs
index 37609a7a3..2a6dd19e6 100644
--- a/Barotrauma/BarotraumaClient/Source/Map/FireSource.cs
+++ b/Barotrauma/BarotraumaClient/Source/Map/FireSource.cs
@@ -1,4 +1,4 @@
-using Barotrauma.Lights;
+using Barotrauma.Lights;
using Barotrauma.Particles;
using Microsoft.Xna.Framework;
using System;
@@ -76,9 +76,9 @@ namespace Barotrauma
}
}
- lightSource.Range = Math.Max(size.X, size.Y) * 10.0f / 2.0f;
lightSource.Color = new Color(1.0f, 0.45f, 0.3f) * Rand.Range(0.8f, 1.0f);
- lightSource.Position = position + Vector2.UnitY * 30.0f;
+ if (Math.Abs((lightSource.Range * 0.2f) - Math.Max(size.X, size.Y)) > 1.0f) lightSource.Range = Math.Max(size.X, size.Y) * 5.0f;
+ if (Vector2.DistanceSquared(lightSource.Position,position) > 5.0f) lightSource.Position = position + Vector2.UnitY * 30.0f;
if (size.X > 256.0f)
{
diff --git a/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs b/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs
index 1d816503f..f1e5e209f 100644
--- a/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs
+++ b/Barotrauma/BarotraumaClient/Source/Map/Levels/LevelRenderer.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
@@ -63,6 +63,7 @@ namespace Barotrauma
public void Update(float deltaTime)
{
dustOffset -= Vector2.UnitY * 10.0f * deltaTime;
+ while (dustOffset.Y <= -1024.0f) dustOffset.Y += 1024.0f;
}
public static VertexPositionColorTexture[] GetColoredVertices(VertexPositionTexture[] vertices, Color color)
@@ -108,7 +109,7 @@ namespace Barotrauma
Vector2 backgroundPos = cam.WorldViewCenter;
backgroundPos.Y = -backgroundPos.Y;
- backgroundPos /= 20.0f;
+ backgroundPos *= 0.05f;
if (backgroundPos.Y < 1024)
{
@@ -130,35 +131,38 @@ namespace Barotrauma
spriteBatch.End();
- spriteBatch.Begin(SpriteSortMode.BackToFront,
+ spriteBatch.Begin(SpriteSortMode.Deferred,
BlendState.AlphaBlend,
SamplerState.LinearWrap, DepthStencilState.Default, null, null,
cam.Transform);
+
+ Vector2 origin = new Vector2(cam.WorldView.X, -cam.WorldView.Y);
+ Vector2 offset = -origin + dustOffset;
+ while (offset.X <= -1024.0f) offset.X += 1024.0f;
+ while (offset.X > 0.0f) offset.X -= 1024.0f;
+ while (offset.Y <= -1024.0f) offset.Y += 1024.0f;
+ while (offset.Y > 0.0f) offset.Y -= 1024.0f;
if (backgroundSpriteManager != null) backgroundSpriteManager.DrawSprites(spriteBatch, cam);
if (backgroundCreatureManager != null) backgroundCreatureManager.Draw(spriteBatch);
-
+
for (int i = 0; i < 4; i++)
{
float scale = 1.0f - i * 0.2f;
+ float recipScale = 1.0f / scale;
- //alpha goes from 1.0 to 0.0 when scale is in the range of 0.2-0.1
- float alpha = (cam.Zoom * scale) < 0.2f ? (cam.Zoom * scale - 0.1f) * 10.0f : 1.0f;
+ //alpha goes from 1.0 to 0.0 when scale is in the range of 0.5-0.25
+ float alpha = (cam.Zoom * scale) < 0.5f ? (cam.Zoom * scale - 0.25f) * 40.0f : 1.0f;
if (alpha <= 0.0f) continue;
- Vector2 offset = (new Vector2(cam.WorldViewCenter.X, cam.WorldViewCenter.Y) + dustOffset) * scale;
- Vector3 origin = new Vector3(cam.WorldView.Width, cam.WorldView.Height, 0.0f) * 0.5f;
+ Vector2 offsetS = offset * scale + new Vector2(cam.WorldView.Width, cam.WorldView.Height) * (1.0f - scale) * 0.5f - new Vector2(256.0f * i);
+ while (offsetS.X <= -1024.0f*scale) offsetS.X += 1024.0f*scale;
+ while (offsetS.X > 0.0f) offsetS.X -= 1024.0f*scale;
+ while (offsetS.Y <= -1024.0f*scale) offsetS.Y += 1024.0f*scale;
+ while (offsetS.Y > 0.0f) offsetS.Y -= 1024.0f*scale;
- dustParticles.SourceRect = new Rectangle(
- (int)((offset.X - origin.X + (i * 256)) / scale),
- (int)((-offset.Y - origin.Y + (i * 256)) / scale),
- (int)((cam.WorldView.Width) / scale),
- (int)((cam.WorldView.Height) / scale));
-
- spriteBatch.Draw(dustParticles.Texture,
- new Vector2(cam.WorldViewCenter.X, -cam.WorldViewCenter.Y),
- dustParticles.SourceRect, Color.White * alpha, 0.0f,
- new Vector2(cam.WorldView.Width, cam.WorldView.Height) * 0.5f / scale, scale, SpriteEffects.None, 1.0f - scale);
+ Rectangle srcRect = new Rectangle(0, 0, 2048, 2048);
+ dustParticles.DrawTiled(spriteBatch, origin + offsetS, new Vector2(cam.WorldView.Width - offsetS.X, cam.WorldView.Height - offsetS.Y), Vector2.Zero, srcRect, Color.White * alpha, new Vector2(scale));
}
spriteBatch.End();
diff --git a/Barotrauma/BarotraumaClient/Source/Map/Levels/WaterRenderer.cs b/Barotrauma/BarotraumaClient/Source/Map/Levels/WaterRenderer.cs
index 130b41319..723a45e92 100644
--- a/Barotrauma/BarotraumaClient/Source/Map/Levels/WaterRenderer.cs
+++ b/Barotrauma/BarotraumaClient/Source/Map/Levels/WaterRenderer.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -13,7 +13,11 @@ namespace Barotrauma
public VertexPositionTexture[] vertices = new VertexPositionTexture[DefaultBufferSize];
- private Effect waterEffect;
+ public Effect waterEffect
+ {
+ get;
+ private set;
+ }
private BasicEffect basicEffect;
public int PositionInBuffer = 0;
@@ -93,7 +97,7 @@ namespace Barotrauma
basicEffect.CurrentTechnique.Passes[0].Apply();
- graphicsDevice.SamplerStates[0] = SamplerState.LinearWrap;
+ graphicsDevice.SamplerStates[0] = SamplerState.PointWrap;
graphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length / 3);
}
diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs
index aded0f755..38f9ef2e7 100644
--- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs
+++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
using System.Linq;
@@ -23,7 +23,17 @@ namespace Barotrauma.Lights
public Color AmbientLight;
- RenderTarget2D lightMap, losTexture;
+ private float lightmapScale = 0.5f;
+ public RenderTarget2D lightMap
+ {
+ get;
+ private set;
+ }
+ public RenderTarget2D losTexture
+ {
+ get;
+ private set;
+ }
BasicEffect lightEffect;
@@ -36,8 +46,9 @@ namespace Barotrauma.Lights
public bool LightingEnabled = true;
public bool ObstructVision;
+ LightSource losSource;
- private Texture2D visionCircle;
+ private Sprite visionCircle;
private Dictionary hullAmbientLights;
private Dictionary smoothedHullAmbientLights;
@@ -50,21 +61,26 @@ namespace Barotrauma.Lights
AmbientLight = new Color(20, 20, 20, 255);
- visionCircle = Sprite.LoadTexture("Content/Lights/visioncircle.png");
+ //visionCircle = Sprite.LoadTexture("Content/Lights/visioncircle.png");
+ visionCircle = new Sprite("Content/Lights/visioncircle.png", new Vector2(0.2f, 0.5f));
var pp = graphics.PresentationParameters;
lightMap = new RenderTarget2D(graphics,
- GameMain.GraphicsWidth, GameMain.GraphicsHeight, false,
+ (int)(GameMain.GraphicsWidth*lightmapScale), (int)(GameMain.GraphicsHeight*lightmapScale), false,
pp.BackBufferFormat, pp.DepthStencilFormat, pp.MultiSampleCount,
RenderTargetUsage.DiscardContents);
- losTexture = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
+ losTexture = new RenderTarget2D(graphics, (int)(GameMain.GraphicsWidth*lightmapScale), (int)(GameMain.GraphicsHeight*lightmapScale), false, SurfaceFormat.Alpha8, DepthFormat.None);
+
+ losSource = new LightSource(Vector2.Zero, GameMain.GraphicsWidth, Color.White, null, false);
+ losSource.texture = new Texture2D(graphics, 1, 1);
+ losSource.texture.SetData(new Color[] { Color.White });// fill the texture with white
if (lightEffect == null)
{
lightEffect = new BasicEffect(GameMain.Instance.GraphicsDevice);
- lightEffect.VertexColorEnabled = false;
+ lightEffect.VertexColorEnabled = true;
lightEffect.TextureEnabled = true;
lightEffect.Texture = LightSource.LightTexture;
@@ -141,9 +157,9 @@ namespace Barotrauma.Lights
//clear to some small ambient light
graphics.Clear(AmbientLight);
graphics.BlendState = BlendState.Additive;
+
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, cam.Transform * Matrix.CreateScale(new Vector3(lightmapScale, lightmapScale, 1.0f)));
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, cam.Transform);
-
Matrix transform = cam.ShaderTransform
* Matrix.CreateOrthographic(GameMain.GraphicsWidth, GameMain.GraphicsHeight, -1, 1) * 0.5f;
@@ -158,7 +174,7 @@ namespace Barotrauma.Lights
}
lightEffect.World = Matrix.CreateTranslation(offset) * transform;
-
+
GameMain.ParticleManager.Draw(spriteBatch, false, null, Particles.ParticleBlendState.Additive);
if (Character.Controlled != null)
@@ -201,56 +217,43 @@ namespace Barotrauma.Lights
public void UpdateObstructVision(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, Vector2 lookAtPosition)
{
- if (!LosEnabled && !ObstructVision) return;
+ if (!LosEnabled || ViewTarget == null) return;
graphics.SetRenderTarget(losTexture);
- spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, cam.Transform);
+ //--------------------------------------
+ graphics.Clear(Color.Black);
if (ObstructVision)
{
- //graphics.Clear(Color.Black);
-
Vector2 diff = lookAtPosition - ViewTarget.WorldPosition;
- diff.Y = -diff.Y;
float rotation = MathUtils.VectorToAngle(diff);
-
- Vector2 scale = new Vector2(MathHelper.Clamp(diff.Length()/256.0f, 2.0f, 5.0f), 2.0f);
- spriteBatch.Draw(visionCircle, new Vector2(ViewTarget.WorldPosition.X, -ViewTarget.WorldPosition.Y), null, Color.White, rotation,
- new Vector2(LightSource.LightTexture.Width*0.2f, LightSource.LightTexture.Height/2), scale, SpriteEffects.None, 0.0f);
+ Vector2 scale = new Vector2(MathHelper.Clamp(diff.Length() / 256.0f, 2.0f, 5.0f), 2.0f) * 0.3f;
+
+ visionCircle.size = new Vector2(visionCircle.SourceRect.Width * scale.X, visionCircle.SourceRect.Height * scale.Y);
+ losSource.overrideLightTexture = visionCircle;
+ losSource.Rotation = rotation;
}
else
{
- graphics.Clear(Color.White);
+ losSource.overrideLightTexture = null;
}
- spriteBatch.End();
+ graphics.BlendState = BlendState.Additive;
- //--------------------------------------
+ Vector2 pos = ViewTarget.Position;
+ losSource.Position = pos;
+ losSource.NeedsRecalculation = true;
+ losSource.ParentSub = ViewTarget.Submarine;
- if (LosEnabled && ViewTarget != null)
- {
- Vector2 pos = ViewTarget.WorldPosition;
+ Matrix transform = cam.ShaderTransform
+ * Matrix.CreateOrthographic(GameMain.GraphicsWidth, GameMain.GraphicsHeight, -1, 1) * 0.5f;
+
+ losSource.Draw(spriteBatch, lightEffect, transform);
- Rectangle camView = new Rectangle(cam.WorldView.X, cam.WorldView.Y - cam.WorldView.Height, cam.WorldView.Width, cam.WorldView.Height);
+ graphics.BlendState = BlendState.AlphaBlend;
- Matrix shadowTransform = cam.ShaderTransform
- * Matrix.CreateOrthographic(GameMain.GraphicsWidth, GameMain.GraphicsHeight, -1, 1) * 0.5f;
-
- var convexHulls = ConvexHull.GetHullsInRange(viewTarget.Position, cam.WorldView.Width*0.75f, viewTarget.Submarine);
-
- if (convexHulls != null)
- {
- foreach (ConvexHull convexHull in convexHulls)
- {
- if (!convexHull.Intersects(camView)) continue;
- //if (!camView.Intersects(convexHull.BoundingBox)) continue;
-
- convexHull.DrawShadows(graphics, cam, pos, shadowTransform);
- }
- }
- }
graphics.SetRenderTarget(null);
}
@@ -338,22 +341,11 @@ namespace Barotrauma.Lights
{
if (!LightingEnabled) return;
- spriteBatch.Begin(SpriteSortMode.Deferred, CustomBlendStates.Multiplicative, null, null, null, effect);
- spriteBatch.Draw(lightMap, Vector2.Zero, Color.White);
+ spriteBatch.Begin(SpriteSortMode.Deferred, CustomBlendStates.Multiplicative, null, null, null, null);
+ spriteBatch.Draw(lightMap, new Rectangle(0,0,GameMain.GraphicsWidth,GameMain.GraphicsHeight), Color.White);
spriteBatch.End();
}
- public void DrawLOS(SpriteBatch spriteBatch, Effect effect,bool renderingBackground)
- {
- if (!LosEnabled || ViewTarget == null) return;
-
- spriteBatch.Begin(SpriteSortMode.Deferred, renderingBackground ? CustomBlendStates.LOS : CustomBlendStates.Multiplicative, null, null, null, effect);
- spriteBatch.Draw(losTexture, Vector2.Zero, Color.White);
- spriteBatch.End();
-
- if (!renderingBackground) ObstructVision = false;
- }
-
public void ClearLights()
{
lights.Clear();
@@ -376,16 +368,10 @@ namespace Barotrauma.Lights
MultiplyWithAlpha = new BlendState();
MultiplyWithAlpha.ColorDestinationBlend = MultiplyWithAlpha.AlphaDestinationBlend = Blend.One;
MultiplyWithAlpha.ColorSourceBlend = MultiplyWithAlpha.AlphaSourceBlend = Blend.DestinationAlpha;
-
- LOS = new BlendState();
- LOS.ColorSourceBlend = LOS.AlphaSourceBlend = Blend.Zero;
- LOS.ColorDestinationBlend = LOS.AlphaDestinationBlend = Blend.InverseSourceColor;
- LOS.ColorBlendFunction = LOS.AlphaBlendFunction = BlendFunction.Add;
}
public static BlendState Multiplicative { get; private set; }
public static BlendState WriteToAlpha { get; private set; }
public static BlendState MultiplyWithAlpha { get; private set; }
- public static BlendState LOS { get; private set; }
}
}
diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs
index b2ab034fc..77a8881ad 100644
--- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs
+++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightSource.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
@@ -17,8 +17,8 @@ namespace Barotrauma.Lights
private Color color;
private float range;
- private Sprite overrideLightTexture;
- private Texture2D texture;
+ public Sprite overrideLightTexture;
+ public Texture2D texture;
public Sprite LightSprite;
@@ -140,7 +140,7 @@ namespace Barotrauma.Lights
}
}
- public LightSource(Vector2 position, float range, Color color, Submarine submarine)
+ public LightSource(Vector2 position, float range, Color color, Submarine submarine, bool addLight=true)
{
hullsInRange = new List();
@@ -156,7 +156,7 @@ namespace Barotrauma.Lights
diffToSub = new Dictionary();
- GameMain.LightManager.AddLight(this);
+ if (addLight) GameMain.LightManager.AddLight(this);
}
/*public void DrawShadows(GraphicsDevice graphics, Camera cam, Matrix shadowTransform)
@@ -322,6 +322,7 @@ namespace Barotrauma.Lights
hulls.AddRange(chList.List);
}
+ float bounds = range*2;
//find convexhull segments that are close enough and facing towards the light source
List visibleSegments = new List();
List points = new List();
@@ -336,6 +337,10 @@ namespace Barotrauma.Lights
{
points.Add(s.Start);
points.Add(s.End);
+ if (Math.Abs(s.Start.WorldPos.X - drawPos.X) > bounds) bounds = Math.Abs(s.Start.WorldPos.X - drawPos.X);
+ if (Math.Abs(s.Start.WorldPos.Y - drawPos.Y) > bounds) bounds = Math.Abs(s.Start.WorldPos.Y - drawPos.Y);
+ if (Math.Abs(s.End.WorldPos.X - drawPos.X) > bounds) bounds = Math.Abs(s.End.WorldPos.X - drawPos.X);
+ if (Math.Abs(s.End.WorldPos.Y - drawPos.Y) > bounds) bounds = Math.Abs(s.End.WorldPos.Y - drawPos.Y);
}
}
@@ -344,14 +349,21 @@ namespace Barotrauma.Lights
//(might be more effective to calculate if we actually need these extra points)
var boundaryCorners = new List {
- new SegmentPoint(new Vector2(drawPos.X + range*2, drawPos.Y + range*2)),
- new SegmentPoint(new Vector2(drawPos.X + range*2, drawPos.Y - range*2)),
- new SegmentPoint(new Vector2(drawPos.X - range*2, drawPos.Y - range*2)),
- new SegmentPoint(new Vector2(drawPos.X - range*2, drawPos.Y + range*2))
+ new SegmentPoint(new Vector2(drawPos.X + bounds, drawPos.Y + bounds)),
+ new SegmentPoint(new Vector2(drawPos.X + bounds, drawPos.Y - bounds)),
+ new SegmentPoint(new Vector2(drawPos.X - bounds, drawPos.Y - bounds)),
+ new SegmentPoint(new Vector2(drawPos.X - bounds, drawPos.Y + bounds))
};
+ //points.Clear();
points.AddRange(boundaryCorners);
+ //visibleSegments.Clear();
+ for (int i=0;i<4;i++)
+ {
+ visibleSegments.Add(new Segment(boundaryCorners[i], boundaryCorners[(i + 1) % 4]));
+ }
+
var compareCCW = new CompareSegmentPointCW(drawPos);
try
{
@@ -368,14 +380,16 @@ namespace Barotrauma.Lights
}
List output = new List();
+ //List> preOutput = new List>();
//remove points that are very close to each other
for (int i = 0; i < points.Count - 1; i++)
{
- if (Math.Abs(points[i].WorldPos.X - points[i + 1].WorldPos.X) < 3 &&
- Math.Abs(points[i].WorldPos.Y - points[i + 1].WorldPos.Y) < 3)
+ if (Math.Abs(points[i].WorldPos.X - points[i + 1].WorldPos.X) < 6 &&
+ Math.Abs(points[i].WorldPos.Y - points[i + 1].WorldPos.Y) < 6)
{
points.RemoveAt(i + 1);
+ i--;
}
}
@@ -385,32 +399,52 @@ namespace Barotrauma.Lights
Vector2 dirNormal = new Vector2(-dir.Y, dir.X)*3;
//do two slightly offset raycasts to hit the segment itself and whatever's behind it
- Vector2 intersection1 = RayCast(drawPos, drawPos + dir * range * 2 - dirNormal, visibleSegments);
- Vector2 intersection2 = RayCast(drawPos, drawPos + dir * range * 2 + dirNormal, visibleSegments);
+ Pair intersection1 = RayCast(drawPos, drawPos + dir * bounds * 2 - dirNormal, visibleSegments);
+ Pair intersection2 = RayCast(drawPos, drawPos + dir * bounds * 2 + dirNormal, visibleSegments);
- //hit almost the same position -> only add one vertex to output
- if ((Math.Abs(intersection1.X - intersection2.X) < 5 &&
- Math.Abs(intersection1.Y - intersection2.Y) < 5))
+ if (intersection1.First < 0) return new List();
+ if (intersection2.First < 0) return new List();
+ Segment seg1 = visibleSegments[intersection1.First];
+ Segment seg2 = visibleSegments[intersection2.First];
+
+ bool isPoint1 = MathUtils.LineToPointDistance(seg1.Start.WorldPos, seg1.End.WorldPos, p.WorldPos) < 5.0f;
+ bool isPoint2 = MathUtils.LineToPointDistance(seg2.Start.WorldPos, seg2.End.WorldPos, p.WorldPos) < 5.0f;
+
+ //hit at the current segmentpoint -> place the segmentpoint into the list
+ if (isPoint1 && isPoint2)
{
- output.Add(intersection1);
+ output.Add(p.WorldPos);
}
- else
+ else if (intersection1.First != intersection2.First)
{
- output.Add(intersection1);
- output.Add(intersection2);
+ output.Add(isPoint1 ? p.WorldPos : intersection1.Second);
+ output.Add(isPoint2 ? p.WorldPos : intersection2.Second);
}
}
-
+
+ //remove points that are very close to each other
+ for (int i = 0; i < output.Count - 1; i++)
+ {
+ if (Math.Abs(output[i].X - output[i + 1].X) < 6 &&
+ Math.Abs(output[i].Y - output[i + 1].Y) < 6)
+ {
+ output.RemoveAt(i + 1);
+ i--;
+ }
+ }
+
return output;
}
- private Vector2 RayCast(Vector2 rayStart, Vector2 rayEnd, List segments)
+ private Pair RayCast(Vector2 rayStart, Vector2 rayEnd, List segments)
{
float closestDist = 0.0f;
Vector2? closestIntersection = null;
-
- foreach (Segment s in segments)
+ int segment = -1;
+
+ for (int i=0;i retVal = new Pair();
+ retVal.Second = closestIntersection == null ? rayEnd : (Vector2)closestIntersection;
+ retVal.First = segment;
+ return retVal;
}
private void CalculateLightVertices(List rayCastHits)
{
- List vertices = new List();
+ List vertices = new List();
Vector2 drawPos = position;
if (ParentSub != null) drawPos += ParentSub.DrawPosition;
@@ -446,16 +484,19 @@ namespace Barotrauma.Lights
}
// Add a vertex for the center of the mesh
- vertices.Add(new VertexPositionTexture(new Vector3(position.X, position.Y, 0),
- new Vector2(0.5f, 0.5f) + uvOffset));
+ vertices.Add(new VertexPositionColorTexture(new Vector3(position.X, position.Y, 0),
+ Color.White,new Vector2(0.5f, 0.5f) + uvOffset));
// Add all the other encounter points as vertices
// storing their world position as UV coordinates
- foreach (Vector2 vertex in rayCastHits)
+ for (int i = 0; i < rayCastHits.Count; i++)
{
+ Vector2 vertex = rayCastHits[i];
+ Vector2 prevVertex = rayCastHits[i > 0 ? i - 1 : rayCastHits.Count - 1];
+ Vector2 nextVertex = rayCastHits[i < rayCastHits.Count - 1 ? i + 1 : 0];
Vector2 rawDiff = vertex - drawPos;
Vector2 diff = rawDiff;
- diff /= range*2.0f;
+ diff /= range * 2.0f;
if (overrideLightTexture != null)
{
Vector2 originDiff = diff;
@@ -467,22 +508,52 @@ namespace Barotrauma.Lights
diff += uvOffset;
}
- vertices.Add(new VertexPositionTexture(new Vector3(position.X + rawDiff.X, position.Y + rawDiff.Y, 0),
- new Vector2(0.5f, 0.5f) + diff));
+ Vector2 nDiff1 = vertex - nextVertex;
+ float tx = nDiff1.X; nDiff1.X = -nDiff1.Y; nDiff1.Y = tx;
+ nDiff1 /= Math.Max(Math.Abs(nDiff1.X), Math.Abs(nDiff1.Y));
+ Vector2 nDiff2 = prevVertex - vertex;
+ tx = nDiff2.X; nDiff2.X = -nDiff2.Y; nDiff2.Y = tx;
+ nDiff2 /= Math.Max(Math.Abs(nDiff2.X),Math.Abs(nDiff2.Y));
+ Vector2 nDiff = nDiff1 + nDiff2;
+ nDiff /= Math.Max(Math.Abs(nDiff.X), Math.Abs(nDiff.Y));
+ nDiff *= 50.0f;
+ if (Vector2.DistanceSquared(nDiff, rawDiff) > Vector2.DistanceSquared(-nDiff, rawDiff)) nDiff = -nDiff;
+ VertexPositionColorTexture fadeVert = new VertexPositionColorTexture(new Vector3(position.X + rawDiff.X + nDiff.X, position.Y + rawDiff.Y + nDiff.Y, 0),
+ Color.White * 0.0f, new Vector2(0.5f, 0.5f) + diff);
+
+ vertices.Add(new VertexPositionColorTexture(new Vector3(position.X + rawDiff.X, position.Y + rawDiff.Y, 0),
+ Color.White, new Vector2(0.5f, 0.5f) + diff));
+ vertices.Add(fadeVert);
}
// Compute the indices to form triangles
List indices = new List();
- for (int i = 0; i < rayCastHits.Count - 1; i++)
+ for (int i = 0; i < rayCastHits.Count-1; i++)
{
indices.Add(0);
- indices.Add((short)((i + 2) % vertices.Count));
- indices.Add((short)((i + 1) % vertices.Count));
+ indices.Add((short)((i*2 + 3) % vertices.Count));
+ indices.Add((short)((i*2 + 1) % vertices.Count));
+
+ indices.Add((short)((i*2 + 1) % vertices.Count));
+ indices.Add((short)((i*2 + 3) % vertices.Count));
+ indices.Add((short)((i*2 + 4) % vertices.Count));
+
+ indices.Add((short)((i*2 + 2) % vertices.Count));
+ indices.Add((short)((i*2 + 1) % vertices.Count));
+ indices.Add((short)((i*2 + 4) % vertices.Count));
}
indices.Add(0);
indices.Add((short)(1));
- indices.Add((short)(vertices.Count - 1));
+ indices.Add((short)(vertices.Count - 2));
+
+ indices.Add((short)(1));
+ indices.Add((short)(vertices.Count-1));
+ indices.Add((short)(vertices.Count-2));
+
+ indices.Add((short)(1));
+ indices.Add((short)(2));
+ indices.Add((short)(vertices.Count-1));
vertexCount = vertices.Count;
indexCount = indices.Count;
@@ -491,19 +562,19 @@ namespace Barotrauma.Lights
//now we just create a buffer for 64 verts and make it larger if needed
if (lightVolumeBuffer == null)
{
- lightVolumeBuffer = new DynamicVertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionTexture.VertexDeclaration, Math.Max(64, (int)(vertexCount*1.5)), BufferUsage.None);
+ lightVolumeBuffer = new DynamicVertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionColorTexture.VertexDeclaration, Math.Max(64, (int)(vertexCount*1.5)), BufferUsage.None);
lightVolumeIndexBuffer = new DynamicIndexBuffer(GameMain.Instance.GraphicsDevice, typeof(short), Math.Max(64*3, (int)(indexCount * 1.5)), BufferUsage.None);
}
- else if (vertexCount > lightVolumeBuffer.VertexCount)
+ else if (vertexCount > lightVolumeBuffer.VertexCount || indexCount > lightVolumeIndexBuffer.IndexCount)
{
lightVolumeBuffer.Dispose();
lightVolumeIndexBuffer.Dispose();
- lightVolumeBuffer = new DynamicVertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionTexture.VertexDeclaration, (int)(vertexCount*1.5), BufferUsage.None);
+ lightVolumeBuffer = new DynamicVertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionColorTexture.VertexDeclaration, (int)(vertexCount*1.5), BufferUsage.None);
lightVolumeIndexBuffer = new DynamicIndexBuffer(GameMain.Instance.GraphicsDevice, typeof(short), (int)(indexCount * 1.5), BufferUsage.None);
}
-
- lightVolumeBuffer.SetData(vertices.ToArray());
+
+ lightVolumeBuffer.SetData(vertices.ToArray());
lightVolumeIndexBuffer.SetData(indices.ToArray());
}
@@ -562,7 +633,7 @@ namespace Barotrauma.Lights
}
else
{
- lightEffect.Texture = LightTexture;
+ lightEffect.Texture = texture??LightTexture;
}
lightEffect.CurrentTechnique.Passes[0].Apply();
@@ -571,6 +642,7 @@ namespace Barotrauma.Lights
GameMain.Instance.GraphicsDevice.DrawIndexedPrimitives
(
+ //PrimitiveType.LineList, 0, 0, indexCount / 2
PrimitiveType.TriangleList, 0, 0, indexCount / 3
);
}
diff --git a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs
index 8052b89d4..25a2ea8b8 100644
--- a/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs
+++ b/Barotrauma/BarotraumaClient/Source/Networking/GameClient.cs
@@ -974,8 +974,14 @@ namespace Barotrauma.Networking
private void ReadIngameUpdate(NetIncomingMessage inc)
{
+ List entities = new List();
+
float sendingTime = inc.ReadFloat() - inc.SenderConnection.RemoteTimeOffset;
+ ServerNetObject? prevObjHeader = null;
+ long prevBitPos = 0;
+ long prevBytePos = 0;
+
ServerNetObject objHeader;
while ((objHeader = (ServerNetObject)inc.ReadByte()) != ServerNetObject.END_OF_MESSAGE)
{
@@ -1004,15 +1010,51 @@ namespace Barotrauma.Networking
break;
case ServerNetObject.ENTITY_EVENT:
case ServerNetObject.ENTITY_EVENT_INITIAL:
- entityEventManager.Read(objHeader, inc, sendingTime);
+ entityEventManager.Read(objHeader, inc, sendingTime, entities);
break;
case ServerNetObject.CHAT_MESSAGE:
ChatMessage.ClientRead(inc);
break;
default:
DebugConsole.ThrowError("Error while reading update from server (unknown object header \""+objHeader+"\"!)");
+ if (prevObjHeader != null)
+ {
+ DebugConsole.ThrowError("Previous object type: " + prevObjHeader.ToString());
+ }
+ else
+ {
+ DebugConsole.ThrowError("Error occurred on the very first object!");
+ }
+ DebugConsole.ThrowError("Previous object was " + (inc.Position - prevBitPos) + " bits long (" + (inc.PositionInBytes - prevBytePos) + " bytes)");
+ if (prevObjHeader == ServerNetObject.ENTITY_EVENT || prevObjHeader == ServerNetObject.ENTITY_EVENT_INITIAL)
+ {
+ foreach (IServerSerializable ent in entities)
+ {
+ if (ent == null)
+ {
+ DebugConsole.ThrowError(" - NULL");
+ continue;
+ }
+ Entity e = ent as Entity;
+ DebugConsole.ThrowError(" - "+e.ToString());
+ }
+ }
+ DebugConsole.ThrowError("Writing object data to \"crashreport_object.bin\", please send this file to us at http://github.com/Regalis11/Barotrauma/issues");
+
+ FileStream fl = File.Open("crashreport_object.bin", FileMode.Create);
+ BinaryWriter sw = new BinaryWriter(fl);
+
+ sw.Write(inc.Data, (int)prevBytePos, (int)(inc.LengthBytes - prevBytePos));
+
+ sw.Close();
+ fl.Close();
+
+ throw new Exception("Error while reading update from server: please send us \"crashreport_object.bin\"!");
break;
}
+ prevObjHeader = objHeader;
+ prevBitPos = inc.Position;
+ prevBytePos = inc.PositionInBytes;
}
}
diff --git a/Barotrauma/BarotraumaClient/Source/Networking/NetEntityEvent/ClientEntityEventManager.cs b/Barotrauma/BarotraumaClient/Source/Networking/NetEntityEvent/ClientEntityEventManager.cs
index 464166a39..a66c0bf2b 100644
--- a/Barotrauma/BarotraumaClient/Source/Networking/NetEntityEvent/ClientEntityEventManager.cs
+++ b/Barotrauma/BarotraumaClient/Source/Networking/NetEntityEvent/ClientEntityEventManager.cs
@@ -100,7 +100,7 @@ namespace Barotrauma.Networking
///
/// Read the events from the message, ignoring ones we've already received
///
- public void Read(ServerNetObject type, NetIncomingMessage msg, float sendingTime)
+ public void Read(ServerNetObject type, NetIncomingMessage msg, float sendingTime, List entities)
{
UInt16 unreceivedEntityEventCount = 0;
@@ -128,6 +128,8 @@ namespace Barotrauma.Networking
firstNewID = null;
}
+ entities.Clear();
+
UInt16 firstEventID = msg.ReadUInt16();
int eventCount = msg.ReadByte();
@@ -146,6 +148,7 @@ namespace Barotrauma.Networking
byte msgLength = msg.ReadByte();
IServerSerializable entity = Entity.FindEntityByID(entityID) as IServerSerializable;
+ entities.Add(entity);
//skip the event if we've already received it or if the entity isn't found
if (thisEventID != (UInt16)(lastReceivedID + 1) || entity == null)
diff --git a/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs b/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs
index 1d11736b0..8272abf7c 100644
--- a/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs
+++ b/Barotrauma/BarotraumaClient/Source/Particles/Particle.cs
@@ -258,7 +258,7 @@ namespace Barotrauma.Particles
}
else
{
- Hull newHull = Hull.FindHull(position);
+ Hull newHull = Hull.FindHull(position,currentHull);
if (newHull != currentHull)
{
currentHull = newHull;
diff --git a/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs
index eb1e61524..805a27139 100644
--- a/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs
+++ b/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -14,7 +14,7 @@ namespace Barotrauma
readonly RenderTarget2D renderTargetBackground;
readonly RenderTarget2D renderTarget;
readonly RenderTarget2D renderTargetWater;
- readonly RenderTarget2D renderTargetAir;
+ readonly RenderTarget2D renderTargetFinal;
private Effect damageEffect;
@@ -27,9 +27,9 @@ namespace Barotrauma
cam.Translate(new Vector2(-10.0f, 50.0f));
renderTargetBackground = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
- renderTarget = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
+ renderTarget = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight, false, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.PreserveContents);
renderTargetWater = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
- renderTargetAir = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight);
+ renderTargetFinal = new RenderTarget2D(graphics, GameMain.GraphicsWidth, GameMain.GraphicsHeight, false, SurfaceFormat.Color, DepthFormat.None);
#if LINUX
@@ -97,7 +97,6 @@ namespace Barotrauma
public void DrawMap(GraphicsDevice graphics, SpriteBatch spriteBatch)
{
-
foreach (Submarine sub in Submarine.Loaded)
{
sub.UpdateTransform();
@@ -113,197 +112,137 @@ namespace Barotrauma
GameMain.LightManager.UpdateObstructVision(graphics, spriteBatch, cam, Character.Controlled.CursorWorldPosition);
}
- //----------------------------------------------------------------------------------------
- //1. draw the background, characters and the parts of the submarine that are behind them
- //----------------------------------------------------------------------------------------
-
graphics.SetRenderTarget(renderTargetBackground);
-
if (Level.Loaded == null)
{
graphics.Clear(new Color(11, 18, 26, 255));
}
else
{
+ //graphics.Clear(new Color(255, 255, 255, 255));
Level.Loaded.DrawBack(graphics, spriteBatch, cam);
}
- //draw structures that are in water and not part of any sub (e.g. ruins)
- spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, null, null, cam.Transform);
- Submarine.DrawBack(spriteBatch, false, s => s is Structure && s.Submarine == null);
- spriteBatch.End();
-
- //draw alpha blended particles that are in water and behind subs
+ //draw alpha blended particles that are in water and behind subs
#if LINUX
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, DepthStencilState.DepthRead, null, null, cam.Transform);
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, DepthStencilState.None, null, null, cam.Transform);
#else
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.DepthRead, null, null, cam.Transform);
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.None, null, null, cam.Transform);
#endif
- GameMain.ParticleManager.Draw(spriteBatch, true, false, Particles.ParticleBlendState.AlphaBlend);
- spriteBatch.End();
-
- //draw additive particles that are in water and behind subs
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.Default, null, null, cam.Transform);
- GameMain.ParticleManager.Draw(spriteBatch, true, false, Particles.ParticleBlendState.Additive);
- spriteBatch.End();
-
- //draw submarine structures that are behind water
- spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, null, null, null, cam.Transform);
- Submarine.DrawBack(spriteBatch, false, s => s is Structure && s.Submarine != null);
- spriteBatch.End();
+ GameMain.ParticleManager.Draw(spriteBatch, true, false, Particles.ParticleBlendState.AlphaBlend);
+ spriteBatch.End();
+ //draw additive particles that are in water and behind subs
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.None, null, null, cam.Transform);
+ GameMain.ParticleManager.Draw(spriteBatch, true, false, Particles.ParticleBlendState.Additive);
+ spriteBatch.End();
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.None, null, null, cam.Transform);
+ Submarine.DrawBack(spriteBatch, false, s => s is Structure && ((Structure)s).ResizeVertical && ((Structure)s).ResizeHorizontal);
+ foreach (Structure s in Structure.WallList)
+ {
+ if ((s.ResizeVertical != s.ResizeHorizontal) && s.CastShadow)
+ {
+ GUI.DrawRectangle(spriteBatch, new Vector2(s.DrawPosition.X-s.WorldRect.Width/2,-s.DrawPosition.Y-s.WorldRect.Height/2), new Vector2(s.WorldRect.Width, s.WorldRect.Height), Color.Black, true);
+ }
+ }
+ spriteBatch.End();
graphics.SetRenderTarget(renderTarget);
-
- spriteBatch.Begin(SpriteSortMode.Deferred,
- BlendState.Opaque);
- spriteBatch.Draw(renderTargetBackground, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
- spriteBatch.End();
-
- spriteBatch.Begin(SpriteSortMode.BackToFront,
- BlendState.AlphaBlend,
- null, null, null, null,
- cam.Transform);
-
- Submarine.DrawBack(spriteBatch, false, s => !(s is Structure));
-
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.None, null, null, null);
+ spriteBatch.Draw(renderTargetBackground, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
+ spriteBatch.End();
+ spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, null, DepthStencilState.None, null, null, cam.Transform);
+ Submarine.DrawBack(spriteBatch, false, s => !(s is Structure));
+ Submarine.DrawBack(spriteBatch, false, s => s is Structure && !(((Structure)s).ResizeVertical && ((Structure)s).ResizeHorizontal));
foreach (Character c in Character.CharacterList) c.Draw(spriteBatch);
-
spriteBatch.End();
-
- //----------------------------------------------------------------------------------------
- //draw the rendertarget and particles that are only supposed to be drawn in water into renderTargetWater
- graphics.SetRenderTarget(renderTargetWater);
-
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque);
- spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), waterColor);
- spriteBatch.End();
-
- //draw alpha blended particles that are inside a sub
-#if LINUX
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, DepthStencilState.DepthRead, null, null, cam.Transform);
-#else
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.DepthRead, null, null, cam.Transform);
-#endif
- GameMain.ParticleManager.Draw(spriteBatch, true, true, Particles.ParticleBlendState.AlphaBlend);
- spriteBatch.End();
-
- //draw additive particles that are inside a sub
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.Default, null, null, cam.Transform);
- GameMain.ParticleManager.Draw(spriteBatch, true, true, Particles.ParticleBlendState.Additive);
- spriteBatch.End();
-
- //----------------------------------------------------------------------------------------
- //draw the rendertarget and particles that are only supposed to be drawn in air into renderTargetAir
-
- graphics.SetRenderTarget(renderTargetAir);
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque);
- spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
- spriteBatch.End();
-
- //draw alpha blended particles that are not in water
-#if LINUX
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, DepthStencilState.DepthRead, null, null, cam.Transform);
-#else
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.DepthRead, null, null, cam.Transform);
-#endif
- GameMain.ParticleManager.Draw(spriteBatch, false, null, Particles.ParticleBlendState.AlphaBlend);
- spriteBatch.End();
-
- //draw additive particles that are not in water
- spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.DepthRead, null, null, cam.Transform);
- GameMain.ParticleManager.Draw(spriteBatch, false, null, Particles.ParticleBlendState.Additive);
- spriteBatch.End();
-
- if (Character.Controlled != null && GameMain.LightManager.LosEnabled)
- {
- graphics.SetRenderTarget(renderTarget);
- spriteBatch.Begin(SpriteSortMode.Deferred,
- BlendState.Opaque, null, null, null, lightBlur.Effect);
-
- spriteBatch.Draw(renderTargetBackground, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
-
- spriteBatch.End();
-
- spriteBatch.Begin(SpriteSortMode.BackToFront,
- BlendState.AlphaBlend, SamplerState.LinearWrap,
- null, null, null,
- cam.Transform);
-
- Submarine.DrawDamageable(spriteBatch, null, false);
- Submarine.DrawFront(spriteBatch, false, s => s is Structure);
-
- spriteBatch.End();
-
- GameMain.LightManager.DrawLOS(spriteBatch, lightBlur.Effect, true);
- }
-
- graphics.SetRenderTarget(null);
-
- //----------------------------------------------------------------------------------------
- //2. pass the renderTarget to the water shader to do the water effect
- //----------------------------------------------------------------------------------------
-
- Hull.renderer.RenderBack(spriteBatch, renderTargetWater);
-
- Array.Clear(Hull.renderer.vertices, 0, Hull.renderer.vertices.Length);
- Hull.renderer.PositionInBuffer = 0;
- foreach (Hull hull in Hull.hullList)
- {
- hull.Render(graphics, cam);
- }
-
- Hull.renderer.Render(graphics, cam, renderTargetAir, Cam.ShaderTransform);
-
- //----------------------------------------------------------------------------------------
- //3. draw the sections of the map that are on top of the water
- //----------------------------------------------------------------------------------------
-
- spriteBatch.Begin(SpriteSortMode.BackToFront,
- BlendState.AlphaBlend, SamplerState.LinearWrap,
- null, null, null,
- cam.Transform);
+ spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, null, null, cam.Transform);
Submarine.DrawFront(spriteBatch, false, null);
-
spriteBatch.End();
- spriteBatch.Begin(SpriteSortMode.Immediate,
- BlendState.NonPremultiplied, SamplerState.LinearWrap,
- null, null,
- damageEffect,
- cam.Transform);
+ //draw the rendertarget and particles that are only supposed to be drawn in water into renderTargetWater
+ graphics.SetRenderTarget(renderTargetWater);
- Submarine.DrawDamageable(spriteBatch, damageEffect, false);
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque);
+ spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), waterColor);
+ spriteBatch.End();
- spriteBatch.End();
+ //draw alpha blended particles that are inside a sub
+#if LINUX
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, DepthStencilState.DepthRead, null, null, cam.Transform);
+#else
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.DepthRead, null, null, cam.Transform);
+#endif
+ GameMain.ParticleManager.Draw(spriteBatch, true, true, Particles.ParticleBlendState.AlphaBlend);
+ spriteBatch.End();
- GameMain.LightManager.DrawLightMap(spriteBatch, lightBlur.Effect);
+ graphics.SetRenderTarget(renderTarget);
- spriteBatch.Begin(SpriteSortMode.BackToFront,
- BlendState.AlphaBlend, SamplerState.LinearWrap,
- null, null, null,
- cam.Transform);
+ //draw alpha blended particles that are not in water
+#if LINUX
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, null, DepthStencilState.DepthRead, null, null, cam.Transform);
+#else
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, DepthStencilState.DepthRead, null, null, cam.Transform);
+#endif
+ GameMain.ParticleManager.Draw(spriteBatch, false, null, Particles.ParticleBlendState.AlphaBlend);
+ spriteBatch.End();
- if (Level.Loaded != null) Level.Loaded.DrawFront(spriteBatch);
+ //draw additive particles that are not in water
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.None, null, null, cam.Transform);
+ GameMain.ParticleManager.Draw(spriteBatch, false, null, Particles.ParticleBlendState.Additive);
+ spriteBatch.End();
- foreach (Character c in Character.CharacterList) c.DrawFront(spriteBatch, cam);
+ graphics.SetRenderTarget(renderTargetFinal);
+ Hull.renderer.RenderBack(spriteBatch, renderTargetWater);
- spriteBatch.End();
+ Array.Clear(Hull.renderer.vertices, 0, Hull.renderer.vertices.Length);
+ Hull.renderer.PositionInBuffer = 0;
+ foreach (Hull hull in Hull.hullList)
+ {
+ hull.Render(graphics, cam);
+ }
- if (Character.Controlled != null && GameMain.LightManager.LosEnabled)
- {
- GameMain.LightManager.DrawLOS(spriteBatch, lightBlur.Effect, false);
+ Hull.renderer.Render(graphics, cam, renderTarget, Cam.ShaderTransform);
- spriteBatch.Begin(SpriteSortMode.Immediate,
- BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, RasterizerState.CullNone, null);
+ spriteBatch.Begin(SpriteSortMode.Immediate,
+ BlendState.NonPremultiplied, SamplerState.LinearWrap,
+ null, null,
+ damageEffect,
+ cam.Transform);
+ Submarine.DrawDamageable(spriteBatch, damageEffect, false);
+ spriteBatch.End();
- float r = Math.Min(CharacterHUD.damageOverlayTimer * 0.5f, 0.5f);
- spriteBatch.Draw(renderTarget, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
- Color.Lerp(GameMain.LightManager.AmbientLight * 0.5f, Color.Red, r));
+ //draw additive particles that are inside a sub
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.Default, null, null, cam.Transform);
+ GameMain.ParticleManager.Draw(spriteBatch, true, true, Particles.ParticleBlendState.Additive);
+ spriteBatch.End();
+ if (GameMain.LightManager.LightingEnabled)
+ {
+ spriteBatch.Begin(SpriteSortMode.Deferred, Lights.CustomBlendStates.Multiplicative, null, DepthStencilState.None, null, null, null);
+ spriteBatch.Draw(GameMain.LightManager.lightMap, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
+ spriteBatch.End();
+ }
- spriteBatch.End();
- }
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap, DepthStencilState.None, null, null, cam.Transform);
+ foreach (Character c in Character.CharacterList) c.DrawFront(spriteBatch, cam);
+ if (Level.Loaded != null) Level.Loaded.DrawFront(spriteBatch);
+ spriteBatch.End();
+
+ graphics.SetRenderTarget(null);
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.None, null, null, null);
+ if (GameMain.LightManager.LosEnabled && Character.Controlled!=null)
+ {
+ float r = Math.Min(CharacterHUD.damageOverlayTimer * 0.5f, 0.5f);
+ spriteBatch.Draw(renderTargetBackground, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
+ Color.Lerp(GameMain.LightManager.AmbientLight * 0.5f, Color.Red, r));
+ spriteBatch.End();
+ Hull.renderer.waterEffect.CurrentTechnique = Hull.renderer.waterEffect.Techniques["LosShader"];
+ Hull.renderer.waterEffect.Parameters["xLosTexture"].SetValue(GameMain.LightManager.losTexture);
+ spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.None, null, Hull.renderer.waterEffect, null);
+ }
+ spriteBatch.Draw(renderTargetFinal, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
+ spriteBatch.End();
}
}
}
diff --git a/Barotrauma/BarotraumaClient/Source/Screens/ParticleEditorScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/ParticleEditorScreen.cs
index e13245f55..3e531ce7d 100644
--- a/Barotrauma/BarotraumaClient/Source/Screens/ParticleEditorScreen.cs
+++ b/Barotrauma/BarotraumaClient/Source/Screens/ParticleEditorScreen.cs
@@ -15,10 +15,10 @@ namespace Barotrauma
class Emitter : ISerializableEntity
{
public float EmitTimer;
-
+
[Editable(), Serialize("0.0,0.0", false)]
public Vector2 AngleRange { get; private set; }
-
+
[Editable(), Serialize("0.0,0.0", false)]
public Vector2 VelocityRange { get; private set; }
@@ -76,7 +76,7 @@ namespace Barotrauma
cam = new Camera();
guiRoot = new GUIFrame(Rectangle.Empty, null, null);
-
+
leftPanel = new GUIFrame(new Rectangle(0, 0, 150, GameMain.GraphicsHeight), "GUIFrameLeft", guiRoot);
leftPanel.Padding = new Vector4(10.0f, 20.0f, 10.0f, 20.0f);
@@ -150,7 +150,7 @@ namespace Barotrauma
}
private void SerializeAll()
- {
+ {
XDocument doc = XMLExtensions.TryLoadXml(GameMain.ParticleManager.ConfigFile);
if (doc == null || doc.Root == null) return;
@@ -179,6 +179,7 @@ namespace Barotrauma
private void SerializeToClipboard(ParticlePrefab prefab)
{
+#if WINDOWS
if (prefab == null) return;
XmlWriterSettings settings = new XmlWriterSettings();
@@ -197,6 +198,7 @@ namespace Barotrauma
}
Clipboard.SetText(sb.ToString());
+#endif
}
public override void Update(double deltaTime)
diff --git a/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs
index 35c5a36f0..cf5bae8cb 100644
--- a/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs
+++ b/Barotrauma/BarotraumaClient/Source/Screens/SubEditorScreen.cs
@@ -901,7 +901,305 @@ namespace Barotrauma
previouslyUsedList.RemoveChild(textBlock);
previouslyUsedList.children.Insert(0, textBlock);
}
+
+ public void AutoHull()
+ {
+ for (int i = 0; i < MapEntity.mapEntityList.Count; i++)
+ {
+ MapEntity h = MapEntity.mapEntityList[i];
+ if (h is Hull || h is Gap)
+ {
+ h.Remove();
+ i--;
+ }
+ }
+ List wallPoints = new List();
+ Vector2 min = Vector2.Zero;
+ Vector2 max = Vector2.Zero;
+
+ List mapEntityList = new List();
+
+ foreach (MapEntity e in MapEntity.mapEntityList)
+ {
+ if (e is Item)
+ {
+ Item it = e as Item;
+ Door door = it.GetComponent();
+ if (door != null)
+ {
+ int halfW = e.WorldRect.Width / 2;
+ wallPoints.Add(new Vector2(e.WorldRect.X + halfW, -e.WorldRect.Y + e.WorldRect.Height));
+ mapEntityList.Add(it);
+ }
+ continue;
+ }
+
+ if (!(e is Structure)) continue;
+ Structure s = e as Structure;
+ if (!s.HasBody) continue;
+ mapEntityList.Add(e);
+
+ if (e.Rect.Width > e.Rect.Height)
+ {
+ int halfH = e.WorldRect.Height / 2;
+ wallPoints.Add(new Vector2(e.WorldRect.X, -e.WorldRect.Y + halfH));
+ wallPoints.Add(new Vector2(e.WorldRect.X + e.WorldRect.Width, -e.WorldRect.Y + halfH));
+ }
+ else
+ {
+ int halfW = e.WorldRect.Width / 2;
+ wallPoints.Add(new Vector2(e.WorldRect.X + halfW, -e.WorldRect.Y));
+ wallPoints.Add(new Vector2(e.WorldRect.X + halfW, -e.WorldRect.Y + e.WorldRect.Height));
+ }
+ }
+
+ min = wallPoints[0];
+ max = wallPoints[0];
+ for (int i = 0; i < wallPoints.Count; i++)
+ {
+ min.X = Math.Min(min.X, wallPoints[i].X);
+ min.Y = Math.Min(min.Y, wallPoints[i].Y);
+ max.X = Math.Max(max.X, wallPoints[i].X);
+ max.Y = Math.Max(max.Y, wallPoints[i].Y);
+ }
+
+ List hullRects = new List();
+ hullRects.Add(new Rectangle((int)min.X, (int)min.Y, (int)(max.X - min.X), (int)(max.Y - min.Y)));
+ foreach (Vector2 point in wallPoints)
+ {
+ MathUtils.SplitRectanglesHorizontal(hullRects, point);
+ MathUtils.SplitRectanglesVertical(hullRects, point);
+ }
+
+ hullRects.Sort((a, b) =>
+ {
+ if (a.Y < b.Y) return -1;
+ if (a.Y > b.Y) return 1;
+ if (a.X < b.X) return -1;
+ if (a.X > b.X) return 1;
+ return 0;
+ });
+
+ for (int i = 0; i < hullRects.Count - 1; i++)
+ {
+ Rectangle rect = hullRects[i];
+ if (hullRects[i + 1].Y > rect.Y) continue;
+
+ Vector2 hullRPoint = new Vector2(rect.X + rect.Width - 8, rect.Y + rect.Height / 2);
+ Vector2 hullLPoint = new Vector2(rect.X, rect.Y + rect.Height / 2);
+
+ MapEntity container = null;
+ foreach (MapEntity e in mapEntityList)
+ {
+ Rectangle entRect = e.WorldRect;
+ entRect.Y = -entRect.Y;
+ if (entRect.Contains(hullRPoint))
+ {
+ if (!entRect.Contains(hullLPoint)) container = e;
+ break;
+ }
+ }
+ if (container == null)
+ {
+ rect.Width += hullRects[i + 1].Width;
+ hullRects[i] = rect;
+ hullRects.RemoveAt(i + 1);
+ i--;
+ }
+ }
+
+ foreach (MapEntity e in mapEntityList)
+ {
+ Rectangle entRect = e.WorldRect;
+ if (entRect.Width < entRect.Height) continue;
+ entRect.Y = -entRect.Y - 16;
+ for (int i = 0; i < hullRects.Count; i++)
+ {
+ Rectangle hullRect = hullRects[i];
+ if (entRect.Intersects(hullRect))
+ {
+ if (hullRect.Y < entRect.Y)
+ {
+ hullRect.Height = Math.Max((entRect.Y + 16 + entRect.Height / 2) - hullRect.Y, hullRect.Height);
+ hullRects[i] = hullRect;
+ }
+ else if (hullRect.Y + hullRect.Height <= entRect.Y + 16 + entRect.Height)
+ {
+ hullRects.RemoveAt(i);
+ i--;
+ }
+ }
+ }
+ }
+
+ foreach (MapEntity e in mapEntityList)
+ {
+ Rectangle entRect = e.WorldRect;
+ if (entRect.Width < entRect.Height) continue;
+ entRect.Y = -entRect.Y;
+ for (int i = 0; i < hullRects.Count; i++)
+ {
+ Rectangle hullRect = hullRects[i];
+ if (entRect.Intersects(hullRect))
+ {
+ if (hullRect.Y >= entRect.Y - 8 && hullRect.Y + hullRect.Height <= entRect.Y + entRect.Height + 8)
+ {
+ hullRects.RemoveAt(i);
+ i--;
+ }
+ }
+ }
+ }
+
+ for (int i = 0; i < hullRects.Count;)
+ {
+ Rectangle hullRect = hullRects[i];
+ Vector2 point = new Vector2(hullRect.X+2, hullRect.Y+hullRect.Height/2);
+ MapEntity container = null;
+ foreach (MapEntity e in mapEntityList)
+ {
+ Rectangle entRect = e.WorldRect;
+ entRect.Y = -entRect.Y;
+ if (entRect.Contains(point))
+ {
+ container = e;
+ break;
+ }
+ }
+ if (container == null)
+ {
+ hullRects.RemoveAt(i);
+ continue;
+ }
+
+ while (hullRects[i].Y <= hullRect.Y)
+ {
+ i++;
+ if (i >= hullRects.Count) break;
+ }
+ }
+
+ for (int i = hullRects.Count-1; i >= 0;)
+ {
+ Rectangle hullRect = hullRects[i];
+ Vector2 point = new Vector2(hullRect.X+hullRect.Width-2, hullRect.Y+hullRect.Height/2);
+ MapEntity container = null;
+ foreach (MapEntity e in mapEntityList)
+ {
+ Rectangle entRect = e.WorldRect;
+ entRect.Y = -entRect.Y;
+ if (entRect.Contains(point))
+ {
+ container = e;
+ break;
+ }
+ }
+ if (container == null)
+ {
+ hullRects.RemoveAt(i); i--;
+ continue;
+ }
+
+ while (hullRects[i].Y >= hullRect.Y)
+ {
+ i--;
+ if (i < 0) break;
+ }
+ }
+
+ hullRects.Sort((a, b) =>
+ {
+ if (a.X < b.X) return -1;
+ if (a.X > b.X) return 1;
+ if (a.Y < b.Y) return -1;
+ if (a.Y > b.Y) return 1;
+ return 0;
+ });
+
+ for (int i = 0; i < hullRects.Count - 1; i++)
+ {
+ Rectangle rect = hullRects[i];
+ if (hullRects[i + 1].Width != rect.Width) continue;
+ if (hullRects[i + 1].X > rect.X) continue;
+
+ Vector2 hullBPoint = new Vector2(rect.X + rect.Width / 2, rect.Y + rect.Height - 8);
+ Vector2 hullUPoint = new Vector2(rect.X + rect.Width / 2, rect.Y);
+
+ MapEntity container = null;
+ foreach (MapEntity e in mapEntityList)
+ {
+ Rectangle entRect = e.WorldRect;
+ entRect.Y = -entRect.Y;
+ if (entRect.Contains(hullBPoint))
+ {
+ if (!entRect.Contains(hullUPoint)) container = e;
+ break;
+ }
+ }
+ if (container == null)
+ {
+ rect.Height += hullRects[i + 1].Height;
+ hullRects[i] = rect;
+ hullRects.RemoveAt(i + 1);
+ i--;
+ }
+ }
+
+ for (int i = 0; i < hullRects.Count;i++)
+ {
+ Rectangle rect = hullRects[i];
+ rect.Y -= 16;
+ rect.Height += 32;
+ hullRects[i] = rect;
+ }
+
+ hullRects.Sort((a, b) =>
+ {
+ if (a.Y < b.Y) return -1;
+ if (a.Y > b.Y) return 1;
+ if (a.X < b.X) return -1;
+ if (a.X > b.X) return 1;
+ return 0;
+ });
+
+ for (int i = 0; i < hullRects.Count; i++)
+ {
+ for (int j = i+1; j < hullRects.Count; j++)
+ {
+ if (hullRects[j].Y <= hullRects[i].Y) continue;
+ if (hullRects[j].Intersects(hullRects[i]))
+ {
+ Rectangle rect = hullRects[i];
+ rect.Height = hullRects[j].Y - rect.Y;
+ hullRects[i] = rect;
+ break;
+ }
+ }
+ }
+
+ foreach (Rectangle rect in hullRects)
+ {
+ Rectangle hullRect = rect;
+ hullRect.Y = -hullRect.Y;
+ Hull newHull = new Hull(MapEntityPrefab.Find("Hull"),
+ hullRect,
+ Submarine.MainSub);
+ }
+
+ foreach (MapEntity e in mapEntityList)
+ {
+ if (!(e is Structure)) continue;
+ if (!(e as Structure).IsPlatform) continue;
+
+ Rectangle gapRect = e.WorldRect;
+ gapRect.Y -= 8;
+ gapRect.Height = 16;
+ Gap newGap = new Gap(MapEntityPrefab.Find("Gap"),
+ gapRect);
+ }
+ }
+
public override void AddToGUIUpdateList()
{
if (tutorial != null) tutorial.AddToGUIUpdateList();
diff --git a/Barotrauma/BarotraumaClient/Source/Sprite/Sprite.cs b/Barotrauma/BarotraumaClient/Source/Sprite/Sprite.cs
index 86bc750d0..6bbaae831 100644
--- a/Barotrauma/BarotraumaClient/Source/Sprite/Sprite.cs
+++ b/Barotrauma/BarotraumaClient/Source/Sprite/Sprite.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
@@ -186,18 +186,23 @@ namespace Barotrauma
public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Vector2 startOffset, Color color)
{
- DrawTiled(spriteBatch, pos, targetSize, startOffset, sourceRect, color);
+ DrawTiled(spriteBatch, pos, targetSize, startOffset, sourceRect, color, Vector2.One);
}
public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Vector2 startOffset, Rectangle sourceRect, Color color)
+ {
+ DrawTiled(spriteBatch, pos, targetSize, startOffset, sourceRect, color, Vector2.One);
+ }
+
+ public void DrawTiled(SpriteBatch spriteBatch, Vector2 pos, Vector2 targetSize, Vector2 startOffset, Rectangle sourceRect, Color color, Vector2 scale)
{
//pos.X = (int)pos.X;
//pos.Y = (int)pos.Y;
//how many times the texture needs to be drawn on the x-axis
- int xTiles = (int)Math.Ceiling((targetSize.X + startOffset.X) / sourceRect.Width);
+ int xTiles = (int)Math.Ceiling((targetSize.X + startOffset.X) / (sourceRect.Width*scale.X));
//how many times the texture needs to be drawn on the y-axis
- int yTiles = (int)Math.Ceiling((targetSize.Y + startOffset.Y) / sourceRect.Height);
+ int yTiles = (int)Math.Ceiling((targetSize.Y + startOffset.Y) / (sourceRect.Height*scale.Y));
Vector2 position = pos - startOffset;
Rectangle drawRect = sourceRect;
@@ -211,11 +216,11 @@ namespace Barotrauma
if (x == xTiles - 1)
{
- drawRect.Width -= (int)((position.X + sourceRect.Width) - (pos.X + targetSize.X));
+ drawRect.Width -= (int)((position.X + sourceRect.Width*scale.X) - (pos.X + targetSize.X));
}
else
{
- drawRect.Width = sourceRect.Width;
+ drawRect.Width = (int)(sourceRect.Width*scale.X);
}
if (position.X < pos.X)
@@ -234,11 +239,11 @@ namespace Barotrauma
if (y == yTiles - 1)
{
- drawRect.Height -= (int)((position.Y + sourceRect.Height) - (pos.Y + targetSize.Y));
+ drawRect.Height -= (int)((position.Y + sourceRect.Height*scale.Y) - (pos.Y + targetSize.Y));
}
else
{
- drawRect.Height = sourceRect.Height;
+ drawRect.Height = (int)(sourceRect.Height*scale.Y);
}
if (position.Y < pos.Y)
@@ -252,10 +257,10 @@ namespace Barotrauma
spriteBatch.Draw(texture, position,
drawRect, color, rotation, Vector2.Zero, 1.0f, effects, depth);
- position.Y += sourceRect.Height;
+ position.Y += sourceRect.Height*scale.Y;
}
- position.X += sourceRect.Width;
+ position.X += sourceRect.Width*scale.X;
}
}
diff --git a/Barotrauma/BarotraumaClient/Source/Utils/TextureLoader.cs b/Barotrauma/BarotraumaClient/Source/Utils/TextureLoader.cs
index 2e47ee19b..706c11878 100644
--- a/Barotrauma/BarotraumaClient/Source/Utils/TextureLoader.cs
+++ b/Barotrauma/BarotraumaClient/Source/Utils/TextureLoader.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Color = Microsoft.Xna.Framework.Color;
@@ -44,7 +44,7 @@ namespace Barotrauma
try
{
- using (Stream fileStream = File.OpenRead(path))
+ using (Stream fileStream = File.OpenRead(path))
{
var texture = Texture2D.FromStream(_graphicsDevice, fileStream);
texture = PreMultiplyAlpha(texture);
diff --git a/Barotrauma/BarotraumaClient/packages.config b/Barotrauma/BarotraumaClient/packages.config
index 826869719..30ca43382 100644
--- a/Barotrauma/BarotraumaClient/packages.config
+++ b/Barotrauma/BarotraumaClient/packages.config
@@ -1,7 +1,9 @@
+
+
\ No newline at end of file
diff --git a/Barotrauma/BarotraumaServer/BarotraumaServer.csproj b/Barotrauma/BarotraumaServer/BarotraumaServer.csproj
index 951b0ccf7..02a4df579 100644
--- a/Barotrauma/BarotraumaServer/BarotraumaServer.csproj
+++ b/Barotrauma/BarotraumaServer/BarotraumaServer.csproj
@@ -1,8 +1,8 @@
- Debug
- AnyCPU
+ ReleaseLinux
+ x86
{85232B20-074D-4723-B0C6-91495391E448}
Exe
Properties
@@ -27,30 +27,47 @@
false
false
true
-
-
- true
- ..\bin\Windows\Debug\
- TRACE;DEBUG;WINDOWS;SERVER
- full
- x86
- prompt
- MinimumRecommendedRules.ruleset
- true
-
-
- ..\bin\Windows\Release\
- TRACE;WINDOWS;SERVER
- true
- pdbonly
- x86
- prompt
- MinimumRecommendedRules.ruleset
- true
+ 0.7.0.1
..\BarotraumaShared\Icon.ico
+
+ true
+ pdbonly
+ true
+ ..\bin\ReleaseLinux
+ TRACE;SERVER
+ 4
+ x86
+
+
+ true
+ full
+ false
+ ..\bin\DebugLinux
+ TRACE;SERVER;DEBUG
+ 4
+ x86
+
+
+ true
+ pdbonly
+ true
+ ..\bin\ReleaseWindows
+ TRACE;SERVER
+ 4
+ x86
+
+
+ true
+ full
+ false
+ ..\bin\DebugWindows
+ TRACE;SERVER;DEBUG
+ 4
+ x86
+
False
diff --git a/Barotrauma/BarotraumaServer/Source/Program.cs b/Barotrauma/BarotraumaServer/Source/Program.cs
index 1cbe43ace..43b213379 100644
--- a/Barotrauma/BarotraumaServer/Source/Program.cs
+++ b/Barotrauma/BarotraumaServer/Source/Program.cs
@@ -5,14 +5,10 @@ using System.IO;
using System.Text;
using System.Threading;
-#if WINDOWS
-#endif
-
#endregion
namespace Barotrauma
{
-#if WINDOWS || LINUX
///
/// The main class.
///
@@ -86,5 +82,4 @@ namespace Barotrauma
sw.Close();
}
}
-#endif
}
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Color.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Color.cs
index c92c9138a..c34bdd284 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Color.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Color.cs
@@ -168,7 +168,7 @@ namespace Microsoft.Xna.Framework
// |-------|-------|-------|-------
// A B G R
private uint _packedValue;
-
+
///
/// Constructs an RGBA color from a packed value.
/// The value is a 32-bit unsigned integer, with R in the least significant octet.
@@ -384,8 +384,8 @@ namespace Microsoft.Xna.Framework
this._packedValue = (this._packedValue & 0x00ffffff) | ((uint)value << 24);
}
}
-
- ///
+
+ ///
/// Compares whether two instances are equal.
///
/// instance on the left of the equal sign.
@@ -395,13 +395,13 @@ namespace Microsoft.Xna.Framework
{
return (a._packedValue == b._packedValue);
}
-
- ///
+
+ ///
/// Compares whether two instances are not equal.
///
/// instance on the left of the not equal sign.
/// instance on the right of the not equal sign.
- /// true if the instances are not equal; false otherwise.
+ /// true if the instances are not equal; false otherwise.
public static bool operator !=(Color a, Color b)
{
return (a._packedValue != b._packedValue);
@@ -415,7 +415,7 @@ namespace Microsoft.Xna.Framework
{
return this._packedValue.GetHashCode();
}
-
+
///
/// Compares whether current instance is equal to specified object.
///
@@ -444,8 +444,8 @@ namespace Microsoft.Xna.Framework
get;
private set;
}
-
- ///
+
+ ///
/// AliceBlue color (R:240,G:248,B:255,A:255).
///
public static Color AliceBlue
@@ -466,13 +466,13 @@ namespace Microsoft.Xna.Framework
///
/// Aqua color (R:0,G:255,B:255,A:255).
///
- public static Color Aqua
+ public static Color Aqua
{
get;
private set;
}
-
- ///
+
+ ///
/// Aquamarine color (R:127,G:255,B:212,A:255).
///
public static Color Aquamarine
@@ -484,13 +484,13 @@ namespace Microsoft.Xna.Framework
///
/// Azure color (R:240,G:255,B:255,A:255).
///
- public static Color Azure
+ public static Color Azure
{
get;
private set;
}
-
- ///
+
+ ///
/// Beige color (R:245,G:245,B:220,A:255).
///
public static Color Beige
@@ -610,13 +610,13 @@ namespace Microsoft.Xna.Framework
///
/// Cornsilk color (R:255,G:248,B:220,A:255).
///
- public static Color Cornsilk
+ public static Color Cornsilk
{
get;
private set;
}
-
- ///
+
+ ///
/// Crimson color (R:220,G:20,B:60,A:255).
///
public static Color Crimson
@@ -637,13 +637,13 @@ namespace Microsoft.Xna.Framework
///
/// DarkBlue color (R:0,G:0,B:139,A:255).
///
- public static Color DarkBlue
+ public static Color DarkBlue
{
get;
private set;
}
-
- ///
+
+ ///
/// DarkCyan color (R:0,G:139,B:139,A:255).
///
public static Color DarkCyan
@@ -664,13 +664,13 @@ namespace Microsoft.Xna.Framework
///
/// DarkGray color (R:169,G:169,B:169,A:255).
///
- public static Color DarkGray
+ public static Color DarkGray
{
get;
private set;
}
-
- ///
+
+ ///
/// DarkGreen color (R:0,G:100,B:0,A:255).
///
public static Color DarkGreen
@@ -733,7 +733,7 @@ namespace Microsoft.Xna.Framework
private set;
}
- ///
+ ///
/// DarkSalmon color (R:233,G:150,B:122,A:255).
///
public static Color DarkSalmon
@@ -850,7 +850,7 @@ namespace Microsoft.Xna.Framework
private set;
}
- ///
+ ///
/// Fuchsia color (R:255,G:0,B:255,A:255).
///
public static Color Fuchsia
@@ -1496,7 +1496,7 @@ namespace Microsoft.Xna.Framework
private set;
}
- ///
+ ///
/// SaddleBrown color (R:139,G:69,B:19,A:255).
///
public static Color SaddleBrown
@@ -1504,7 +1504,7 @@ namespace Microsoft.Xna.Framework
get;
private set;
}
-
+
///
/// Salmon color (R:250,G:128,B:114,A:255).
///
@@ -1532,7 +1532,7 @@ namespace Microsoft.Xna.Framework
private set;
}
- ///
+ ///
/// SeaShell color (R:255,G:245,B:238,A:255).
///
public static Color SeaShell
@@ -1541,7 +1541,7 @@ namespace Microsoft.Xna.Framework
private set;
}
- ///
+ ///
/// Sienna color (R:160,G:82,B:45,A:255).
///
public static Color Sienna
@@ -1550,7 +1550,7 @@ namespace Microsoft.Xna.Framework
private set;
}
- ///
+ ///
/// Silver color (R:192,G:192,B:192,A:255).
///
public static Color Silver
@@ -1649,7 +1649,7 @@ namespace Microsoft.Xna.Framework
private set;
}
- ///
+ ///
/// Turquoise color (R:64,G:224,B:208,A:255).
///
public static Color Turquoise
@@ -1670,12 +1670,12 @@ namespace Microsoft.Xna.Framework
///
/// Wheat color (R:245,G:222,B:179,A:255).
///
- public static Color Wheat
+ public static Color Wheat
{
get;
private set;
}
-
+
///
/// White color (R:255,G:255,B:255,A:255).
///
@@ -1722,7 +1722,7 @@ namespace Microsoft.Xna.Framework
/// Interpolated .
public static Color Lerp(Color value1, Color value2, Single amount)
{
- amount = MathHelper.Clamp(amount, 0, 1);
+ amount = MathHelper.Clamp(amount, 0, 1);
return new Color(
(int)MathHelper.Lerp(value1.R, value2.R, amount),
(int)MathHelper.Lerp(value1.G, value2.G, amount),
@@ -1730,24 +1730,24 @@ namespace Microsoft.Xna.Framework
(int)MathHelper.Lerp(value1.A, value2.A, amount) );
}
- ///
+ ///
/// Multiply by value.
///
/// Source .
/// Multiplicator.
/// Multiplication result.
- public static Color Multiply(Color value, float scale)
- {
- return new Color((int)(value.R * scale), (int)(value.G * scale), (int)(value.B * scale), (int)(value.A * scale));
- }
-
- ///
+ public static Color Multiply(Color value, float scale)
+ {
+ return new Color((int)(value.R * scale), (int)(value.G * scale), (int)(value.B * scale), (int)(value.A * scale));
+ }
+
+ ///
/// Multiply by value.
///
/// Source .
/// Multiplicator.
/// Multiplication result.
- public static Color operator *(Color value, float scale)
+ public static Color operator *(Color value, float scale)
{
return new Color((int)(value.R * scale), (int)(value.G * scale), (int)(value.B * scale), (int)(value.A * scale));
}
@@ -1769,7 +1769,7 @@ namespace Microsoft.Xna.Framework
{
return new Vector4(R / 255.0f, G / 255.0f, B / 255.0f, A / 255.0f);
}
-
+
///
/// Gets or sets packed value of this .
///
@@ -1800,8 +1800,8 @@ namespace Microsoft.Xna.Framework
/// {R:[red] G:[green] B:[blue] A:[alpha]}
///
/// representation of this .
- public override string ToString ()
- {
+ public override string ToString ()
+ {
StringBuilder sb = new StringBuilder(25);
sb.Append("{R:");
sb.Append(R);
@@ -1813,9 +1813,9 @@ namespace Microsoft.Xna.Framework
sb.Append(A);
sb.Append("}");
return sb.ToString();
- }
-
- ///
+ }
+
+ ///
/// Translate a non-premultipled alpha to a that contains premultiplied alpha.
///
/// A representing color.
@@ -1824,8 +1824,8 @@ namespace Microsoft.Xna.Framework
{
return new Color(vector.X * vector.W, vector.Y * vector.W, vector.Z * vector.W, vector.W);
}
-
- ///
+
+ ///
/// Translate a non-premultipled alpha to a that contains premultiplied alpha.
///
/// Red component value.
@@ -1839,15 +1839,15 @@ namespace Microsoft.Xna.Framework
}
#region IEquatable Members
-
- ///
+
+ ///
/// Compares whether current instance is equal to specified .
///
/// The to compare.
/// true if the instances are equal; false otherwise.
public bool Equals(Color other)
{
- return this.PackedValue == other.PackedValue;
+ return this.PackedValue == other.PackedValue;
}
#endregion
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Graphics/SpriteEffects.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Graphics/SpriteEffects.cs
index 10937c51c..71c4ab237 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Graphics/SpriteEffects.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Graphics/SpriteEffects.cs
@@ -15,7 +15,7 @@ namespace Microsoft.Xna.Framework.Graphics
///
/// No options specified.
///
- None = 0,
+ None = 0,
///
/// Render the sprite reversed along the X axis.
///
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyState.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyState.cs
index 51529dca0..0c06a42f8 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyState.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyState.cs
@@ -44,15 +44,15 @@ namespace Microsoft.Xna.Framework.Input
/// Identifies the state of a keyboard key.
///
public enum KeyState
- {
- ///
- /// Key is released.
- ///
- Up,
+ {
+ ///
+ /// Key is released.
+ ///
+ Up,
- ///
- /// Key is pressed.
- ///
- Down,
- }
+ ///
+ /// Key is pressed.
+ ///
+ Down,
+ }
}
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyboardState.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyboardState.cs
index dd78935b6..0640442e6 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyboardState.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/KeyboardState.cs
@@ -9,7 +9,7 @@ namespace Microsoft.Xna.Framework.Input
///
/// Holds the state of keystrokes by a keyboard.
///
- public struct KeyboardState
+ public struct KeyboardState
{
// Used for the common situation where GetPressedKeys will return an empty array
static Keys[] empty = new Keys[0];
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/Keys.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/Keys.cs
index 5420cd52a..133c0ac01 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/Keys.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Input/Keys.cs
@@ -6,648 +6,648 @@ namespace Microsoft.Xna.Framework.Input
{
///
/// Defines the keys on a keyboard.
- ///
- public enum Keys
- {
+ ///
+ public enum Keys
+ {
///
/// Reserved.
///
- None = 0,
+ None = 0,
///
/// BACKSPACE key.
///
- Back = 8,
+ Back = 8,
///
/// TAB key.
///
- Tab = 9,
+ Tab = 9,
///
/// ENTER key.
///
- Enter = 13,
+ Enter = 13,
///
/// CAPS LOCK key.
///
- CapsLock = 20,
+ CapsLock = 20,
///
/// ESC key.
///
- Escape = 27,
+ Escape = 27,
///
/// SPACEBAR key.
///
- Space = 32,
+ Space = 32,
///
/// PAGE UP key.
///
- PageUp = 33,
+ PageUp = 33,
///
/// PAGE DOWN key.
///
- PageDown = 34,
+ PageDown = 34,
///
/// END key.
///
- End = 35,
+ End = 35,
///
/// HOME key.
///
- Home = 36,
+ Home = 36,
///
/// LEFT ARROW key.
///
- Left = 37,
+ Left = 37,
///
/// UP ARROW key.
///
- Up = 38,
+ Up = 38,
///
/// RIGHT ARROW key.
///
- Right = 39,
+ Right = 39,
///
/// DOWN ARROW key.
///
- Down = 40,
+ Down = 40,
///
/// SELECT key.
///
- Select = 41,
+ Select = 41,
///
/// PRINT key.
///
- Print = 42,
+ Print = 42,
///
/// EXECUTE key.
///
- Execute = 43,
+ Execute = 43,
///
/// PRINT SCREEN key.
///
- PrintScreen = 44,
+ PrintScreen = 44,
///
/// INS key.
///
- Insert = 45,
+ Insert = 45,
///
/// DEL key.
///
- Delete = 46,
+ Delete = 46,
///
/// HELP key.
///
- Help = 47,
+ Help = 47,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D0 = 48,
+ D0 = 48,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D1 = 49,
+ D1 = 49,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D2 = 50,
+ D2 = 50,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D3 = 51,
+ D3 = 51,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D4 = 52,
+ D4 = 52,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D5 = 53,
+ D5 = 53,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D6 = 54,
+ D6 = 54,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D7 = 55,
+ D7 = 55,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D8 = 56,
+ D8 = 56,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- D9 = 57,
+ D9 = 57,
///
/// A key.
///
- A = 65,
+ A = 65,
///
/// B key.
///
- B = 66,
+ B = 66,
///
/// C key.
///
- C = 67,
+ C = 67,
///
/// D key.
///
- D = 68,
+ D = 68,
///
/// E key.
///
- E = 69,
+ E = 69,
///
/// F key.
///
- F = 70,
+ F = 70,
///
/// G key.
///
- G = 71,
+ G = 71,
///
/// H key.
///
- H = 72,
+ H = 72,
///
/// I key.
///
- I = 73,
+ I = 73,
///
/// J key.
///
- J = 74,
+ J = 74,
///
/// K key.
///
- K = 75,
+ K = 75,
///
/// L key.
///
- L = 76,
+ L = 76,
///
/// M key.
///
- M = 77,
+ M = 77,
///
/// N key.
///
- N = 78,
+ N = 78,
///
/// O key.
///
- O = 79,
+ O = 79,
///
/// P key.
///
- P = 80,
+ P = 80,
///
/// Q key.
///
- Q = 81,
+ Q = 81,
///
/// R key.
///
- R = 82,
+ R = 82,
///
/// S key.
///
- S = 83,
+ S = 83,
///
/// T key.
///
- T = 84,
+ T = 84,
///
/// U key.
///
- U = 85,
+ U = 85,
///
/// V key.
///
- V = 86,
+ V = 86,
///
/// W key.
///
- W = 87,
+ W = 87,
///
/// X key.
///
- X = 88,
+ X = 88,
///
/// Y key.
///
- Y = 89,
+ Y = 89,
///
/// Z key.
///
- Z = 90,
+ Z = 90,
///
/// Left Windows key.
///
- LeftWindows = 91,
+ LeftWindows = 91,
///
/// Right Windows key.
///
- RightWindows = 92,
+ RightWindows = 92,
///
/// Applications key.
///
- Apps = 93,
+ Apps = 93,
///
/// Computer Sleep key.
///
- Sleep = 95,
+ Sleep = 95,
///
/// Numeric keypad 0 key.
///
- NumPad0 = 96,
+ NumPad0 = 96,
///
/// Numeric keypad 1 key.
///
- NumPad1 = 97,
+ NumPad1 = 97,
///
/// Numeric keypad 2 key.
///
- NumPad2 = 98,
+ NumPad2 = 98,
///
/// Numeric keypad 3 key.
///
- NumPad3 = 99,
+ NumPad3 = 99,
///
/// Numeric keypad 4 key.
///
- NumPad4 = 100,
+ NumPad4 = 100,
///
/// Numeric keypad 5 key.
///
- NumPad5 = 101,
+ NumPad5 = 101,
///
/// Numeric keypad 6 key.
///
- NumPad6 = 102,
+ NumPad6 = 102,
///
/// Numeric keypad 7 key.
///
- NumPad7 = 103,
+ NumPad7 = 103,
///
/// Numeric keypad 8 key.
///
- NumPad8 = 104,
+ NumPad8 = 104,
///
/// Numeric keypad 9 key.
///
- NumPad9 = 105,
+ NumPad9 = 105,
///
/// Multiply key.
///
- Multiply = 106,
+ Multiply = 106,
///
/// Add key.
///
- Add = 107,
+ Add = 107,
///
/// Separator key.
///
- Separator = 108,
+ Separator = 108,
///
/// Subtract key.
///
- Subtract = 109,
+ Subtract = 109,
///
/// Decimal key.
///
- Decimal = 110,
+ Decimal = 110,
///
/// Divide key.
///
- Divide = 111,
+ Divide = 111,
///
/// F1 key.
///
- F1 = 112,
+ F1 = 112,
///
/// F2 key.
///
- F2 = 113,
+ F2 = 113,
///
/// F3 key.
///
- F3 = 114,
+ F3 = 114,
///
/// F4 key.
///
- F4 = 115,
+ F4 = 115,
///
/// F5 key.
///
- F5 = 116,
+ F5 = 116,
///
/// F6 key.
///
- F6 = 117,
+ F6 = 117,
///
/// F7 key.
///
- F7 = 118,
+ F7 = 118,
///
/// F8 key.
///
- F8 = 119,
+ F8 = 119,
///
/// F9 key.
///
- F9 = 120,
+ F9 = 120,
///
/// F10 key.
///
- F10 = 121,
+ F10 = 121,
///
/// F11 key.
///
- F11 = 122,
+ F11 = 122,
///
/// F12 key.
///
- F12 = 123,
+ F12 = 123,
///
/// F13 key.
///
- F13 = 124,
+ F13 = 124,
///
/// F14 key.
///
- F14 = 125,
+ F14 = 125,
///
/// F15 key.
///
- F15 = 126,
+ F15 = 126,
///
/// F16 key.
///
- F16 = 127,
+ F16 = 127,
///
/// F17 key.
///
- F17 = 128,
+ F17 = 128,
///
/// F18 key.
///
- F18 = 129,
+ F18 = 129,
///
/// F19 key.
///
- F19 = 130,
+ F19 = 130,
///
/// F20 key.
///
- F20 = 131,
+ F20 = 131,
///
/// F21 key.
///
- F21 = 132,
+ F21 = 132,
///
/// F22 key.
///
- F22 = 133,
+ F22 = 133,
///
/// F23 key.
///
- F23 = 134,
+ F23 = 134,
///
/// F24 key.
///
- F24 = 135,
+ F24 = 135,
///
/// NUM LOCK key.
///
- NumLock = 144,
+ NumLock = 144,
///
/// SCROLL LOCK key.
///
- Scroll = 145,
+ Scroll = 145,
///
/// Left SHIFT key.
///
- LeftShift = 160,
+ LeftShift = 160,
///
/// Right SHIFT key.
///
- RightShift = 161,
+ RightShift = 161,
///
/// Left CONTROL key.
///
- LeftControl = 162,
+ LeftControl = 162,
///
/// Right CONTROL key.
///
- RightControl = 163,
+ RightControl = 163,
///
/// Left ALT key.
///
- LeftAlt = 164,
+ LeftAlt = 164,
///
/// Right ALT key.
///
- RightAlt = 165,
+ RightAlt = 165,
///
/// Browser Back key.
///
- BrowserBack = 166,
+ BrowserBack = 166,
///
/// Browser Forward key.
///
- BrowserForward = 167,
+ BrowserForward = 167,
///
/// Browser Refresh key.
///
- BrowserRefresh = 168,
+ BrowserRefresh = 168,
///
/// Browser Stop key.
///
- BrowserStop = 169,
+ BrowserStop = 169,
///
/// Browser Search key.
///
- BrowserSearch = 170,
+ BrowserSearch = 170,
///
/// Browser Favorites key.
///
- BrowserFavorites = 171,
+ BrowserFavorites = 171,
///
/// Browser Start and Home key.
///
- BrowserHome = 172,
- ///
+ BrowserHome = 172,
+ ///
/// Volume Mute key.
- ///
+ ///
VolumeMute = 173,
///
/// Volume Down key.
///
- VolumeDown = 174,
+ VolumeDown = 174,
///
/// Volume Up key.
///
- VolumeUp = 175,
+ VolumeUp = 175,
///
/// Next Track key.
///
- MediaNextTrack = 176,
+ MediaNextTrack = 176,
///
/// Previous Track key.
///
- MediaPreviousTrack = 177,
+ MediaPreviousTrack = 177,
///
/// Stop Media key.
///
- MediaStop = 178,
+ MediaStop = 178,
///
/// Play/Pause Media key.
///
- MediaPlayPause = 179,
+ MediaPlayPause = 179,
///
/// Start Mail key.
///
- LaunchMail = 180,
+ LaunchMail = 180,
///
/// Select Media key.
///
- SelectMedia = 181,
+ SelectMedia = 181,
///
/// Start Application 1 key.
///
- LaunchApplication1 = 182,
+ LaunchApplication1 = 182,
///
/// Start Application 2 key.
///
- LaunchApplication2 = 183,
+ LaunchApplication2 = 183,
///
/// The OEM Semicolon key on a US standard keyboard.
///
- OemSemicolon = 186,
+ OemSemicolon = 186,
///
/// For any country/region, the '+' key.
///
- OemPlus = 187,
+ OemPlus = 187,
///
/// For any country/region, the ',' key.
///
- OemComma = 188,
+ OemComma = 188,
///
/// For any country/region, the '-' key.
///
- OemMinus = 189,
+ OemMinus = 189,
///
/// For any country/region, the '.' key.
///
- OemPeriod = 190,
+ OemPeriod = 190,
///
/// The OEM question mark key on a US standard keyboard.
///
- OemQuestion = 191,
+ OemQuestion = 191,
///
/// The OEM tilde key on a US standard keyboard.
///
- OemTilde = 192,
+ OemTilde = 192,
///
/// The OEM open bracket key on a US standard keyboard.
///
- OemOpenBrackets = 219,
+ OemOpenBrackets = 219,
///
/// The OEM pipe key on a US standard keyboard.
///
- OemPipe = 220,
+ OemPipe = 220,
///
/// The OEM close bracket key on a US standard keyboard.
///
- OemCloseBrackets = 221,
+ OemCloseBrackets = 221,
///
/// The OEM singled/double quote key on a US standard keyboard.
///
- OemQuotes = 222,
+ OemQuotes = 222,
///
/// Used for miscellaneous characters; it can vary by keyboard.
///
- Oem8 = 223,
+ Oem8 = 223,
///
/// The OEM angle bracket or backslash key on the RT 102 key keyboard.
///
- OemBackslash = 226,
+ OemBackslash = 226,
///
/// IME PROCESS key.
///
- ProcessKey = 229,
+ ProcessKey = 229,
///
/// Attn key.
///
- Attn = 246,
+ Attn = 246,
///
/// CrSel key.
///
- Crsel = 247,
+ Crsel = 247,
///
/// ExSel key.
///
- Exsel = 248,
+ Exsel = 248,
///
/// Erase EOF key.
///
- EraseEof = 249,
+ EraseEof = 249,
///
/// Play key.
///
- Play = 250,
+ Play = 250,
///
/// Zoom key.
///
- Zoom = 251,
+ Zoom = 251,
///
/// PA1 key.
///
- Pa1 = 253,
+ Pa1 = 253,
///
/// CLEAR key.
///
- OemClear = 254,
+ OemClear = 254,
///
/// Green ChatPad key.
///
- ChatPadGreen = 0xCA,
+ ChatPadGreen = 0xCA,
///
/// Orange ChatPad key.
///
- ChatPadOrange = 0xCB,
+ ChatPadOrange = 0xCB,
///
/// PAUSE key.
///
- Pause = 0x13,
+ Pause = 0x13,
///
/// IME Convert key.
///
- ImeConvert = 0x1c,
+ ImeConvert = 0x1c,
///
/// IME NoConvert key.
///
- ImeNoConvert = 0x1d,
+ ImeNoConvert = 0x1d,
///
/// Kana key on Japanese keyboards.
///
- Kana = 0x15,
+ Kana = 0x15,
///
/// Kanji key on Japanese keyboards.
///
- Kanji = 0x19,
+ Kanji = 0x19,
///
/// OEM Auto key.
///
- OemAuto = 0xf3,
+ OemAuto = 0xf3,
///
/// OEM Copy key.
///
- OemCopy = 0xf2,
+ OemCopy = 0xf2,
///
/// OEM Enlarge Window key.
///
- OemEnlW = 0xf4
- }
+ OemEnlW = 0xf4
+ }
}
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Point.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Point.cs
index db63d3a77..671017b63 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Point.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Point.cs
@@ -147,7 +147,7 @@ namespace Microsoft.Xna.Framework
///
/// instance on the left of the not equal sign.
/// instance on the right of the not equal sign.
- /// true if the instances are not equal; false otherwise.
+ /// true if the instances are not equal; false otherwise.
public static bool operator !=(Point a, Point b)
{
return !a.Equals(b);
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Quaternion.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Quaternion.cs
index 78babbab5..395b75ccb 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Quaternion.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Quaternion.cs
@@ -138,12 +138,12 @@ namespace Microsoft.Xna.Framework
/// The result of the quaternion addition.
public static Quaternion Add(Quaternion quaternion1, Quaternion quaternion2)
{
- Quaternion quaternion;
- quaternion.X = quaternion1.X + quaternion2.X;
- quaternion.Y = quaternion1.Y + quaternion2.Y;
- quaternion.Z = quaternion1.Z + quaternion2.Z;
- quaternion.W = quaternion1.W + quaternion2.W;
- return quaternion;
+ Quaternion quaternion;
+ quaternion.X = quaternion1.X + quaternion2.X;
+ quaternion.Y = quaternion1.Y + quaternion2.Y;
+ quaternion.Z = quaternion1.Z + quaternion2.Z;
+ quaternion.W = quaternion1.W + quaternion2.W;
+ return quaternion;
}
///
@@ -154,10 +154,10 @@ namespace Microsoft.Xna.Framework
/// The result of the quaternion addition as an output parameter.
public static void Add(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
- result.X = quaternion1.X + quaternion2.X;
- result.Y = quaternion1.Y + quaternion2.Y;
- result.Z = quaternion1.Z + quaternion2.Z;
- result.W = quaternion1.W + quaternion2.W;
+ result.X = quaternion1.X + quaternion2.X;
+ result.Y = quaternion1.Y + quaternion2.Y;
+ result.Z = quaternion1.Z + quaternion2.Z;
+ result.W = quaternion1.W + quaternion2.W;
}
#endregion
@@ -171,8 +171,8 @@ namespace Microsoft.Xna.Framework
/// The second to concatenate.
/// The result of rotation of followed by rotation.
public static Quaternion Concatenate(Quaternion value1, Quaternion value2)
- {
- Quaternion quaternion;
+ {
+ Quaternion quaternion;
float x1 = value1.X;
float y1 = value1.Y;
@@ -180,17 +180,17 @@ namespace Microsoft.Xna.Framework
float w1 = value1.W;
float x2 = value2.X;
- float y2 = value2.Y;
- float z2 = value2.Z;
- float w2 = value2.W;
+ float y2 = value2.Y;
+ float z2 = value2.Z;
+ float w2 = value2.W;
- quaternion.X = ((x2 * w1) + (x1 * w2)) + ((y2 * z1) - (z2 * y1));
- quaternion.Y = ((y2 * w1) + (y1 * w2)) + ((z2 * x1) - (x2 * z1));
- quaternion.Z = ((z2 * w1) + (z1 * w2)) + ((x2 * y1) - (y2 * x1));
- quaternion.W = (w2 * w1) - (((x2 * x1) + (y2 * y1)) + (z2 * z1));
+ quaternion.X = ((x2 * w1) + (x1 * w2)) + ((y2 * z1) - (z2 * y1));
+ quaternion.Y = ((y2 * w1) + (y1 * w2)) + ((z2 * x1) - (x2 * z1));
+ quaternion.Z = ((z2 * w1) + (z1 * w2)) + ((x2 * y1) - (y2 * x1));
+ quaternion.W = (w2 * w1) - (((x2 * x1) + (y2 * y1)) + (z2 * z1));
- return quaternion;
- }
+ return quaternion;
+ }
///
/// Creates a new that contains concatenation between two quaternion.
@@ -199,7 +199,7 @@ namespace Microsoft.Xna.Framework
/// The second to concatenate.
/// The result of rotation of followed by rotation as an output parameter.
public static void Concatenate(ref Quaternion value1, ref Quaternion value2, out Quaternion result)
- {
+ {
float x1 = value1.X;
float y1 = value1.Y;
float z1 = value1.Z;
@@ -224,11 +224,11 @@ namespace Microsoft.Xna.Framework
/// Transforms this quaternion into its conjugated version.
///
public void Conjugate()
- {
- X = -X;
- Y = -Y;
- Z = -Z;
- }
+ {
+ X = -X;
+ Y = -Y;
+ Z = -Z;
+ }
///
/// Creates a new that contains conjugated version of the specified quaternion.
@@ -236,9 +236,9 @@ namespace Microsoft.Xna.Framework
/// The quaternion which values will be used to create the conjugated version.
/// The conjugate version of the specified quaternion.
public static Quaternion Conjugate(Quaternion value)
- {
- return new Quaternion(-value.X,-value.Y,-value.Z,value.W);
- }
+ {
+ return new Quaternion(-value.X,-value.Y,-value.Z,value.W);
+ }
///
/// Creates a new that contains conjugated version of the specified quaternion.
@@ -246,12 +246,12 @@ namespace Microsoft.Xna.Framework
/// The quaternion which values will be used to create the conjugated version.
/// The conjugated version of the specified quaternion as an output parameter.
public static void Conjugate(ref Quaternion value, out Quaternion result)
- {
- result.X = -value.X;
- result.Y = -value.Y;
- result.Z = -value.Z;
- result.W = value.W;
- }
+ {
+ result.X = -value.X;
+ result.Y = -value.Y;
+ result.Z = -value.Z;
+ result.W = value.W;
+ }
#endregion
@@ -265,10 +265,10 @@ namespace Microsoft.Xna.Framework
/// The new quaternion builded from axis and angle.
public static Quaternion CreateFromAxisAngle(Vector3 axis, float angle)
{
- float half = angle * 0.5f;
- float sin = (float)Math.Sin(half);
- float cos = (float)Math.Cos(half);
- return new Quaternion(axis.X * sin, axis.Y * sin, axis.Z * sin, cos);
+ float half = angle * 0.5f;
+ float sin = (float)Math.Sin(half);
+ float cos = (float)Math.Cos(half);
+ return new Quaternion(axis.X * sin, axis.Y * sin, axis.Z * sin, cos);
}
///
@@ -280,12 +280,12 @@ namespace Microsoft.Xna.Framework
public static void CreateFromAxisAngle(ref Vector3 axis, float angle, out Quaternion result)
{
float half = angle * 0.5f;
- float sin = (float)Math.Sin(half);
- float cos = (float)Math.Cos(half);
- result.X = axis.X * sin;
- result.Y = axis.Y * sin;
- result.Z = axis.Z * sin;
- result.W = cos;
+ float sin = (float)Math.Sin(half);
+ float cos = (float)Math.Cos(half);
+ result.X = axis.X * sin;
+ result.Y = axis.Y * sin;
+ result.Z = axis.Z * sin;
+ result.W = cos;
}
#endregion
@@ -304,51 +304,51 @@ namespace Microsoft.Xna.Framework
float half;
float scale = matrix.M11 + matrix.M22 + matrix.M33;
- if (scale > 0.0f)
- {
+ if (scale > 0.0f)
+ {
sqrt = (float)Math.Sqrt(scale + 1.0f);
- quaternion.W = sqrt * 0.5f;
+ quaternion.W = sqrt * 0.5f;
sqrt = 0.5f / sqrt;
- quaternion.X = (matrix.M23 - matrix.M32) * sqrt;
- quaternion.Y = (matrix.M31 - matrix.M13) * sqrt;
- quaternion.Z = (matrix.M12 - matrix.M21) * sqrt;
+ quaternion.X = (matrix.M23 - matrix.M32) * sqrt;
+ quaternion.Y = (matrix.M31 - matrix.M13) * sqrt;
+ quaternion.Z = (matrix.M12 - matrix.M21) * sqrt;
- return quaternion;
- }
- if ((matrix.M11 >= matrix.M22) && (matrix.M11 >= matrix.M33))
- {
+ return quaternion;
+ }
+ if ((matrix.M11 >= matrix.M22) && (matrix.M11 >= matrix.M33))
+ {
sqrt = (float) Math.Sqrt(1.0f + matrix.M11 - matrix.M22 - matrix.M33);
half = 0.5f / sqrt;
- quaternion.X = 0.5f * sqrt;
- quaternion.Y = (matrix.M12 + matrix.M21) * half;
- quaternion.Z = (matrix.M13 + matrix.M31) * half;
- quaternion.W = (matrix.M23 - matrix.M32) * half;
+ quaternion.X = 0.5f * sqrt;
+ quaternion.Y = (matrix.M12 + matrix.M21) * half;
+ quaternion.Z = (matrix.M13 + matrix.M31) * half;
+ quaternion.W = (matrix.M23 - matrix.M32) * half;
- return quaternion;
- }
- if (matrix.M22 > matrix.M33)
- {
+ return quaternion;
+ }
+ if (matrix.M22 > matrix.M33)
+ {
sqrt = (float) Math.Sqrt(1.0f + matrix.M22 - matrix.M11 - matrix.M33);
half = 0.5f / sqrt;
- quaternion.X = (matrix.M21 + matrix.M12) * half;
- quaternion.Y = 0.5f * sqrt;
- quaternion.Z = (matrix.M32 + matrix.M23) * half;
- quaternion.W = (matrix.M31 - matrix.M13) * half;
+ quaternion.X = (matrix.M21 + matrix.M12) * half;
+ quaternion.Y = 0.5f * sqrt;
+ quaternion.Z = (matrix.M32 + matrix.M23) * half;
+ quaternion.W = (matrix.M31 - matrix.M13) * half;
- return quaternion;
- }
+ return quaternion;
+ }
sqrt = (float) Math.Sqrt(1.0f + matrix.M33 - matrix.M11 - matrix.M22);
- half = 0.5f / sqrt;
+ half = 0.5f / sqrt;
- quaternion.X = (matrix.M31 + matrix.M13) * half;
- quaternion.Y = (matrix.M32 + matrix.M23) * half;
- quaternion.Z = 0.5f * sqrt;
- quaternion.W = (matrix.M12 - matrix.M21) * half;
-
- return quaternion;
+ quaternion.X = (matrix.M31 + matrix.M13) * half;
+ quaternion.Y = (matrix.M32 + matrix.M23) * half;
+ quaternion.Z = 0.5f * sqrt;
+ quaternion.W = (matrix.M12 - matrix.M21) * half;
+
+ return quaternion;
}
///
@@ -417,7 +417,7 @@ namespace Microsoft.Xna.Framework
/// Roll around the z axis in radians.
/// A new quaternion from the concatenated yaw, pitch, and roll angles.
public static Quaternion CreateFromYawPitchRoll(float yaw, float pitch, float roll)
- {
+ {
float halfRoll = roll * 0.5f;
float halfPitch = pitch * 0.5f;
float halfYaw = yaw * 0.5f;
@@ -442,8 +442,8 @@ namespace Microsoft.Xna.Framework
/// Pitch around the x axis in radians.
/// Roll around the z axis in radians.
/// A new quaternion from the concatenated yaw, pitch, and roll angles as an output parameter.
- public static void CreateFromYawPitchRoll(float yaw, float pitch, float roll, out Quaternion result)
- {
+ public static void CreateFromYawPitchRoll(float yaw, float pitch, float roll, out Quaternion result)
+ {
float halfRoll = roll * 0.5f;
float halfPitch = pitch * 0.5f;
float halfYaw = yaw * 0.5f;
@@ -474,25 +474,25 @@ namespace Microsoft.Xna.Framework
public static Quaternion Divide(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
- float x = quaternion1.X;
- float y = quaternion1.Y;
- float z = quaternion1.Z;
- float w = quaternion1.W;
- float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
- float num5 = 1f / num14;
- float num4 = -quaternion2.X * num5;
- float num3 = -quaternion2.Y * num5;
- float num2 = -quaternion2.Z * num5;
- float num = quaternion2.W * num5;
- float num13 = (y * num2) - (z * num3);
- float num12 = (z * num4) - (x * num2);
- float num11 = (x * num3) - (y * num4);
- float num10 = ((x * num4) + (y * num3)) + (z * num2);
- quaternion.X = ((x * num) + (num4 * w)) + num13;
- quaternion.Y = ((y * num) + (num3 * w)) + num12;
- quaternion.Z = ((z * num) + (num2 * w)) + num11;
- quaternion.W = (w * num) - num10;
- return quaternion;
+ float x = quaternion1.X;
+ float y = quaternion1.Y;
+ float z = quaternion1.Z;
+ float w = quaternion1.W;
+ float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
+ float num5 = 1f / num14;
+ float num4 = -quaternion2.X * num5;
+ float num3 = -quaternion2.Y * num5;
+ float num2 = -quaternion2.Z * num5;
+ float num = quaternion2.W * num5;
+ float num13 = (y * num2) - (z * num3);
+ float num12 = (z * num4) - (x * num2);
+ float num11 = (x * num3) - (y * num4);
+ float num10 = ((x * num4) + (y * num3)) + (z * num2);
+ quaternion.X = ((x * num) + (num4 * w)) + num13;
+ quaternion.Y = ((y * num) + (num3 * w)) + num12;
+ quaternion.Z = ((z * num) + (num2 * w)) + num11;
+ quaternion.W = (w * num) - num10;
+ return quaternion;
}
///
@@ -504,23 +504,23 @@ namespace Microsoft.Xna.Framework
public static void Divide(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
float x = quaternion1.X;
- float y = quaternion1.Y;
- float z = quaternion1.Z;
- float w = quaternion1.W;
- float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
- float num5 = 1f / num14;
- float num4 = -quaternion2.X * num5;
- float num3 = -quaternion2.Y * num5;
- float num2 = -quaternion2.Z * num5;
- float num = quaternion2.W * num5;
- float num13 = (y * num2) - (z * num3);
- float num12 = (z * num4) - (x * num2);
- float num11 = (x * num3) - (y * num4);
- float num10 = ((x * num4) + (y * num3)) + (z * num2);
- result.X = ((x * num) + (num4 * w)) + num13;
- result.Y = ((y * num) + (num3 * w)) + num12;
- result.Z = ((z * num) + (num2 * w)) + num11;
- result.W = (w * num) - num10;
+ float y = quaternion1.Y;
+ float z = quaternion1.Z;
+ float w = quaternion1.W;
+ float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
+ float num5 = 1f / num14;
+ float num4 = -quaternion2.X * num5;
+ float num3 = -quaternion2.Y * num5;
+ float num2 = -quaternion2.Z * num5;
+ float num = quaternion2.W * num5;
+ float num13 = (y * num2) - (z * num3);
+ float num12 = (z * num4) - (x * num2);
+ float num11 = (x * num3) - (y * num4);
+ float num10 = ((x * num4) + (y * num3)) + (z * num2);
+ result.X = ((x * num) + (num4 * w)) + num13;
+ result.Y = ((y * num) + (num3 * w)) + num12;
+ result.Z = ((z * num) + (num2 * w)) + num11;
+ result.W = (w * num) - num10;
}
#endregion
@@ -572,7 +572,7 @@ namespace Microsoft.Xna.Framework
/// true if the instances are equal; false otherwise.
public bool Equals(Quaternion other)
{
- return X == other.X &&
+ return X == other.X &&
Y == other.Y &&
Z == other.Z &&
W == other.W;
@@ -599,13 +599,13 @@ namespace Microsoft.Xna.Framework
public static Quaternion Inverse(Quaternion quaternion)
{
Quaternion quaternion2;
- float num2 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
- float num = 1f / num2;
- quaternion2.X = -quaternion.X * num;
- quaternion2.Y = -quaternion.Y * num;
- quaternion2.Z = -quaternion.Z * num;
- quaternion2.W = quaternion.W * num;
- return quaternion2;
+ float num2 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
+ float num = 1f / num2;
+ quaternion2.X = -quaternion.X * num;
+ quaternion2.Y = -quaternion.Y * num;
+ quaternion2.Z = -quaternion.Z * num;
+ quaternion2.W = quaternion.W * num;
+ return quaternion2;
}
///
@@ -616,11 +616,11 @@ namespace Microsoft.Xna.Framework
public static void Inverse(ref Quaternion quaternion, out Quaternion result)
{
float num2 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
- float num = 1f / num2;
- result.X = -quaternion.X * num;
- result.Y = -quaternion.Y * num;
- result.Z = -quaternion.Z * num;
- result.W = quaternion.W * num;
+ float num = 1f / num2;
+ result.X = -quaternion.X * num;
+ result.Y = -quaternion.Y * num;
+ result.Z = -quaternion.Z * num;
+ result.W = quaternion.W * num;
}
#endregion
@@ -631,7 +631,7 @@ namespace Microsoft.Xna.Framework
/// The magnitude of the quaternion components.
public float Length()
{
- return (float) Math.Sqrt((X * X) + (Y * Y) + (Z * Z) + (W * W));
+ return (float) Math.Sqrt((X * X) + (Y * Y) + (Z * Z) + (W * W));
}
///
@@ -655,30 +655,30 @@ namespace Microsoft.Xna.Framework
public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, float amount)
{
float num = amount;
- float num2 = 1f - num;
- Quaternion quaternion = new Quaternion();
- float num5 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
- if (num5 >= 0f)
- {
- quaternion.X = (num2 * quaternion1.X) + (num * quaternion2.X);
- quaternion.Y = (num2 * quaternion1.Y) + (num * quaternion2.Y);
- quaternion.Z = (num2 * quaternion1.Z) + (num * quaternion2.Z);
- quaternion.W = (num2 * quaternion1.W) + (num * quaternion2.W);
- }
- else
- {
- quaternion.X = (num2 * quaternion1.X) - (num * quaternion2.X);
- quaternion.Y = (num2 * quaternion1.Y) - (num * quaternion2.Y);
- quaternion.Z = (num2 * quaternion1.Z) - (num * quaternion2.Z);
- quaternion.W = (num2 * quaternion1.W) - (num * quaternion2.W);
- }
- float num4 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
- float num3 = 1f / ((float) Math.Sqrt((double) num4));
- quaternion.X *= num3;
- quaternion.Y *= num3;
- quaternion.Z *= num3;
- quaternion.W *= num3;
- return quaternion;
+ float num2 = 1f - num;
+ Quaternion quaternion = new Quaternion();
+ float num5 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
+ if (num5 >= 0f)
+ {
+ quaternion.X = (num2 * quaternion1.X) + (num * quaternion2.X);
+ quaternion.Y = (num2 * quaternion1.Y) + (num * quaternion2.Y);
+ quaternion.Z = (num2 * quaternion1.Z) + (num * quaternion2.Z);
+ quaternion.W = (num2 * quaternion1.W) + (num * quaternion2.W);
+ }
+ else
+ {
+ quaternion.X = (num2 * quaternion1.X) - (num * quaternion2.X);
+ quaternion.Y = (num2 * quaternion1.Y) - (num * quaternion2.Y);
+ quaternion.Z = (num2 * quaternion1.Z) - (num * quaternion2.Z);
+ quaternion.W = (num2 * quaternion1.W) - (num * quaternion2.W);
+ }
+ float num4 = (((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y)) + (quaternion.Z * quaternion.Z)) + (quaternion.W * quaternion.W);
+ float num3 = 1f / ((float) Math.Sqrt((double) num4));
+ quaternion.X *= num3;
+ quaternion.Y *= num3;
+ quaternion.Z *= num3;
+ quaternion.W *= num3;
+ return quaternion;
}
///
@@ -691,28 +691,28 @@ namespace Microsoft.Xna.Framework
public static void Lerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, out Quaternion result)
{
float num = amount;
- float num2 = 1f - num;
- float num5 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
- if (num5 >= 0f)
- {
- result.X = (num2 * quaternion1.X) + (num * quaternion2.X);
- result.Y = (num2 * quaternion1.Y) + (num * quaternion2.Y);
- result.Z = (num2 * quaternion1.Z) + (num * quaternion2.Z);
- result.W = (num2 * quaternion1.W) + (num * quaternion2.W);
- }
- else
- {
- result.X = (num2 * quaternion1.X) - (num * quaternion2.X);
- result.Y = (num2 * quaternion1.Y) - (num * quaternion2.Y);
- result.Z = (num2 * quaternion1.Z) - (num * quaternion2.Z);
- result.W = (num2 * quaternion1.W) - (num * quaternion2.W);
- }
- float num4 = (((result.X * result.X) + (result.Y * result.Y)) + (result.Z * result.Z)) + (result.W * result.W);
- float num3 = 1f / ((float) Math.Sqrt((double) num4));
- result.X *= num3;
- result.Y *= num3;
- result.Z *= num3;
- result.W *= num3;
+ float num2 = 1f - num;
+ float num5 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
+ if (num5 >= 0f)
+ {
+ result.X = (num2 * quaternion1.X) + (num * quaternion2.X);
+ result.Y = (num2 * quaternion1.Y) + (num * quaternion2.Y);
+ result.Z = (num2 * quaternion1.Z) + (num * quaternion2.Z);
+ result.W = (num2 * quaternion1.W) + (num * quaternion2.W);
+ }
+ else
+ {
+ result.X = (num2 * quaternion1.X) - (num * quaternion2.X);
+ result.Y = (num2 * quaternion1.Y) - (num * quaternion2.Y);
+ result.Z = (num2 * quaternion1.Z) - (num * quaternion2.Z);
+ result.W = (num2 * quaternion1.W) - (num * quaternion2.W);
+ }
+ float num4 = (((result.X * result.X) + (result.Y * result.Y)) + (result.Z * result.Z)) + (result.W * result.W);
+ float num3 = 1f / ((float) Math.Sqrt((double) num4));
+ result.X *= num3;
+ result.Y *= num3;
+ result.Z *= num3;
+ result.W *= num3;
}
@@ -730,33 +730,33 @@ namespace Microsoft.Xna.Framework
public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, float amount)
{
float num2;
- float num3;
- Quaternion quaternion;
- float num = amount;
- float num4 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
- bool flag = false;
- if (num4 < 0f)
- {
- flag = true;
- num4 = -num4;
- }
- if (num4 > 0.999999f)
- {
- num3 = 1f - num;
- num2 = flag ? -num : num;
- }
- else
- {
- float num5 = (float) Math.Acos((double) num4);
- float num6 = (float) (1.0 / Math.Sin((double) num5));
- num3 = ((float) Math.Sin((double) ((1f - num) * num5))) * num6;
- num2 = flag ? (((float) -Math.Sin((double) (num * num5))) * num6) : (((float) Math.Sin((double) (num * num5))) * num6);
- }
- quaternion.X = (num3 * quaternion1.X) + (num2 * quaternion2.X);
- quaternion.Y = (num3 * quaternion1.Y) + (num2 * quaternion2.Y);
- quaternion.Z = (num3 * quaternion1.Z) + (num2 * quaternion2.Z);
- quaternion.W = (num3 * quaternion1.W) + (num2 * quaternion2.W);
- return quaternion;
+ float num3;
+ Quaternion quaternion;
+ float num = amount;
+ float num4 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
+ bool flag = false;
+ if (num4 < 0f)
+ {
+ flag = true;
+ num4 = -num4;
+ }
+ if (num4 > 0.999999f)
+ {
+ num3 = 1f - num;
+ num2 = flag ? -num : num;
+ }
+ else
+ {
+ float num5 = (float) Math.Acos((double) num4);
+ float num6 = (float) (1.0 / Math.Sin((double) num5));
+ num3 = ((float) Math.Sin((double) ((1f - num) * num5))) * num6;
+ num2 = flag ? (((float) -Math.Sin((double) (num * num5))) * num6) : (((float) Math.Sin((double) (num * num5))) * num6);
+ }
+ quaternion.X = (num3 * quaternion1.X) + (num2 * quaternion2.X);
+ quaternion.Y = (num3 * quaternion1.Y) + (num2 * quaternion2.Y);
+ quaternion.Z = (num3 * quaternion1.Z) + (num2 * quaternion2.Z);
+ quaternion.W = (num3 * quaternion1.W) + (num2 * quaternion2.W);
+ return quaternion;
}
///
@@ -769,31 +769,31 @@ namespace Microsoft.Xna.Framework
public static void Slerp(ref Quaternion quaternion1, ref Quaternion quaternion2, float amount, out Quaternion result)
{
float num2;
- float num3;
- float num = amount;
- float num4 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
- bool flag = false;
- if (num4 < 0f)
- {
- flag = true;
- num4 = -num4;
- }
- if (num4 > 0.999999f)
- {
- num3 = 1f - num;
- num2 = flag ? -num : num;
- }
- else
- {
- float num5 = (float) Math.Acos((double) num4);
- float num6 = (float) (1.0 / Math.Sin((double) num5));
- num3 = ((float) Math.Sin((double) ((1f - num) * num5))) * num6;
- num2 = flag ? (((float) -Math.Sin((double) (num * num5))) * num6) : (((float) Math.Sin((double) (num * num5))) * num6);
- }
- result.X = (num3 * quaternion1.X) + (num2 * quaternion2.X);
- result.Y = (num3 * quaternion1.Y) + (num2 * quaternion2.Y);
- result.Z = (num3 * quaternion1.Z) + (num2 * quaternion2.Z);
- result.W = (num3 * quaternion1.W) + (num2 * quaternion2.W);
+ float num3;
+ float num = amount;
+ float num4 = (((quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y)) + (quaternion1.Z * quaternion2.Z)) + (quaternion1.W * quaternion2.W);
+ bool flag = false;
+ if (num4 < 0f)
+ {
+ flag = true;
+ num4 = -num4;
+ }
+ if (num4 > 0.999999f)
+ {
+ num3 = 1f - num;
+ num2 = flag ? -num : num;
+ }
+ else
+ {
+ float num5 = (float) Math.Acos((double) num4);
+ float num6 = (float) (1.0 / Math.Sin((double) num5));
+ num3 = ((float) Math.Sin((double) ((1f - num) * num5))) * num6;
+ num2 = flag ? (((float) -Math.Sin((double) (num * num5))) * num6) : (((float) Math.Sin((double) (num * num5))) * num6);
+ }
+ result.X = (num3 * quaternion1.X) + (num2 * quaternion2.X);
+ result.Y = (num3 * quaternion1.Y) + (num2 * quaternion2.Y);
+ result.Z = (num3 * quaternion1.Z) + (num2 * quaternion2.Z);
+ result.W = (num3 * quaternion1.W) + (num2 * quaternion2.W);
}
#endregion
@@ -809,11 +809,11 @@ namespace Microsoft.Xna.Framework
public static Quaternion Subtract(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
- quaternion.X = quaternion1.X - quaternion2.X;
- quaternion.Y = quaternion1.Y - quaternion2.Y;
- quaternion.Z = quaternion1.Z - quaternion2.Z;
- quaternion.W = quaternion1.W - quaternion2.W;
- return quaternion;
+ quaternion.X = quaternion1.X - quaternion2.X;
+ quaternion.Y = quaternion1.Y - quaternion2.Y;
+ quaternion.Z = quaternion1.Z - quaternion2.Z;
+ quaternion.W = quaternion1.W - quaternion2.W;
+ return quaternion;
}
///
@@ -825,9 +825,9 @@ namespace Microsoft.Xna.Framework
public static void Subtract(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
result.X = quaternion1.X - quaternion2.X;
- result.Y = quaternion1.Y - quaternion2.Y;
- result.Z = quaternion1.Z - quaternion2.Z;
- result.W = quaternion1.W - quaternion2.W;
+ result.Y = quaternion1.Y - quaternion2.Y;
+ result.Z = quaternion1.Z - quaternion2.Z;
+ result.W = quaternion1.W - quaternion2.W;
}
#endregion
@@ -843,23 +843,23 @@ namespace Microsoft.Xna.Framework
public static Quaternion Multiply(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
- float x = quaternion1.X;
- float y = quaternion1.Y;
- float z = quaternion1.Z;
- float w = quaternion1.W;
- float num4 = quaternion2.X;
- float num3 = quaternion2.Y;
- float num2 = quaternion2.Z;
- float num = quaternion2.W;
- float num12 = (y * num2) - (z * num3);
- float num11 = (z * num4) - (x * num2);
- float num10 = (x * num3) - (y * num4);
- float num9 = ((x * num4) + (y * num3)) + (z * num2);
- quaternion.X = ((x * num) + (num4 * w)) + num12;
- quaternion.Y = ((y * num) + (num3 * w)) + num11;
- quaternion.Z = ((z * num) + (num2 * w)) + num10;
- quaternion.W = (w * num) - num9;
- return quaternion;
+ float x = quaternion1.X;
+ float y = quaternion1.Y;
+ float z = quaternion1.Z;
+ float w = quaternion1.W;
+ float num4 = quaternion2.X;
+ float num3 = quaternion2.Y;
+ float num2 = quaternion2.Z;
+ float num = quaternion2.W;
+ float num12 = (y * num2) - (z * num3);
+ float num11 = (z * num4) - (x * num2);
+ float num10 = (x * num3) - (y * num4);
+ float num9 = ((x * num4) + (y * num3)) + (z * num2);
+ quaternion.X = ((x * num) + (num4 * w)) + num12;
+ quaternion.Y = ((y * num) + (num3 * w)) + num11;
+ quaternion.Z = ((z * num) + (num2 * w)) + num10;
+ quaternion.W = (w * num) - num9;
+ return quaternion;
}
///
@@ -871,11 +871,11 @@ namespace Microsoft.Xna.Framework
public static Quaternion Multiply(Quaternion quaternion1, float scaleFactor)
{
Quaternion quaternion;
- quaternion.X = quaternion1.X * scaleFactor;
- quaternion.Y = quaternion1.Y * scaleFactor;
- quaternion.Z = quaternion1.Z * scaleFactor;
- quaternion.W = quaternion1.W * scaleFactor;
- return quaternion;
+ quaternion.X = quaternion1.X * scaleFactor;
+ quaternion.Y = quaternion1.Y * scaleFactor;
+ quaternion.Z = quaternion1.Z * scaleFactor;
+ quaternion.W = quaternion1.W * scaleFactor;
+ return quaternion;
}
///
@@ -887,9 +887,9 @@ namespace Microsoft.Xna.Framework
public static void Multiply(ref Quaternion quaternion1, float scaleFactor, out Quaternion result)
{
result.X = quaternion1.X * scaleFactor;
- result.Y = quaternion1.Y * scaleFactor;
- result.Z = quaternion1.Z * scaleFactor;
- result.W = quaternion1.W * scaleFactor;
+ result.Y = quaternion1.Y * scaleFactor;
+ result.Z = quaternion1.Z * scaleFactor;
+ result.W = quaternion1.W * scaleFactor;
}
///
@@ -901,21 +901,21 @@ namespace Microsoft.Xna.Framework
public static void Multiply(ref Quaternion quaternion1, ref Quaternion quaternion2, out Quaternion result)
{
float x = quaternion1.X;
- float y = quaternion1.Y;
- float z = quaternion1.Z;
- float w = quaternion1.W;
- float num4 = quaternion2.X;
- float num3 = quaternion2.Y;
- float num2 = quaternion2.Z;
- float num = quaternion2.W;
- float num12 = (y * num2) - (z * num3);
- float num11 = (z * num4) - (x * num2);
- float num10 = (x * num3) - (y * num4);
- float num9 = ((x * num4) + (y * num3)) + (z * num2);
- result.X = ((x * num) + (num4 * w)) + num12;
- result.Y = ((y * num) + (num3 * w)) + num11;
- result.Z = ((z * num) + (num2 * w)) + num10;
- result.W = (w * num) - num9;
+ float y = quaternion1.Y;
+ float z = quaternion1.Z;
+ float w = quaternion1.W;
+ float num4 = quaternion2.X;
+ float num3 = quaternion2.Y;
+ float num2 = quaternion2.Z;
+ float num = quaternion2.W;
+ float num12 = (y * num2) - (z * num3);
+ float num11 = (z * num4) - (x * num2);
+ float num10 = (x * num3) - (y * num4);
+ float num9 = ((x * num4) + (y * num3)) + (z * num2);
+ result.X = ((x * num) + (num4 * w)) + num12;
+ result.Y = ((y * num) + (num3 * w)) + num11;
+ result.Z = ((z * num) + (num2 * w)) + num10;
+ result.W = (w * num) - num9;
}
#endregion
@@ -929,7 +929,7 @@ namespace Microsoft.Xna.Framework
/// The result of the quaternion negation.
public static Quaternion Negate(Quaternion quaternion)
{
- return new Quaternion(-quaternion.X, -quaternion.Y, -quaternion.Z, -quaternion.W);
+ return new Quaternion(-quaternion.X, -quaternion.Y, -quaternion.Z, -quaternion.W);
}
///
@@ -940,9 +940,9 @@ namespace Microsoft.Xna.Framework
public static void Negate(ref Quaternion quaternion, out Quaternion result)
{
result.X = -quaternion.X;
- result.Y = -quaternion.Y;
- result.Z = -quaternion.Z;
- result.W = -quaternion.W;
+ result.Y = -quaternion.Y;
+ result.Z = -quaternion.Z;
+ result.W = -quaternion.W;
}
#endregion
@@ -954,11 +954,11 @@ namespace Microsoft.Xna.Framework
///
public void Normalize()
{
- float num = 1f / ((float) Math.Sqrt((X * X) + (Y * Y) + (Z * Z) + (W * W)));
- X *= num;
- Y *= num;
- Z *= num;
- W *= num;
+ float num = 1f / ((float) Math.Sqrt((X * X) + (Y * Y) + (Z * Z) + (W * W)));
+ X *= num;
+ Y *= num;
+ Z *= num;
+ W *= num;
}
///
@@ -969,12 +969,12 @@ namespace Microsoft.Xna.Framework
public static Quaternion Normalize(Quaternion quaternion)
{
Quaternion result;
- float num = 1f / ((float) Math.Sqrt((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y) + (quaternion.Z * quaternion.Z) + (quaternion.W * quaternion.W)));
+ float num = 1f / ((float) Math.Sqrt((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y) + (quaternion.Z * quaternion.Z) + (quaternion.W * quaternion.W)));
result.X = quaternion.X * num;
result.Y = quaternion.Y * num;
result.Z = quaternion.Z * num;
result.W = quaternion.W * num;
- return result;
+ return result;
}
///
@@ -984,11 +984,11 @@ namespace Microsoft.Xna.Framework
/// The unit length quaternion an output parameter.
public static void Normalize(ref Quaternion quaternion, out Quaternion result)
{
- float num = 1f / ((float) Math.Sqrt((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y) + (quaternion.Z * quaternion.Z) + (quaternion.W * quaternion.W)));
- result.X = quaternion.X * num;
- result.Y = quaternion.Y * num;
- result.Z = quaternion.Z * num;
- result.W = quaternion.W * num;
+ float num = 1f / ((float) Math.Sqrt((quaternion.X * quaternion.X) + (quaternion.Y * quaternion.Y) + (quaternion.Z * quaternion.Z) + (quaternion.W * quaternion.W)));
+ result.X = quaternion.X * num;
+ result.Y = quaternion.Y * num;
+ result.Z = quaternion.Z * num;
+ result.W = quaternion.W * num;
}
#endregion
@@ -1025,11 +1025,11 @@ namespace Microsoft.Xna.Framework
public static Quaternion operator +(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
- quaternion.X = quaternion1.X + quaternion2.X;
- quaternion.Y = quaternion1.Y + quaternion2.Y;
- quaternion.Z = quaternion1.Z + quaternion2.Z;
- quaternion.W = quaternion1.W + quaternion2.W;
- return quaternion;
+ quaternion.X = quaternion1.X + quaternion2.X;
+ quaternion.Y = quaternion1.Y + quaternion2.Y;
+ quaternion.Z = quaternion1.Z + quaternion2.Z;
+ quaternion.W = quaternion1.W + quaternion2.W;
+ return quaternion;
}
///
@@ -1041,25 +1041,25 @@ namespace Microsoft.Xna.Framework
public static Quaternion operator /(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
- float x = quaternion1.X;
- float y = quaternion1.Y;
- float z = quaternion1.Z;
- float w = quaternion1.W;
- float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
- float num5 = 1f / num14;
- float num4 = -quaternion2.X * num5;
- float num3 = -quaternion2.Y * num5;
- float num2 = -quaternion2.Z * num5;
- float num = quaternion2.W * num5;
- float num13 = (y * num2) - (z * num3);
- float num12 = (z * num4) - (x * num2);
- float num11 = (x * num3) - (y * num4);
- float num10 = ((x * num4) + (y * num3)) + (z * num2);
- quaternion.X = ((x * num) + (num4 * w)) + num13;
- quaternion.Y = ((y * num) + (num3 * w)) + num12;
- quaternion.Z = ((z * num) + (num2 * w)) + num11;
- quaternion.W = (w * num) - num10;
- return quaternion;
+ float x = quaternion1.X;
+ float y = quaternion1.Y;
+ float z = quaternion1.Z;
+ float w = quaternion1.W;
+ float num14 = (((quaternion2.X * quaternion2.X) + (quaternion2.Y * quaternion2.Y)) + (quaternion2.Z * quaternion2.Z)) + (quaternion2.W * quaternion2.W);
+ float num5 = 1f / num14;
+ float num4 = -quaternion2.X * num5;
+ float num3 = -quaternion2.Y * num5;
+ float num2 = -quaternion2.Z * num5;
+ float num = quaternion2.W * num5;
+ float num13 = (y * num2) - (z * num3);
+ float num12 = (z * num4) - (x * num2);
+ float num11 = (x * num3) - (y * num4);
+ float num10 = ((x * num4) + (y * num3)) + (z * num2);
+ quaternion.X = ((x * num) + (num4 * w)) + num13;
+ quaternion.Y = ((y * num) + (num3 * w)) + num12;
+ quaternion.Z = ((z * num) + (num2 * w)) + num11;
+ quaternion.W = (w * num) - num10;
+ return quaternion;
}
///
@@ -1078,14 +1078,14 @@ namespace Microsoft.Xna.Framework
///
/// instance on the left of the not equal sign.
/// instance on the right of the not equal sign.
- /// true if the instances are not equal; false otherwise.
+ /// true if the instances are not equal; false otherwise.
public static bool operator !=(Quaternion quaternion1, Quaternion quaternion2)
{
if (((quaternion1.X == quaternion2.X) && (quaternion1.Y == quaternion2.Y)) && (quaternion1.Z == quaternion2.Z))
- {
- return (quaternion1.W != quaternion2.W);
- }
- return true;
+ {
+ return (quaternion1.W != quaternion2.W);
+ }
+ return true;
}
///
@@ -1097,23 +1097,23 @@ namespace Microsoft.Xna.Framework
public static Quaternion operator *(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
- float x = quaternion1.X;
- float y = quaternion1.Y;
- float z = quaternion1.Z;
- float w = quaternion1.W;
- float num4 = quaternion2.X;
- float num3 = quaternion2.Y;
- float num2 = quaternion2.Z;
- float num = quaternion2.W;
- float num12 = (y * num2) - (z * num3);
- float num11 = (z * num4) - (x * num2);
- float num10 = (x * num3) - (y * num4);
- float num9 = ((x * num4) + (y * num3)) + (z * num2);
- quaternion.X = ((x * num) + (num4 * w)) + num12;
- quaternion.Y = ((y * num) + (num3 * w)) + num11;
- quaternion.Z = ((z * num) + (num2 * w)) + num10;
- quaternion.W = (w * num) - num9;
- return quaternion;
+ float x = quaternion1.X;
+ float y = quaternion1.Y;
+ float z = quaternion1.Z;
+ float w = quaternion1.W;
+ float num4 = quaternion2.X;
+ float num3 = quaternion2.Y;
+ float num2 = quaternion2.Z;
+ float num = quaternion2.W;
+ float num12 = (y * num2) - (z * num3);
+ float num11 = (z * num4) - (x * num2);
+ float num10 = (x * num3) - (y * num4);
+ float num9 = ((x * num4) + (y * num3)) + (z * num2);
+ quaternion.X = ((x * num) + (num4 * w)) + num12;
+ quaternion.Y = ((y * num) + (num3 * w)) + num11;
+ quaternion.Z = ((z * num) + (num2 * w)) + num10;
+ quaternion.W = (w * num) - num9;
+ return quaternion;
}
///
@@ -1125,11 +1125,11 @@ namespace Microsoft.Xna.Framework
public static Quaternion operator *(Quaternion quaternion1, float scaleFactor)
{
Quaternion quaternion;
- quaternion.X = quaternion1.X * scaleFactor;
- quaternion.Y = quaternion1.Y * scaleFactor;
- quaternion.Z = quaternion1.Z * scaleFactor;
- quaternion.W = quaternion1.W * scaleFactor;
- return quaternion;
+ quaternion.X = quaternion1.X * scaleFactor;
+ quaternion.Y = quaternion1.Y * scaleFactor;
+ quaternion.Z = quaternion1.Z * scaleFactor;
+ quaternion.W = quaternion1.W * scaleFactor;
+ return quaternion;
}
///
@@ -1141,11 +1141,11 @@ namespace Microsoft.Xna.Framework
public static Quaternion operator -(Quaternion quaternion1, Quaternion quaternion2)
{
Quaternion quaternion;
- quaternion.X = quaternion1.X - quaternion2.X;
- quaternion.Y = quaternion1.Y - quaternion2.Y;
- quaternion.Z = quaternion1.Z - quaternion2.Z;
- quaternion.W = quaternion1.W - quaternion2.W;
- return quaternion;
+ quaternion.X = quaternion1.X - quaternion2.X;
+ quaternion.Y = quaternion1.Y - quaternion2.Y;
+ quaternion.Z = quaternion1.Z - quaternion2.Z;
+ quaternion.W = quaternion1.W - quaternion2.W;
+ return quaternion;
}
@@ -1157,11 +1157,11 @@ namespace Microsoft.Xna.Framework
public static Quaternion operator -(Quaternion quaternion)
{
Quaternion quaternion2;
- quaternion2.X = -quaternion.X;
- quaternion2.Y = -quaternion.Y;
- quaternion2.Z = -quaternion.Z;
- quaternion2.W = -quaternion.W;
- return quaternion2;
+ quaternion2.X = -quaternion.X;
+ quaternion2.Y = -quaternion.Y;
+ quaternion2.Z = -quaternion.Z;
+ quaternion2.W = -quaternion.W;
+ return quaternion2;
}
#endregion
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Rectangle.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Rectangle.cs
index 57ce68b56..f8a73be11 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Rectangle.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Rectangle.cs
@@ -236,7 +236,7 @@ namespace Microsoft.Xna.Framework
/// The x coordinate of the point to check for containment.
/// The y coordinate of the point to check for containment.
/// true if the provided coordinates lie inside this ; false otherwise.
- public bool Contains(int x, int y)
+ public bool Contains(int x, int y)
{
return ((((this.X <= x) && (x < (this.X + this.Width))) && (this.Y <= y)) && (y < (this.Y + this.Height)));
}
@@ -251,7 +251,7 @@ namespace Microsoft.Xna.Framework
{
return ((((this.X <= x) && (x < (this.X + this.Width))) && (this.Y <= y)) && (y < (this.Y + this.Height)));
}
-
+
///
/// Gets whether or not the provided lies within the bounds of this .
///
@@ -517,7 +517,7 @@ namespace Microsoft.Xna.Framework
result.Width = Math.Max(value1.Right, value2.Right) - result.X;
result.Height = Math.Max(value1.Bottom, value2.Bottom) - result.Y;
}
-
+
#endregion
}
}
diff --git a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Vector4.cs b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Vector4.cs
index 66e64cf5d..cfeb52c3d 100644
--- a/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Vector4.cs
+++ b/Barotrauma/BarotraumaServer/Source/Utils/MonogameTypes/Vector4.cs
@@ -1120,7 +1120,7 @@ namespace Microsoft.Xna.Framework
///
/// instance on the left of the not equal sign.
/// instance on the right of the not equal sign.
- /// true if the instances are not equal; false otherwise.
+ /// true if the instances are not equal; false otherwise.
public static bool operator !=(Vector4 value1, Vector4 value2)
{
return !(value1 == value2);
diff --git a/Barotrauma/BarotraumaShared/BarotraumaShared.projitems b/Barotrauma/BarotraumaShared/BarotraumaShared.projitems
index d534f0866..03db1c9eb 100644
--- a/Barotrauma/BarotraumaShared/BarotraumaShared.projitems
+++ b/Barotrauma/BarotraumaShared/BarotraumaShared.projitems
@@ -1535,4 +1535,4 @@
-
\ No newline at end of file
+
diff --git a/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml b/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml
index 476f8a787..1844bb699 100644
--- a/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml
+++ b/Barotrauma/BarotraumaShared/Content/Items/Door/doors.xml
@@ -12,7 +12,7 @@
-
+
@@ -159,4 +159,4 @@
-
\ No newline at end of file
+
diff --git a/Barotrauma/BarotraumaShared/Content/watershader.fx b/Barotrauma/BarotraumaShared/Content/watershader.fx
index 2412c3df6..b2d324b33 100644
--- a/Barotrauma/BarotraumaShared/Content/watershader.fx
+++ b/Barotrauma/BarotraumaShared/Content/watershader.fx
@@ -48,8 +48,9 @@ float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoor
float4 main2(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 losColor = tex2D(LosSampler, texCoord);
+ float4 sample = tex2D(TextureSampler, texCoord);
- float4 outColor = float4(losColor.x, losColor.y, losColor.z, color.w);
+ float4 outColor = float4(sample.x, sample.y, sample.z, losColor.x);
return outColor;
}
@@ -69,4 +70,4 @@ technique LosShader
{
PixelShader = compile ps_4_0_level_9_1 main2();
}
-}
\ No newline at end of file
+}
diff --git a/Barotrauma/BarotraumaShared/Content/watershader_opengl.xnb b/Barotrauma/BarotraumaShared/Content/watershader_opengl.xnb
old mode 100644
new mode 100755
index cf7be0fbe..d200722c6
Binary files a/Barotrauma/BarotraumaShared/Content/watershader_opengl.xnb and b/Barotrauma/BarotraumaShared/Content/watershader_opengl.xnb differ
diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Animation/FishAnimController.cs b/Barotrauma/BarotraumaShared/Source/Characters/Animation/FishAnimController.cs
index af427b259..0d67b09f8 100644
--- a/Barotrauma/BarotraumaShared/Source/Characters/Animation/FishAnimController.cs
+++ b/Barotrauma/BarotraumaShared/Source/Characters/Animation/FishAnimController.cs
@@ -78,7 +78,7 @@ namespace Barotrauma
}
//re-enable collider
- if (!Collider.FarseerBody.Enabled)
+ if (!Collider.Enabled)
{
var lowestLimb = FindLowestLimb();
@@ -87,7 +87,7 @@ namespace Barotrauma
Math.Max(lowestLimb.SimPosition.Y + (Collider.radius + Collider.height / 2), Collider.SimPosition.Y)),
0.0f);
- Collider.FarseerBody.Enabled = true;
+ Collider.Enabled = true;
}
ResetPullJoints();
diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs b/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs
index dd7d675c5..52f1b34cc 100644
--- a/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs
+++ b/Barotrauma/BarotraumaShared/Source/Characters/Animation/HumanoidAnimController.cs
@@ -105,7 +105,7 @@ namespace Barotrauma
//re-enable collider
- if (!Collider.FarseerBody.Enabled)
+ if (!Collider.Enabled)
{
var lowestLimb = FindLowestLimb();
@@ -115,7 +115,7 @@ namespace Barotrauma
Collider.Rotation);
Collider.FarseerBody.ResetDynamics();
- Collider.FarseerBody.Enabled = true;
+ Collider.Enabled = true;
}
if (swimming)
diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs
index a0dbe6343..39f1f240a 100644
--- a/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs
+++ b/Barotrauma/BarotraumaShared/Source/Characters/Animation/Ragdoll.cs
@@ -1469,5 +1469,12 @@ namespace Barotrauma
list.Remove(this);
}
+ public static void RemoveAll()
+ {
+ for (int i = list.Count - 1; i >= 0; i--)
+ {
+ list[i].Remove();
+ }
+ }
}
}
diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs
index 1bb7c5150..da7694ae1 100644
--- a/Barotrauma/BarotraumaShared/Source/Characters/Character.cs
+++ b/Barotrauma/BarotraumaShared/Source/Characters/Character.cs
@@ -344,18 +344,18 @@ namespace Barotrauma
if (GameMain.Client != null) return;
float newHealth = MathHelper.Clamp(value, minHealth, maxHealth);
- if (newHealth == health) return;
+ //if (newHealth == health) return;
health = newHealth;
- if (GameMain.Server != null)
+ /*if (GameMain.Server != null)
{
if (Math.Abs(health - lastSentHealth) > (maxHealth - minHealth) / 255.0f || Math.Sign(health) != Math.Sign(lastSentHealth))
{
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });
lastSentHealth = health;
}
- }
+ }*/
}
}
@@ -373,12 +373,12 @@ namespace Barotrauma
if (GameMain.Client != null) return;
float newBleeding = MathHelper.Clamp(value, 0.0f, 5.0f);
- if (newBleeding == bleeding) return;
+ //if (newBleeding == bleeding) return;
bleeding = newBleeding;
-
- if (GameMain.Server != null)
- GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });
+
+ /*if (GameMain.Server != null)
+ GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });*/
}
}
@@ -1540,11 +1540,11 @@ namespace Barotrauma
if (stunTimer > 0.0f)
{
stunTimer -= deltaTime;
- if (stunTimer < 0.0f && GameMain.Server != null)
+ /*if (stunTimer < 0.0f && GameMain.Server != null)
{
//stun ended -> notify clients
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });
- }
+ } */
}
//Skip health effects as critical health handles it differently
@@ -1574,8 +1574,8 @@ namespace Barotrauma
if (IsRagdolled)
{
if (AnimController is HumanoidAnimController) ((HumanoidAnimController)AnimController).Crouching = false;
- if(GameMain.Server != null)
- GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });
+ /*if(GameMain.Server != null)
+ GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });*/
AnimController.ResetPullJoints();
selectedConstruction = null;
return;
@@ -1821,11 +1821,11 @@ namespace Barotrauma
if ((newStun <= stunTimer && !allowStunDecrease) || !MathUtils.IsValid(newStun)) return;
- if (GameMain.Server != null &&
+ /*if (GameMain.Server != null &&
(Math.Sign(newStun) != Math.Sign(stunTimer) || Math.Abs(newStun - stunTimer) > 0.1f))
{
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });
- }
+ }*/
if (Math.Sign(newStun) != Math.Sign(stunTimer)) AnimController.ResetPullJoints();
@@ -1884,11 +1884,11 @@ namespace Barotrauma
return;
}
- if (GameMain.NetworkMember != null)
+ /*if (GameMain.NetworkMember != null)
{
if (GameMain.Server != null)
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.Status });
- }
+ }*/
AnimController.Frozen = false;
diff --git a/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs b/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs
index 0420bbab4..82bcb0cb9 100644
--- a/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs
+++ b/Barotrauma/BarotraumaShared/Source/Characters/CharacterNetworking.cs
@@ -332,6 +332,7 @@ namespace Barotrauma
inventory.ServerRead(type, msg, c);
break;
case 1:
+ bool doingCPR = msg.ReadBoolean();
if (c.Character != this)
{
#if DEBUG
@@ -340,7 +341,6 @@ namespace Barotrauma
return;
}
- bool doingCPR = msg.ReadBoolean();
AnimController.Anim = doingCPR ? AnimController.Animation.CPR : AnimController.Animation.None;
break;
case 2:
@@ -358,7 +358,15 @@ namespace Barotrauma
}
break;
case 3:
- AnimController.GrabLimb = (LimbType)msg.ReadUInt16();
+ LimbType grabLimb = (LimbType)msg.ReadUInt16();
+ if (c.Character != this)
+ {
+#if DEBUG
+ DebugConsole.Log("Received a character update message from a client who's not controlling the character");
+#endif
+ return;
+ }
+ AnimController.GrabLimb = grabLimb;
break;
}
break;
@@ -384,10 +392,6 @@ namespace Barotrauma
Client owner = ((Client)extraData[1]);
msg.Write(owner == null ? (byte)0 : owner.ID);
break;
- case NetEntityEvent.Type.Status:
- msg.WriteRangedInteger(0, 2, 2);
- WriteStatus(msg);
- break;
}
msg.WritePadBits();
}
@@ -474,6 +478,8 @@ namespace Barotrauma
tempBuffer.Write(SimPosition.Y);
tempBuffer.Write(AnimController.Collider.Rotation);
+ WriteStatus(tempBuffer);
+
tempBuffer.WritePadBits();
msg.Write((byte)tempBuffer.LengthBytes);
diff --git a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs
index e1216f145..f515a6793 100644
--- a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs
+++ b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs
@@ -13,13 +13,15 @@ namespace Barotrauma
{
public string Text;
public Color Color;
+ public bool IsCommand;
public readonly string Time;
- public ColoredText(string text, Color color)
+ public ColoredText(string text, Color color, bool isCommand)
{
this.Text = text;
this.Color = color;
+ this.IsCommand = isCommand;
Time = DateTime.Now.ToString();
}
@@ -1303,9 +1305,14 @@ namespace Barotrauma
direction = MathHelper.Clamp(direction, -1, 1);
- selectedIndex += direction;
- if (selectedIndex < 0) selectedIndex = Messages.Count - 1;
- selectedIndex = selectedIndex % Messages.Count;
+ int i = 0;
+ do
+ {
+ selectedIndex += direction;
+ if (selectedIndex < 0) selectedIndex = Messages.Count - 1;
+ selectedIndex = selectedIndex % Messages.Count;
+ if (++i >= Messages.Count) break;
+ } while (!Messages[selectedIndex].IsCommand);
return Messages[selectedIndex].Text;
}
@@ -1317,7 +1324,7 @@ namespace Barotrauma
#if CLIENT
activeQuestionText = null;
#endif
- NewMessage(command, Color.White);
+ NewMessage(command, Color.White, true);
//reset the variable before invoking the delegate because the method may need to activate another question
var temp = activeQuestionCallback;
activeQuestionCallback = null;
@@ -1331,7 +1338,7 @@ namespace Barotrauma
if (!splitCommand[0].ToLowerInvariant().Equals("admin"))
{
- NewMessage(command, Color.White);
+ NewMessage(command, Color.White, true);
}
#if CLIENT
@@ -1611,12 +1618,12 @@ namespace Barotrauma
}
}
- public static void NewMessage(string msg, Color color)
+ public static void NewMessage(string msg, Color color, bool isCommand = false)
{
if (string.IsNullOrEmpty((msg))) return;
#if SERVER
- Messages.Add(new ColoredText(msg, color));
+ Messages.Add(new ColoredText(msg, color, isCommand));
//TODO: REMOVE
Console.ForegroundColor = XnaToConsoleColor.Convert(color);
@@ -1631,7 +1638,7 @@ namespace Barotrauma
#elif CLIENT
lock (queuedMessages)
{
- queuedMessages.Enqueue(new ColoredText(msg, color));
+ queuedMessages.Enqueue(new ColoredText(msg, color, isCommand));
}
#endif
}
diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs
index 498279d26..c65d884c3 100644
--- a/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs
+++ b/Barotrauma/BarotraumaShared/Source/Items/Components/ItemComponent.cs
@@ -515,6 +515,7 @@ namespace Barotrauma.Items.Components
case "requireditem":
if (!overrideRequiredItems) requiredItems.Clear();
overrideRequiredItems = true;
+
RelatedItem newRequiredItem = RelatedItem.Load(subElement);
if (newRequiredItem == null) continue;
diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs
index 8af99c2af..398fb96d3 100644
--- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs
+++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs
@@ -1207,7 +1207,7 @@ namespace Barotrauma
Color color = Color.Red;
if (ic.HasRequiredSkills(character) && ic.HasRequiredItems(character, false)) color = Color.Orange;
- texts.Add(new ColoredText(ic.Msg, color));
+ texts.Add(new ColoredText(ic.Msg, color, false));
}
return texts;
@@ -1608,7 +1608,7 @@ namespace Barotrauma
msg.Write(body.FarseerBody.Awake);
if (body.FarseerBody.Awake)
{
- body.FarseerBody.Enabled = true;
+ body.Enabled = true;
msg.WriteRangedSingle(MathHelper.Clamp(body.LinearVelocity.X, -MaxVel, MaxVel), -MaxVel, MaxVel, 12);
msg.WriteRangedSingle(MathHelper.Clamp(body.LinearVelocity.Y, -MaxVel, MaxVel), -MaxVel, MaxVel, 12);
}
diff --git a/Barotrauma/BarotraumaShared/Source/Map/Levels/Voronoi.cs b/Barotrauma/BarotraumaShared/Source/Map/Levels/Voronoi.cs
index 8be0768ff..064ffe147 100644
--- a/Barotrauma/BarotraumaShared/Source/Map/Levels/Voronoi.cs
+++ b/Barotrauma/BarotraumaShared/Source/Map/Levels/Voronoi.cs
@@ -1,4 +1,4 @@
-/*
+/*
* Created by SharpDevelop.
* User: Burhan
* Date: 17/06/2014
@@ -73,902 +73,902 @@ namespace Voronoi2
/// Description of Voronoi.
///
public class Voronoi
- {
- // ************* Private members ******************
- double borderMinX, borderMaxX, borderMinY, borderMaxY;
- int siteidx;
- double xmin, xmax, ymin, ymax, deltax, deltay;
- int nvertices;
- int nedges;
- int nsites;
- Site[] sites;
- Site bottomsite;
- int sqrt_nsites;
- double minDistanceBetweenSites;
- int PQcount;
- int PQmin;
- int PQhashsize;
- Halfedge[] PQhash;
-
- const int LE = 0;
- const int RE = 1;
+ {
+ // ************* Private members ******************
+ double borderMinX, borderMaxX, borderMinY, borderMaxY;
+ int siteidx;
+ double xmin, xmax, ymin, ymax, deltax, deltay;
+ int nvertices;
+ int nedges;
+ int nsites;
+ Site[] sites;
+ Site bottomsite;
+ int sqrt_nsites;
+ double minDistanceBetweenSites;
+ int PQcount;
+ int PQmin;
+ int PQhashsize;
+ Halfedge[] PQhash;
+
+ const int LE = 0;
+ const int RE = 1;
- int ELhashsize;
- Halfedge[] ELhash;
- Halfedge ELleftend, ELrightend;
- List allEdges;
-
-
- // ************* Public methods ******************
- // ******************************************
-
- // constructor
- public Voronoi ( double minDistanceBetweenSites )
- {
- siteidx = 0;
- sites = null;
-
- allEdges = null;
- this.minDistanceBetweenSites = minDistanceBetweenSites;
- }
-
- /**
- *
- * @param xValuesIn Array of X values for each site.
- * @param yValuesIn Array of Y values for each site. Must be identical length to yValuesIn
- * @param minX The minimum X of the bounding box around the voronoi
- * @param maxX The maximum X of the bounding box around the voronoi
- * @param minY The minimum Y of the bounding box around the voronoi
- * @param maxY The maximum Y of the bounding box around the voronoi
- * @return
- */
- // تستدعى هذه العملية لإنشاء مخطط فورونوي
- public List generateVoronoi ( double[] xValuesIn, double[] yValuesIn, double minX, double maxX, double minY, double maxY )
- {
- sort(xValuesIn, yValuesIn, xValuesIn.Length);
-
- // Check bounding box inputs - if mins are bigger than maxes, swap them
- double temp = 0;
- if ( minX > maxX )
- {
- temp = minX;
- minX = maxX;
- maxX = temp;
- }
- if ( minY > maxY )
- {
- temp = minY;
- minY = maxY;
- maxY = temp;
- }
-
- borderMinX = minX;
- borderMinY = minY;
- borderMaxX = maxX;
- borderMaxY = maxY;
-
- siteidx = 0;
- voronoi_bd ();
- return allEdges;
- }
-
-
- /*********************************************************
- * Private methods - implementation details
- ********************************************************/
-
- private void sort ( double[] xValuesIn, double[] yValuesIn, int count )
- {
- sites = null;
- allEdges = new List();
-
- nsites = count;
- nvertices = 0;
- nedges = 0;
-
- double sn = (double)nsites + 4;
- sqrt_nsites = (int) Math.Sqrt ( sn );
-
- // Copy the inputs so we don't modify the originals
- double[] xValues = new double[count];
- double[] yValues = new double[count];
- for (int i = 0; i < count; i++)
- {
- xValues[i] = xValuesIn[i];
- yValues[i] = yValuesIn[i];
- }
- sortNode ( xValues, yValues, count );
- }
-
- private void qsort ( Site[] sites )
- {
- List listSites = new List( sites.Length );
- for ( int i = 0; i < sites.Length; i++ )
- {
- listSites.Add ( sites[i] );
- }
-
- listSites.Sort ( new SiteSorterYX () );
-
- // Copy back into the array
- for (int i=0; i < sites.Length; i++)
- {
- sites[i] = listSites[i];
- }
- }
-
- private void sortNode ( double[] xValues, double[] yValues, int numPoints )
- {
- nsites = numPoints;
- sites = new Site[nsites];
- xmin = xValues[0];
- ymin = yValues[0];
- xmax = xValues[0];
- ymax = yValues[0];
-
- for ( int i = 0; i < nsites; i++ )
- {
- sites[i] = new Site();
- sites[i].coord.setPoint ( xValues[i], yValues[i] );
- sites[i].sitenbr = i;
-
- if ( xValues[i] < xmin )
- xmin = xValues[i];
- else if ( xValues[i] > xmax )
- xmax = xValues[i];
-
- if ( yValues[i] < ymin )
- ymin = yValues[i];
- else if ( yValues[i] > ymax )
- ymax = yValues[i];
- }
-
- qsort ( sites );
- deltax = xmax - xmin;
- deltay = ymax - ymin;
- }
-
- private Site nextone ()
- {
- Site s;
- if ( siteidx < nsites )
- {
- s = sites[siteidx];
- siteidx++;
- return s;
- }
- return null;
- }
-
- private Edge bisect ( Site s1, Site s2 )
- {
- double dx, dy, adx, ady;
- Edge newedge;
-
- newedge = new Edge();
-
- newedge.reg[0] = s1;
- newedge.reg[1] = s2;
-
- newedge.ep [0] = null;
- newedge.ep[1] = null;
-
- dx = s2.coord.x - s1.coord.x;
- dy = s2.coord.y - s1.coord.y;
-
- adx = dx > 0 ? dx : -dx;
- ady = dy > 0 ? dy : -dy;
- newedge.c = (double)(s1.coord.x * dx + s1.coord.y * dy + (dx * dx + dy* dy) * 0.5);
-
- if ( adx > ady )
- {
- newedge.a = 1.0;
- newedge.b = dy / dx;
- newedge.c /= dx;
- }
- else
- {
- newedge.a = dx / dy;
- newedge.b = 1.0;
- newedge.c /= dy;
- }
-
- newedge.edgenbr = nedges;
- nedges++;
-
- return newedge;
- }
-
- private void makevertex ( Site v )
- {
- v.sitenbr = nvertices;
- nvertices++;
- }
-
- private bool PQinitialize ()
- {
- PQcount = 0;
- PQmin = 0;
- PQhashsize = 4 * sqrt_nsites;
- PQhash = new Halfedge[ PQhashsize ];
-
- for ( int i = 0; i < PQhashsize; i++ )
- {
- PQhash [i] = new Halfedge();
- }
- return true;
- }
-
- private int PQbucket ( Halfedge he )
- {
- int bucket;
-
- bucket = (int) ((he.ystar - ymin) / deltay * PQhashsize);
- if ( bucket < 0 )
- bucket = 0;
- if ( bucket >= PQhashsize )
- bucket = PQhashsize - 1;
- if ( bucket < PQmin )
- PQmin = bucket;
-
- return bucket;
- }
-
- // push the HalfEdge into the ordered linked list of vertices
- private void PQinsert ( Halfedge he, Site v, double offset )
- {
- Halfedge last, next;
-
- he.vertex = v;
- he.ystar = (double)(v.coord.y + offset);
- last = PQhash [ PQbucket (he) ];
-
- while
- (
- (next = last.PQnext) != null
- &&
- (he.ystar > next.ystar || (he.ystar == next.ystar && v.coord.x > next.vertex.coord.x))
- )
- {
- last = next;
- }
-
- he.PQnext = last.PQnext;
- last.PQnext = he;
- PQcount++;
- }
-
- // remove the HalfEdge from the list of vertices
- private void PQdelete ( Halfedge he )
- {
- Halfedge last;
-
- if (he.vertex != null)
- {
- last = PQhash [ PQbucket (he) ];
- while ( last.PQnext != he )
- {
- last = last.PQnext;
- }
-
- last.PQnext = he.PQnext;
- PQcount--;
- he.vertex = null;
- }
- }
-
- private bool PQempty ()
- {
- return ( PQcount == 0 );
- }
-
- private Point PQ_min ()
- {
- Point answer = new Point ();
-
- while ( PQhash[PQmin].PQnext == null )
- {
- PQmin++;
- }
-
- answer.x = PQhash[PQmin].PQnext.vertex.coord.x;
- answer.y = PQhash[PQmin].PQnext.ystar;
- return answer;
- }
-
- private Halfedge PQextractmin ()
- {
- Halfedge curr;
-
- curr = PQhash[PQmin].PQnext;
- PQhash[PQmin].PQnext = curr.PQnext;
- PQcount--;
-
- return curr;
- }
-
- private Halfedge HEcreate(Edge e, int pm)
- {
- Halfedge answer = new Halfedge();
- answer.ELedge = e;
- answer.ELpm = pm;
- answer.PQnext = null;
- answer.vertex = null;
-
- return answer;
- }
-
- private bool ELinitialize()
- {
- ELhashsize = 2 * sqrt_nsites;
- ELhash = new Halfedge[ELhashsize];
-
- for (int i = 0; i < ELhashsize; i++)
- {
- ELhash[i] = null;
- }
-
- ELleftend = HEcreate ( null, 0 );
- ELrightend = HEcreate ( null, 0 );
- ELleftend.ELleft = null;
- ELleftend.ELright = ELrightend;
- ELrightend.ELleft = ELleftend;
- ELrightend.ELright = null;
- ELhash[0] = ELleftend;
- ELhash[ELhashsize - 1] = ELrightend;
-
- return true;
- }
-
- private Halfedge ELright( Halfedge he )
- {
- return he.ELright;
- }
-
- private Halfedge ELleft( Halfedge he )
- {
- return he.ELleft;
- }
-
- private Site leftreg( Halfedge he )
- {
- if (he.ELedge == null)
- {
- return bottomsite;
- }
- return (he.ELpm == LE ? he.ELedge.reg[LE] : he.ELedge.reg[RE]);
- }
-
- private void ELinsert( Halfedge lb, Halfedge newHe )
- {
- newHe.ELleft = lb;
- newHe.ELright = lb.ELright;
- (lb.ELright).ELleft = newHe;
- lb.ELright = newHe;
- }
-
- /*
- * This delete routine can't reclaim node, since pointers from hash table
- * may be present.
- */
- private void ELdelete( Halfedge he )
- {
- (he.ELleft).ELright = he.ELright;
- (he.ELright).ELleft = he.ELleft;
- he.deleted = true;
- }
-
- /* Get entry from hash table, pruning any deleted nodes */
- private Halfedge ELgethash( int b )
- {
- Halfedge he;
- if (b < 0 || b >= ELhashsize)
- return null;
-
- he = ELhash[b];
- if (he == null || !he.deleted )
- return he;
-
- /* Hash table points to deleted half edge. Patch as necessary. */
- ELhash[b] = null;
- return null;
- }
-
- private Halfedge ELleftbnd( Point p )
- {
- int bucket;
- Halfedge he;
-
- /* Use hash table to get close to desired halfedge */
- // use the hash function to find the place in the hash map that this
- // HalfEdge should be
- bucket = (int) ((p.x - xmin) / deltax * ELhashsize);
-
- // make sure that the bucket position is within the range of the hash
- // array
- if ( bucket < 0 ) bucket = 0;
- if ( bucket >= ELhashsize ) bucket = ELhashsize - 1;
-
- he = ELgethash ( bucket );
-
- // if the HE isn't found, search backwards and forwards in the hash map
- // for the first non-null entry
- if ( he == null )
- {
- for ( int i = 1; i < ELhashsize; i++ )
- {
- if ( (he = ELgethash ( bucket - i ) ) != null )
- break;
- if ( (he = ELgethash ( bucket + i ) ) != null )
- break;
- }
- }
-
- /* Now search linear list of halfedges for the correct one */
- if ( he == ELleftend || ( he != ELrightend && right_of (he, p) ) )
- {
- // keep going right on the list until either the end is reached, or
- // you find the 1st edge which the point isn't to the right of
- do
- {
- he = he.ELright;
- }
- while ( he != ELrightend && right_of(he, p) );
- he = he.ELleft;
- }
- else
- // if the point is to the left of the HalfEdge, then search left for
- // the HE just to the left of the point
- {
- do
- {
- he = he.ELleft;
- }
- while ( he != ELleftend && !right_of(he, p) );
- }
-
- /* Update hash table and reference counts */
- if ( bucket > 0 && bucket < ELhashsize - 1)
- {
- ELhash[bucket] = he;
- }
-
- return he;
- }
-
- private void pushGraphEdge( Site leftSite, Site rightSite, Vector2 point1, Vector2 point2 )
- {
- GraphEdge newEdge = new GraphEdge(point1, point2);
- allEdges.Add ( newEdge );
-
- newEdge.site1 = leftSite;
- newEdge.site2 = rightSite;
- }
-
- private void clip_line( Edge e )
- {
- double pxmin, pxmax, pymin, pymax;
- Site s1, s2;
-
- double x1 = e.reg[0].coord.x;
- double y1 = e.reg[0].coord.y;
- double x2 = e.reg[1].coord.x;
- double y2 = e.reg[1].coord.y;
- double x = x2- x1;
- double y = y2 - y1;
-
- // if the distance between the two points this line was created from is
- // less than the square root of 2 عن جد؟, then ignore it
- if ( Math.Sqrt ( (x*x) + (y*y) ) < minDistanceBetweenSites )
- {
- return;
- }
- pxmin = borderMinX;
- pymin = borderMinY;
- pxmax = borderMaxX;
- pymax = borderMaxY;
-
- if ( e.a == 1.0 && e.b >= 0.0 )
- {
- s1 = e.ep[1];
- s2 = e.ep[0];
- }
- else
- {
- s1 = e.ep[0];
- s2 = e.ep[1];
- }
-
- if ( e.a == 1.0 )
- {
- y1 = pymin;
-
- if ( s1 != null && s1.coord.y > pymin )
- y1 = s1.coord.y;
- if ( y1 > pymax )
- y1 = pymax;
- x1 = e.c - e.b * y1;
- y2 = pymax;
-
- if ( s2 != null && s2.coord.y < pymax )
- y2 = s2.coord.y;
- if ( y2 < pymin )
- y2 = pymin;
- x2 = e.c - e.b * y2;
- if ( ( (x1 > pxmax) & (x2 > pxmax) ) | ( (x1 < pxmin) & (x2 < pxmin) ) )
- return;
-
- if ( x1 > pxmax )
- {
- x1 = pxmax;
- y1 = ( e.c - x1 ) / e.b;
- }
- if ( x1 < pxmin )
- {
- x1 = pxmin;
- y1 = ( e.c - x1 ) / e.b;
- }
- if ( x2 > pxmax )
- {
- x2 = pxmax;
- y2 = ( e.c - x2 ) / e.b;
- }
- if ( x2 < pxmin )
- {
- x2 = pxmin;
- y2 = ( e.c - x2 ) / e.b;
- }
-
- }
- else
- {
- x1 = pxmin;
- if ( s1 != null && s1.coord.x > pxmin )
- x1 = s1.coord.x;
- if ( x1 > pxmax )
- x1 = pxmax;
- y1 = e.c - e.a * x1;
-
- x2 = pxmax;
- if ( s2 != null && s2.coord.x < pxmax )
- x2 = s2.coord.x;
- if ( x2 < pxmin )
- x2 = pxmin;
- y2 = e.c - e.a * x2;
-
- if (((y1 > pymax) & (y2 > pymax)) | ((y1 < pymin) & (y2 < pymin)))
- return;
-
- if ( y1 > pymax )
- {
- y1 = pymax;
- x1 = ( e.c - y1 ) / e.a;
- }
- if ( y1 < pymin )
- {
- y1 = pymin;
- x1 = ( e.c - y1 ) / e.a;
- }
- if ( y2 > pymax )
- {
- y2 = pymax;
- x2 = ( e.c - y2 ) / e.a;
- }
- if ( y2 < pymin )
- {
- y2 = pymin;
- x2 = ( e.c - y2 ) / e.a;
- }
- }
+ int ELhashsize;
+ Halfedge[] ELhash;
+ Halfedge ELleftend, ELrightend;
+ List allEdges;
+
+
+ // ************* Public methods ******************
+ // ******************************************
+
+ // constructor
+ public Voronoi ( double minDistanceBetweenSites )
+ {
+ siteidx = 0;
+ sites = null;
+
+ allEdges = null;
+ this.minDistanceBetweenSites = minDistanceBetweenSites;
+ }
+
+ /**
+ *
+ * @param xValuesIn Array of X values for each site.
+ * @param yValuesIn Array of Y values for each site. Must be identical length to yValuesIn
+ * @param minX The minimum X of the bounding box around the voronoi
+ * @param maxX The maximum X of the bounding box around the voronoi
+ * @param minY The minimum Y of the bounding box around the voronoi
+ * @param maxY The maximum Y of the bounding box around the voronoi
+ * @return
+ */
+ // تستدعى هذه العملية لإنشاء مخطط فورونوي
+ public List generateVoronoi ( double[] xValuesIn, double[] yValuesIn, double minX, double maxX, double minY, double maxY )
+ {
+ sort(xValuesIn, yValuesIn, xValuesIn.Length);
+
+ // Check bounding box inputs - if mins are bigger than maxes, swap them
+ double temp = 0;
+ if ( minX > maxX )
+ {
+ temp = minX;
+ minX = maxX;
+ maxX = temp;
+ }
+ if ( minY > maxY )
+ {
+ temp = minY;
+ minY = maxY;
+ maxY = temp;
+ }
+
+ borderMinX = minX;
+ borderMinY = minY;
+ borderMaxX = maxX;
+ borderMaxY = maxY;
+
+ siteidx = 0;
+ voronoi_bd ();
+ return allEdges;
+ }
+
+
+ /*********************************************************
+ * Private methods - implementation details
+ ********************************************************/
+
+ private void sort ( double[] xValuesIn, double[] yValuesIn, int count )
+ {
+ sites = null;
+ allEdges = new List();
+
+ nsites = count;
+ nvertices = 0;
+ nedges = 0;
+
+ double sn = (double)nsites + 4;
+ sqrt_nsites = (int) Math.Sqrt ( sn );
+
+ // Copy the inputs so we don't modify the originals
+ double[] xValues = new double[count];
+ double[] yValues = new double[count];
+ for (int i = 0; i < count; i++)
+ {
+ xValues[i] = xValuesIn[i];
+ yValues[i] = yValuesIn[i];
+ }
+ sortNode ( xValues, yValues, count );
+ }
+
+ private void qsort ( Site[] sites )
+ {
+ List listSites = new List( sites.Length );
+ for ( int i = 0; i < sites.Length; i++ )
+ {
+ listSites.Add ( sites[i] );
+ }
+
+ listSites.Sort ( new SiteSorterYX () );
+
+ // Copy back into the array
+ for (int i=0; i < sites.Length; i++)
+ {
+ sites[i] = listSites[i];
+ }
+ }
+
+ private void sortNode ( double[] xValues, double[] yValues, int numPoints )
+ {
+ nsites = numPoints;
+ sites = new Site[nsites];
+ xmin = xValues[0];
+ ymin = yValues[0];
+ xmax = xValues[0];
+ ymax = yValues[0];
+
+ for ( int i = 0; i < nsites; i++ )
+ {
+ sites[i] = new Site();
+ sites[i].coord.setPoint ( xValues[i], yValues[i] );
+ sites[i].sitenbr = i;
+
+ if ( xValues[i] < xmin )
+ xmin = xValues[i];
+ else if ( xValues[i] > xmax )
+ xmax = xValues[i];
+
+ if ( yValues[i] < ymin )
+ ymin = yValues[i];
+ else if ( yValues[i] > ymax )
+ ymax = yValues[i];
+ }
+
+ qsort ( sites );
+ deltax = xmax - xmin;
+ deltay = ymax - ymin;
+ }
+
+ private Site nextone ()
+ {
+ Site s;
+ if ( siteidx < nsites )
+ {
+ s = sites[siteidx];
+ siteidx++;
+ return s;
+ }
+ return null;
+ }
+
+ private Edge bisect ( Site s1, Site s2 )
+ {
+ double dx, dy, adx, ady;
+ Edge newedge;
+
+ newedge = new Edge();
+
+ newedge.reg[0] = s1;
+ newedge.reg[1] = s2;
+
+ newedge.ep [0] = null;
+ newedge.ep[1] = null;
+
+ dx = s2.coord.x - s1.coord.x;
+ dy = s2.coord.y - s1.coord.y;
+
+ adx = dx > 0 ? dx : -dx;
+ ady = dy > 0 ? dy : -dy;
+ newedge.c = (double)(s1.coord.x * dx + s1.coord.y * dy + (dx * dx + dy* dy) * 0.5);
+
+ if ( adx > ady )
+ {
+ newedge.a = 1.0;
+ newedge.b = dy / dx;
+ newedge.c /= dx;
+ }
+ else
+ {
+ newedge.a = dx / dy;
+ newedge.b = 1.0;
+ newedge.c /= dy;
+ }
+
+ newedge.edgenbr = nedges;
+ nedges++;
+
+ return newedge;
+ }
+
+ private void makevertex ( Site v )
+ {
+ v.sitenbr = nvertices;
+ nvertices++;
+ }
+
+ private bool PQinitialize ()
+ {
+ PQcount = 0;
+ PQmin = 0;
+ PQhashsize = 4 * sqrt_nsites;
+ PQhash = new Halfedge[ PQhashsize ];
+
+ for ( int i = 0; i < PQhashsize; i++ )
+ {
+ PQhash [i] = new Halfedge();
+ }
+ return true;
+ }
+
+ private int PQbucket ( Halfedge he )
+ {
+ int bucket;
+
+ bucket = (int) ((he.ystar - ymin) / deltay * PQhashsize);
+ if ( bucket < 0 )
+ bucket = 0;
+ if ( bucket >= PQhashsize )
+ bucket = PQhashsize - 1;
+ if ( bucket < PQmin )
+ PQmin = bucket;
+
+ return bucket;
+ }
+
+ // push the HalfEdge into the ordered linked list of vertices
+ private void PQinsert ( Halfedge he, Site v, double offset )
+ {
+ Halfedge last, next;
+
+ he.vertex = v;
+ he.ystar = (double)(v.coord.y + offset);
+ last = PQhash [ PQbucket (he) ];
+
+ while
+ (
+ (next = last.PQnext) != null
+ &&
+ (he.ystar > next.ystar || (he.ystar == next.ystar && v.coord.x > next.vertex.coord.x))
+ )
+ {
+ last = next;
+ }
+
+ he.PQnext = last.PQnext;
+ last.PQnext = he;
+ PQcount++;
+ }
+
+ // remove the HalfEdge from the list of vertices
+ private void PQdelete ( Halfedge he )
+ {
+ Halfedge last;
+
+ if (he.vertex != null)
+ {
+ last = PQhash [ PQbucket (he) ];
+ while ( last.PQnext != he )
+ {
+ last = last.PQnext;
+ }
+
+ last.PQnext = he.PQnext;
+ PQcount--;
+ he.vertex = null;
+ }
+ }
+
+ private bool PQempty ()
+ {
+ return ( PQcount == 0 );
+ }
+
+ private Point PQ_min ()
+ {
+ Point answer = new Point ();
+
+ while ( PQhash[PQmin].PQnext == null )
+ {
+ PQmin++;
+ }
+
+ answer.x = PQhash[PQmin].PQnext.vertex.coord.x;
+ answer.y = PQhash[PQmin].PQnext.ystar;
+ return answer;
+ }
+
+ private Halfedge PQextractmin ()
+ {
+ Halfedge curr;
+
+ curr = PQhash[PQmin].PQnext;
+ PQhash[PQmin].PQnext = curr.PQnext;
+ PQcount--;
+
+ return curr;
+ }
+
+ private Halfedge HEcreate(Edge e, int pm)
+ {
+ Halfedge answer = new Halfedge();
+ answer.ELedge = e;
+ answer.ELpm = pm;
+ answer.PQnext = null;
+ answer.vertex = null;
+
+ return answer;
+ }
+
+ private bool ELinitialize()
+ {
+ ELhashsize = 2 * sqrt_nsites;
+ ELhash = new Halfedge[ELhashsize];
+
+ for (int i = 0; i < ELhashsize; i++)
+ {
+ ELhash[i] = null;
+ }
+
+ ELleftend = HEcreate ( null, 0 );
+ ELrightend = HEcreate ( null, 0 );
+ ELleftend.ELleft = null;
+ ELleftend.ELright = ELrightend;
+ ELrightend.ELleft = ELleftend;
+ ELrightend.ELright = null;
+ ELhash[0] = ELleftend;
+ ELhash[ELhashsize - 1] = ELrightend;
+
+ return true;
+ }
+
+ private Halfedge ELright( Halfedge he )
+ {
+ return he.ELright;
+ }
+
+ private Halfedge ELleft( Halfedge he )
+ {
+ return he.ELleft;
+ }
+
+ private Site leftreg( Halfedge he )
+ {
+ if (he.ELedge == null)
+ {
+ return bottomsite;
+ }
+ return (he.ELpm == LE ? he.ELedge.reg[LE] : he.ELedge.reg[RE]);
+ }
+
+ private void ELinsert( Halfedge lb, Halfedge newHe )
+ {
+ newHe.ELleft = lb;
+ newHe.ELright = lb.ELright;
+ (lb.ELright).ELleft = newHe;
+ lb.ELright = newHe;
+ }
+
+ /*
+ * This delete routine can't reclaim node, since pointers from hash table
+ * may be present.
+ */
+ private void ELdelete( Halfedge he )
+ {
+ (he.ELleft).ELright = he.ELright;
+ (he.ELright).ELleft = he.ELleft;
+ he.deleted = true;
+ }
+
+ /* Get entry from hash table, pruning any deleted nodes */
+ private Halfedge ELgethash( int b )
+ {
+ Halfedge he;
+ if (b < 0 || b >= ELhashsize)
+ return null;
+
+ he = ELhash[b];
+ if (he == null || !he.deleted )
+ return he;
+
+ /* Hash table points to deleted half edge. Patch as necessary. */
+ ELhash[b] = null;
+ return null;
+ }
+
+ private Halfedge ELleftbnd( Point p )
+ {
+ int bucket;
+ Halfedge he;
+
+ /* Use hash table to get close to desired halfedge */
+ // use the hash function to find the place in the hash map that this
+ // HalfEdge should be
+ bucket = (int) ((p.x - xmin) / deltax * ELhashsize);
+
+ // make sure that the bucket position is within the range of the hash
+ // array
+ if ( bucket < 0 ) bucket = 0;
+ if ( bucket >= ELhashsize ) bucket = ELhashsize - 1;
+
+ he = ELgethash ( bucket );
+
+ // if the HE isn't found, search backwards and forwards in the hash map
+ // for the first non-null entry
+ if ( he == null )
+ {
+ for ( int i = 1; i < ELhashsize; i++ )
+ {
+ if ( (he = ELgethash ( bucket - i ) ) != null )
+ break;
+ if ( (he = ELgethash ( bucket + i ) ) != null )
+ break;
+ }
+ }
+
+ /* Now search linear list of halfedges for the correct one */
+ if ( he == ELleftend || ( he != ELrightend && right_of (he, p) ) )
+ {
+ // keep going right on the list until either the end is reached, or
+ // you find the 1st edge which the point isn't to the right of
+ do
+ {
+ he = he.ELright;
+ }
+ while ( he != ELrightend && right_of(he, p) );
+ he = he.ELleft;
+ }
+ else
+ // if the point is to the left of the HalfEdge, then search left for
+ // the HE just to the left of the point
+ {
+ do
+ {
+ he = he.ELleft;
+ }
+ while ( he != ELleftend && !right_of(he, p) );
+ }
+
+ /* Update hash table and reference counts */
+ if ( bucket > 0 && bucket < ELhashsize - 1)
+ {
+ ELhash[bucket] = he;
+ }
+
+ return he;
+ }
+
+ private void pushGraphEdge( Site leftSite, Site rightSite, Vector2 point1, Vector2 point2 )
+ {
+ GraphEdge newEdge = new GraphEdge(point1, point2);
+ allEdges.Add ( newEdge );
+
+ newEdge.site1 = leftSite;
+ newEdge.site2 = rightSite;
+ }
+
+ private void clip_line( Edge e )
+ {
+ double pxmin, pxmax, pymin, pymax;
+ Site s1, s2;
+
+ double x1 = e.reg[0].coord.x;
+ double y1 = e.reg[0].coord.y;
+ double x2 = e.reg[1].coord.x;
+ double y2 = e.reg[1].coord.y;
+ double x = x2- x1;
+ double y = y2 - y1;
+
+ // if the distance between the two points this line was created from is
+ // less than the square root of 2 عن جد؟, then ignore it
+ if ( Math.Sqrt ( (x*x) + (y*y) ) < minDistanceBetweenSites )
+ {
+ return;
+ }
+ pxmin = borderMinX;
+ pymin = borderMinY;
+ pxmax = borderMaxX;
+ pymax = borderMaxY;
+
+ if ( e.a == 1.0 && e.b >= 0.0 )
+ {
+ s1 = e.ep[1];
+ s2 = e.ep[0];
+ }
+ else
+ {
+ s1 = e.ep[0];
+ s2 = e.ep[1];
+ }
+
+ if ( e.a == 1.0 )
+ {
+ y1 = pymin;
+
+ if ( s1 != null && s1.coord.y > pymin )
+ y1 = s1.coord.y;
+ if ( y1 > pymax )
+ y1 = pymax;
+ x1 = e.c - e.b * y1;
+ y2 = pymax;
+
+ if ( s2 != null && s2.coord.y < pymax )
+ y2 = s2.coord.y;
+ if ( y2 < pymin )
+ y2 = pymin;
+ x2 = e.c - e.b * y2;
+ if ( ( (x1 > pxmax) & (x2 > pxmax) ) | ( (x1 < pxmin) & (x2 < pxmin) ) )
+ return;
+
+ if ( x1 > pxmax )
+ {
+ x1 = pxmax;
+ y1 = ( e.c - x1 ) / e.b;
+ }
+ if ( x1 < pxmin )
+ {
+ x1 = pxmin;
+ y1 = ( e.c - x1 ) / e.b;
+ }
+ if ( x2 > pxmax )
+ {
+ x2 = pxmax;
+ y2 = ( e.c - x2 ) / e.b;
+ }
+ if ( x2 < pxmin )
+ {
+ x2 = pxmin;
+ y2 = ( e.c - x2 ) / e.b;
+ }
+
+ }
+ else
+ {
+ x1 = pxmin;
+ if ( s1 != null && s1.coord.x > pxmin )
+ x1 = s1.coord.x;
+ if ( x1 > pxmax )
+ x1 = pxmax;
+ y1 = e.c - e.a * x1;
+
+ x2 = pxmax;
+ if ( s2 != null && s2.coord.x < pxmax )
+ x2 = s2.coord.x;
+ if ( x2 < pxmin )
+ x2 = pxmin;
+ y2 = e.c - e.a * x2;
+
+ if (((y1 > pymax) & (y2 > pymax)) | ((y1 < pymin) & (y2 < pymin)))
+ return;
+
+ if ( y1 > pymax )
+ {
+ y1 = pymax;
+ x1 = ( e.c - y1 ) / e.a;
+ }
+ if ( y1 < pymin )
+ {
+ y1 = pymin;
+ x1 = ( e.c - y1 ) / e.a;
+ }
+ if ( y2 > pymax )
+ {
+ y2 = pymax;
+ x2 = ( e.c - y2 ) / e.a;
+ }
+ if ( y2 < pymin )
+ {
+ y2 = pymin;
+ x2 = ( e.c - y2 ) / e.a;
+ }
+ }
pushGraphEdge(e.reg[0], e.reg[1], new Vector2((float)x1, (float)y1), new Vector2((float)x2, (float)y2));
- }
-
- private void endpoint( Edge e, int lr, Site s )
- {
- e.ep[lr] = s;
- if ( e.ep[RE - lr] == null )
- return;
- clip_line ( e );
- }
-
- /* returns true if p is to right of halfedge e */
- private bool right_of(Halfedge el, Point p)
- {
- Edge e;
- Site topsite;
- bool right_of_site;
- bool above, fast;
- double dxp, dyp, dxs, t1, t2, t3, yl;
-
- e = el.ELedge;
- topsite = e.reg[1];
-
- if ( p.x > topsite.coord.x )
- right_of_site = true;
- else
- right_of_site = false;
-
- if ( right_of_site && el.ELpm == LE )
- return true;
- if (!right_of_site && el.ELpm == RE )
- return false;
-
- if ( e.a == 1.0 )
- {
- dxp = p.x - topsite.coord.x;
- dyp = p.y - topsite.coord.y;
- fast = false;
-
- if ( (!right_of_site & (e.b < 0.0)) | (right_of_site & (e.b >= 0.0)) )
- {
- above = dyp >= e.b * dxp;
- fast = above;
- }
- else
- {
- above = p.x + p.y * e.b > e.c;
- if ( e.b < 0.0 )
- above = !above;
- if ( !above )
- fast = true;
- }
- if ( !fast )
- {
- dxs = topsite.coord.x - ( e.reg[0] ).coord.x;
- above = e.b * (dxp * dxp - dyp * dyp)
- < dxs * dyp * (1.0 + 2.0 * dxp / dxs + e.b * e.b);
-
- if ( e.b < 0 )
- above = !above;
- }
- }
- else // e.b == 1.0
- {
- yl = e.c - e.a * p.x;
- t1 = p.y - yl;
- t2 = p.x - topsite.coord.x;
- t3 = yl - topsite.coord.y;
- above = t1 * t1 > t2 * t2 + t3 * t3;
- }
- return ( el.ELpm == LE ? above : !above );
- }
-
- private Site rightreg(Halfedge he)
- {
- if (he.ELedge == (Edge) null)
- // if this halfedge has no edge, return the bottom site (whatever
- // that is)
- {
- return (bottomsite);
- }
+ }
+
+ private void endpoint( Edge e, int lr, Site s )
+ {
+ e.ep[lr] = s;
+ if ( e.ep[RE - lr] == null )
+ return;
+ clip_line ( e );
+ }
+
+ /* returns true if p is to right of halfedge e */
+ private bool right_of(Halfedge el, Point p)
+ {
+ Edge e;
+ Site topsite;
+ bool right_of_site;
+ bool above, fast;
+ double dxp, dyp, dxs, t1, t2, t3, yl;
+
+ e = el.ELedge;
+ topsite = e.reg[1];
+
+ if ( p.x > topsite.coord.x )
+ right_of_site = true;
+ else
+ right_of_site = false;
+
+ if ( right_of_site && el.ELpm == LE )
+ return true;
+ if (!right_of_site && el.ELpm == RE )
+ return false;
+
+ if ( e.a == 1.0 )
+ {
+ dxp = p.x - topsite.coord.x;
+ dyp = p.y - topsite.coord.y;
+ fast = false;
+
+ if ( (!right_of_site & (e.b < 0.0)) | (right_of_site & (e.b >= 0.0)) )
+ {
+ above = dyp >= e.b * dxp;
+ fast = above;
+ }
+ else
+ {
+ above = p.x + p.y * e.b > e.c;
+ if ( e.b < 0.0 )
+ above = !above;
+ if ( !above )
+ fast = true;
+ }
+ if ( !fast )
+ {
+ dxs = topsite.coord.x - ( e.reg[0] ).coord.x;
+ above = e.b * (dxp * dxp - dyp * dyp)
+ < dxs * dyp * (1.0 + 2.0 * dxp / dxs + e.b * e.b);
+
+ if ( e.b < 0 )
+ above = !above;
+ }
+ }
+ else // e.b == 1.0
+ {
+ yl = e.c - e.a * p.x;
+ t1 = p.y - yl;
+ t2 = p.x - topsite.coord.x;
+ t3 = yl - topsite.coord.y;
+ above = t1 * t1 > t2 * t2 + t3 * t3;
+ }
+ return ( el.ELpm == LE ? above : !above );
+ }
+
+ private Site rightreg(Halfedge he)
+ {
+ if (he.ELedge == (Edge) null)
+ // if this halfedge has no edge, return the bottom site (whatever
+ // that is)
+ {
+ return (bottomsite);
+ }
- // if the ELpm field is zero, return the site 0 that this edge bisects,
- // otherwise return site number 1
- return (he.ELpm == LE ? he.ELedge.reg[RE] : he.ELedge.reg[LE]);
- }
-
- private double dist( Site s, Site t )
- {
- double dx, dy;
- dx = s.coord.x - t.coord.x;
- dy = s.coord.y - t.coord.y;
- return Math.Sqrt ( dx * dx + dy * dy );
- }
-
- // create a new site where the HalfEdges el1 and el2 intersect - note that
- // the Point in the argument list is not used, don't know why it's there
- private Site intersect( Halfedge el1, Halfedge el2 )
- {
- Edge e1, e2, e;
- Halfedge el;
- double d, xint, yint;
- bool right_of_site;
- Site v; // vertex
-
- e1 = el1.ELedge;
- e2 = el2.ELedge;
-
- if ( e1 == null || e2 == null )
- return null;
-
- // if the two edges bisect the same parent, return null
- if ( e1.reg[1] == e2.reg[1] )
- return null;
-
- d = e1.a * e2.b - e1.b * e2.a;
- if ( -1.0e-10 < d && d < 1.0e-10 )
- return null;
-
- xint = ( e1.c * e2.b - e2.c * e1.b ) / d;
- yint = ( e2.c * e1.a - e1.c * e2.a ) / d;
-
- if ( (e1.reg[1].coord.y < e2.reg[1].coord.y)
- || (e1.reg[1].coord.y == e2.reg[1].coord.y && e1.reg[1].coord.x < e2.reg[1].coord.x) )
- {
- el = el1;
- e = e1;
- }
- else
- {
- el = el2;
- e = e2;
- }
-
- right_of_site = xint >= e.reg[1].coord.x;
- if ((right_of_site && el.ELpm == LE)
- || (!right_of_site && el.ELpm == RE))
- return null;
-
- // create a new site at the point of intersection - this is a new vector
- // event waiting to happen
- v = new Site();
- v.coord.x = xint;
- v.coord.y = yint;
- return v;
- }
-
- /*
- * implicit parameters: nsites, sqrt_nsites, xmin, xmax, ymin, ymax, deltax,
- * deltay (can all be estimates). Performance suffers if they are wrong;
- * better to make nsites, deltax, and deltay too big than too small. (?)
- */
- private bool voronoi_bd()
- {
- Site newsite, bot, top, temp, p;
- Site v;
- Point newintstar = null;
- int pm;
- Halfedge lbnd, rbnd, llbnd, rrbnd, bisector;
- Edge e;
+ // if the ELpm field is zero, return the site 0 that this edge bisects,
+ // otherwise return site number 1
+ return (he.ELpm == LE ? he.ELedge.reg[RE] : he.ELedge.reg[LE]);
+ }
+
+ private double dist( Site s, Site t )
+ {
+ double dx, dy;
+ dx = s.coord.x - t.coord.x;
+ dy = s.coord.y - t.coord.y;
+ return Math.Sqrt ( dx * dx + dy * dy );
+ }
+
+ // create a new site where the HalfEdges el1 and el2 intersect - note that
+ // the Point in the argument list is not used, don't know why it's there
+ private Site intersect( Halfedge el1, Halfedge el2 )
+ {
+ Edge e1, e2, e;
+ Halfedge el;
+ double d, xint, yint;
+ bool right_of_site;
+ Site v; // vertex
+
+ e1 = el1.ELedge;
+ e2 = el2.ELedge;
+
+ if ( e1 == null || e2 == null )
+ return null;
+
+ // if the two edges bisect the same parent, return null
+ if ( e1.reg[1] == e2.reg[1] )
+ return null;
+
+ d = e1.a * e2.b - e1.b * e2.a;
+ if ( -1.0e-10 < d && d < 1.0e-10 )
+ return null;
+
+ xint = ( e1.c * e2.b - e2.c * e1.b ) / d;
+ yint = ( e2.c * e1.a - e1.c * e2.a ) / d;
+
+ if ( (e1.reg[1].coord.y < e2.reg[1].coord.y)
+ || (e1.reg[1].coord.y == e2.reg[1].coord.y && e1.reg[1].coord.x < e2.reg[1].coord.x) )
+ {
+ el = el1;
+ e = e1;
+ }
+ else
+ {
+ el = el2;
+ e = e2;
+ }
+
+ right_of_site = xint >= e.reg[1].coord.x;
+ if ((right_of_site && el.ELpm == LE)
+ || (!right_of_site && el.ELpm == RE))
+ return null;
+
+ // create a new site at the point of intersection - this is a new vector
+ // event waiting to happen
+ v = new Site();
+ v.coord.x = xint;
+ v.coord.y = yint;
+ return v;
+ }
+
+ /*
+ * implicit parameters: nsites, sqrt_nsites, xmin, xmax, ymin, ymax, deltax,
+ * deltay (can all be estimates). Performance suffers if they are wrong;
+ * better to make nsites, deltax, and deltay too big than too small. (?)
+ */
+ private bool voronoi_bd()
+ {
+ Site newsite, bot, top, temp, p;
+ Site v;
+ Point newintstar = null;
+ int pm;
+ Halfedge lbnd, rbnd, llbnd, rrbnd, bisector;
+ Edge e;
- PQinitialize();
- ELinitialize();
+ PQinitialize();
+ ELinitialize();
- bottomsite = nextone();
- newsite = nextone();
- while (true)
- {
- if (!PQempty())
- {
- newintstar = PQ_min();
- }
- // if the lowest site has a smaller y value than the lowest vector
- // intersection,
- // process the site otherwise process the vector intersection
+ bottomsite = nextone();
+ newsite = nextone();
+ while (true)
+ {
+ if (!PQempty())
+ {
+ newintstar = PQ_min();
+ }
+ // if the lowest site has a smaller y value than the lowest vector
+ // intersection,
+ // process the site otherwise process the vector intersection
- if (newsite != null && (PQempty()
- || newsite.coord.y < newintstar.y
- || (newsite.coord.y == newintstar.y
- && newsite.coord.x < newintstar.x)))
- {
- /* new site is smallest -this is a site event */
- // get the first HalfEdge to the LEFT of the new site
- lbnd = ELleftbnd((newsite.coord));
- // get the first HalfEdge to the RIGHT of the new site
- rbnd = ELright(lbnd);
- // if this halfedge has no edge,bot =bottom site (whatever that
- // is)
- bot = rightreg(lbnd);
- // create a new edge that bisects
- e = bisect(bot, newsite);
+ if (newsite != null && (PQempty()
+ || newsite.coord.y < newintstar.y
+ || (newsite.coord.y == newintstar.y
+ && newsite.coord.x < newintstar.x)))
+ {
+ /* new site is smallest -this is a site event */
+ // get the first HalfEdge to the LEFT of the new site
+ lbnd = ELleftbnd((newsite.coord));
+ // get the first HalfEdge to the RIGHT of the new site
+ rbnd = ELright(lbnd);
+ // if this halfedge has no edge,bot =bottom site (whatever that
+ // is)
+ bot = rightreg(lbnd);
+ // create a new edge that bisects
+ e = bisect(bot, newsite);
- // create a new HalfEdge, setting its ELpm field to 0
- bisector = HEcreate(e, LE);
- // insert this new bisector edge between the left and right
- // vectors in a linked list
- ELinsert(lbnd, bisector);
+ // create a new HalfEdge, setting its ELpm field to 0
+ bisector = HEcreate(e, LE);
+ // insert this new bisector edge between the left and right
+ // vectors in a linked list
+ ELinsert(lbnd, bisector);
- // if the new bisector intersects with the left edge,
- // remove the left edge's vertex, and put in the new one
- if ((p = intersect(lbnd, bisector)) != null)
- {
- PQdelete(lbnd);
- PQinsert(lbnd, p, dist(p, newsite));
- }
- lbnd = bisector;
- // create a new HalfEdge, setting its ELpm field to 1
- bisector = HEcreate(e, RE);
- // insert the new HE to the right of the original bisector
- // earlier in the IF stmt
- ELinsert(lbnd, bisector);
+ // if the new bisector intersects with the left edge,
+ // remove the left edge's vertex, and put in the new one
+ if ((p = intersect(lbnd, bisector)) != null)
+ {
+ PQdelete(lbnd);
+ PQinsert(lbnd, p, dist(p, newsite));
+ }
+ lbnd = bisector;
+ // create a new HalfEdge, setting its ELpm field to 1
+ bisector = HEcreate(e, RE);
+ // insert the new HE to the right of the original bisector
+ // earlier in the IF stmt
+ ELinsert(lbnd, bisector);
- // if this new bisector intersects with the new HalfEdge
- if ((p = intersect(bisector, rbnd)) != null)
- {
- // push the HE into the ordered linked list of vertices
- PQinsert(bisector, p, dist(p, newsite));
- }
- newsite = nextone();
- } else if (!PQempty())
- /* intersection is smallest - this is a vector event */
- {
- // pop the HalfEdge with the lowest vector off the ordered list
- // of vectors
- lbnd = PQextractmin();
- // get the HalfEdge to the left of the above HE
- llbnd = ELleft(lbnd);
- // get the HalfEdge to the right of the above HE
- rbnd = ELright(lbnd);
- // get the HalfEdge to the right of the HE to the right of the
- // lowest HE
- rrbnd = ELright(rbnd);
- // get the Site to the left of the left HE which it bisects
- bot = leftreg(lbnd);
- // get the Site to the right of the right HE which it bisects
- top = rightreg(rbnd);
+ // if this new bisector intersects with the new HalfEdge
+ if ((p = intersect(bisector, rbnd)) != null)
+ {
+ // push the HE into the ordered linked list of vertices
+ PQinsert(bisector, p, dist(p, newsite));
+ }
+ newsite = nextone();
+ } else if (!PQempty())
+ /* intersection is smallest - this is a vector event */
+ {
+ // pop the HalfEdge with the lowest vector off the ordered list
+ // of vectors
+ lbnd = PQextractmin();
+ // get the HalfEdge to the left of the above HE
+ llbnd = ELleft(lbnd);
+ // get the HalfEdge to the right of the above HE
+ rbnd = ELright(lbnd);
+ // get the HalfEdge to the right of the HE to the right of the
+ // lowest HE
+ rrbnd = ELright(rbnd);
+ // get the Site to the left of the left HE which it bisects
+ bot = leftreg(lbnd);
+ // get the Site to the right of the right HE which it bisects
+ top = rightreg(rbnd);
- v = lbnd.vertex; // get the vertex that caused this event
- makevertex(v); // set the vertex number - couldn't do this
- // earlier since we didn't know when it would be processed
- endpoint(lbnd.ELedge, lbnd.ELpm, v);
- // set the endpoint of
- // the left HalfEdge to be this vector
- endpoint(rbnd.ELedge, rbnd.ELpm, v);
- // set the endpoint of the right HalfEdge to
- // be this vector
- ELdelete(lbnd); // mark the lowest HE for
- // deletion - can't delete yet because there might be pointers
- // to it in Hash Map
- PQdelete(rbnd);
- // remove all vertex events to do with the right HE
- ELdelete(rbnd); // mark the right HE for
- // deletion - can't delete yet because there might be pointers
- // to it in Hash Map
- pm = LE; // set the pm variable to zero
+ v = lbnd.vertex; // get the vertex that caused this event
+ makevertex(v); // set the vertex number - couldn't do this
+ // earlier since we didn't know when it would be processed
+ endpoint(lbnd.ELedge, lbnd.ELpm, v);
+ // set the endpoint of
+ // the left HalfEdge to be this vector
+ endpoint(rbnd.ELedge, rbnd.ELpm, v);
+ // set the endpoint of the right HalfEdge to
+ // be this vector
+ ELdelete(lbnd); // mark the lowest HE for
+ // deletion - can't delete yet because there might be pointers
+ // to it in Hash Map
+ PQdelete(rbnd);
+ // remove all vertex events to do with the right HE
+ ELdelete(rbnd); // mark the right HE for
+ // deletion - can't delete yet because there might be pointers
+ // to it in Hash Map
+ pm = LE; // set the pm variable to zero
- if (bot.coord.y > top.coord.y)
- // if the site to the left of the event is higher than the
- // Site
- { // to the right of it, then swap them and set the 'pm'
- // variable to 1
- temp = bot;
- bot = top;
- top = temp;
- pm = RE;
- }
- e = bisect(bot, top); // create an Edge (or line)
- // that is between the two Sites. This creates the formula of
- // the line, and assigns a line number to it
- bisector = HEcreate(e, pm); // create a HE from the Edge 'e',
- // and make it point to that edge
- // with its ELedge field
- ELinsert(llbnd, bisector); // insert the new bisector to the
- // right of the left HE
- endpoint(e, RE - pm, v); // set one endpoint to the new edge
- // to be the vector point 'v'.
- // If the site to the left of this bisector is higher than the
- // right Site, then this endpoint
- // is put in position 0; otherwise in pos 1
+ if (bot.coord.y > top.coord.y)
+ // if the site to the left of the event is higher than the
+ // Site
+ { // to the right of it, then swap them and set the 'pm'
+ // variable to 1
+ temp = bot;
+ bot = top;
+ top = temp;
+ pm = RE;
+ }
+ e = bisect(bot, top); // create an Edge (or line)
+ // that is between the two Sites. This creates the formula of
+ // the line, and assigns a line number to it
+ bisector = HEcreate(e, pm); // create a HE from the Edge 'e',
+ // and make it point to that edge
+ // with its ELedge field
+ ELinsert(llbnd, bisector); // insert the new bisector to the
+ // right of the left HE
+ endpoint(e, RE - pm, v); // set one endpoint to the new edge
+ // to be the vector point 'v'.
+ // If the site to the left of this bisector is higher than the
+ // right Site, then this endpoint
+ // is put in position 0; otherwise in pos 1
- // if left HE and the new bisector intersect, then delete
- // the left HE, and reinsert it
- if ((p = intersect(llbnd, bisector)) != null)
- {
- PQdelete(llbnd);
- PQinsert(llbnd, p, dist(p, bot));
- }
+ // if left HE and the new bisector intersect, then delete
+ // the left HE, and reinsert it
+ if ((p = intersect(llbnd, bisector)) != null)
+ {
+ PQdelete(llbnd);
+ PQinsert(llbnd, p, dist(p, bot));
+ }
- // if right HE and the new bisector intersect, then
- // reinsert it
- if ((p = intersect(bisector, rrbnd)) != null)
- {
- PQinsert(bisector, p, dist(p, bot));
- }
- } else
- {
- break;
- }
- }
+ // if right HE and the new bisector intersect, then
+ // reinsert it
+ if ((p = intersect(bisector, rrbnd)) != null)
+ {
+ PQinsert(bisector, p, dist(p, bot));
+ }
+ } else
+ {
+ break;
+ }
+ }
- for (lbnd = ELright(ELleftend); lbnd != ELrightend; lbnd = ELright(lbnd))
- {
- e = lbnd.ELedge;
- clip_line(e);
- }
+ for (lbnd = ELright(ELleftend); lbnd != ELrightend; lbnd = ELright(lbnd))
+ {
+ e = lbnd.ELedge;
+ clip_line(e);
+ }
- return true;
- }
+ return true;
+ }
public List MakeVoronoiGraph(List sites, float minX, float minY, float maxX, float maxY)
{
@@ -994,5 +994,5 @@ namespace Voronoi2
return generateVoronoi(xVal, yVal, 0, width, 0, height);
}
- } // Voronoi Class End
+ } // Voronoi Class End
} // namespace Voronoi2 End
\ No newline at end of file
diff --git a/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs b/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs
index a8e039f9b..22641dfb4 100644
--- a/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs
+++ b/Barotrauma/BarotraumaShared/Source/Map/Levels/VoronoiElements.cs
@@ -1,4 +1,4 @@
-/*
+/*
* Created by SharpDevelop.
* User: Burhan
* Date: 17/06/2014
@@ -8,31 +8,31 @@
*/
/*
- Copyright 2011 James Humphreys. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification, are
- permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of
- conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright notice, this list
- of conditions and the following disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY James Humphreys ``AS IS\" AND ANY EXPRESS OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- The views and conclusions contained in the software and documentation are those of the
- authors and should not be interpreted as representing official policies, either expressed
- or implied, of James Humphreys.
+ Copyright 2011 James Humphreys. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without modification, are
+ permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this list of
+ conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ of conditions and the following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY James Humphreys ``AS IS\" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ The views and conclusions contained in the software and documentation are those of the
+ authors and should not be interpreted as representing official policies, either expressed
+ or implied, of James Humphreys.
*/
/*
@@ -58,63 +58,63 @@ using System.Collections.Generic;
namespace Voronoi2
{
public class Point
- {
- public double x, y;
-
- public void setPoint ( double x, double y )
- {
- this.x = x;
- this.y = y;
- }
- }
-
- // use for sites and vertecies
- public class Site
- {
- public Point coord;
- public int sitenbr;
+ {
+ public double x, y;
+
+ public void setPoint ( double x, double y )
+ {
+ this.x = x;
+ this.y = y;
+ }
+ }
+
+ // use for sites and vertecies
+ public class Site
+ {
+ public Point coord;
+ public int sitenbr;
public void SetPoint(Vector2 point)
{
coord.setPoint(point.X, point.Y);
}
-
- public Site ()
- {
- coord = new Point();
- }
- }
-
- public class Edge
- {
- public double a = 0, b = 0, c = 0;
- public Site[] ep;
- public Site[] reg;
- public int edgenbr;
-
- public Edge ()
- {
- ep = new Site[2];
- reg = new Site[2];
- }
- }
-
-
- public class Halfedge
- {
- public Halfedge ELleft, ELright;
- public Edge ELedge;
- public bool deleted;
- public int ELpm;
- public Site vertex;
- public double ystar;
- public Halfedge PQnext;
-
- public Halfedge ()
- {
- PQnext = null;
- }
- }
+
+ public Site ()
+ {
+ coord = new Point();
+ }
+ }
+
+ public class Edge
+ {
+ public double a = 0, b = 0, c = 0;
+ public Site[] ep;
+ public Site[] reg;
+ public int edgenbr;
+
+ public Edge ()
+ {
+ ep = new Site[2];
+ reg = new Site[2];
+ }
+ }
+
+
+ public class Halfedge
+ {
+ public Halfedge ELleft, ELright;
+ public Edge ELedge;
+ public bool deleted;
+ public int ELpm;
+ public Site vertex;
+ public double ystar;
+ public Halfedge PQnext;
+
+ public Halfedge ()
+ {
+ PQnext = null;
+ }
+ }
public enum CellType
{
@@ -187,11 +187,11 @@ namespace Voronoi2
return true;
}
}
-
- public class GraphEdge
- {
+
+ public class GraphEdge
+ {
public Vector2 point1, point2;
- public Site site1, site2;
+ public Site site1, site2;
public VoronoiCell cell1, cell2;
public bool isSolid;
@@ -239,20 +239,20 @@ namespace Voronoi2
return normal;
}
- }
-
- // للترتيب
- public class SiteSorterYX : IComparer
- {
- public int Compare ( Site p1, Site p2 )
- {
- Point s1 = p1.coord;
- Point s2 = p2.coord;
- if ( s1.y < s2.y ) return -1;
- if ( s1.y > s2.y ) return 1;
- if ( s1.x < s2.x ) return -1;
- if ( s1.x > s2.x ) return 1;
- return 0;
- }
- }
+ }
+
+ // للترتيب
+ public class SiteSorterYX : IComparer
+ {
+ public int Compare ( Site p1, Site p2 )
+ {
+ Point s1 = p1.coord;
+ Point s2 = p2.coord;
+ if ( s1.y < s2.y ) return -1;
+ if ( s1.y > s2.y ) return 1;
+ if ( s1.x < s2.x ) return -1;
+ if ( s1.x > s2.x ) return 1;
+ return 0;
+ }
+ }
}
diff --git a/Barotrauma/BarotraumaShared/Source/Map/MapEntity.cs b/Barotrauma/BarotraumaShared/Source/Map/MapEntity.cs
index f8daabce2..5f620dd21 100644
--- a/Barotrauma/BarotraumaShared/Source/Map/MapEntity.cs
+++ b/Barotrauma/BarotraumaShared/Source/Map/MapEntity.cs
@@ -89,11 +89,11 @@ namespace Barotrauma
get { return false; }
}
- protected bool ResizeHorizontal
+ public bool ResizeHorizontal
{
get { return prefab != null && prefab.ResizeHorizontal; }
}
- protected bool ResizeVertical
+ public bool ResizeVertical
{
get { return prefab != null && prefab.ResizeVertical; }
}
diff --git a/Barotrauma/BarotraumaShared/Source/Map/Structure.cs b/Barotrauma/BarotraumaShared/Source/Map/Structure.cs
index 86f51b512..d70c6faf5 100644
--- a/Barotrauma/BarotraumaShared/Source/Map/Structure.cs
+++ b/Barotrauma/BarotraumaShared/Source/Map/Structure.cs
@@ -848,6 +848,7 @@ namespace Barotrauma
{
StairDirection = StairDirection == Direction.Left ? Direction.Right : Direction.Left;
bodies.ForEach(b => GameMain.World.RemoveBody(b));
+ bodies.Clear();
CreateStairBodies();
}
diff --git a/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs b/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs
index 854adb3be..c44d7b514 100644
--- a/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs
+++ b/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs
@@ -1208,9 +1208,9 @@ namespace Barotrauma
Item.ItemList.Clear();
}
- PhysicsBody.RemoveAll();
+ Ragdoll.RemoveAll();
- Ragdoll.list.Clear();
+ PhysicsBody.RemoveAll();
GameMain.World.Clear();
diff --git a/Barotrauma/BarotraumaShared/Source/Networking/Client.cs b/Barotrauma/BarotraumaShared/Source/Networking/Client.cs
index f380611f0..fff97a991 100644
--- a/Barotrauma/BarotraumaShared/Source/Networking/Client.cs
+++ b/Barotrauma/BarotraumaShared/Source/Networking/Client.cs
@@ -126,7 +126,7 @@ namespace Barotrauma.Networking
public static bool IsValidName(string name)
{
- if (name.Contains("\n") || name.Contains("\r\n")) return false;
+ if (name.Contains("\n") || name.Contains("\r")) return false;
return (name.All(c =>
c != ';' &&
diff --git a/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs b/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs
index c40d8f9d3..56d21c33d 100644
--- a/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs
+++ b/Barotrauma/BarotraumaShared/Source/Networking/GameServerLogin.cs
@@ -172,7 +172,7 @@ namespace Barotrauma.Networking
DebugConsole.NewMessage(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (invalid name)", Color.Red);
return;
}
- if (clName.ToLower() == Name.ToLower())
+ if (Homoglyphs.Compare(clName.ToLower(),Name.ToLower()))
{
DisconnectUnauthClient(inc, unauthClient, "That name is taken.");
Log(clName + " (" + inc.SenderConnection.RemoteEndPoint.Address.ToString() + ") couldn't join the server (name taken by the server)", ServerLog.MessageType.Error);
diff --git a/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs b/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs
index cc07cf19e..d6fe0543f 100644
--- a/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs
+++ b/Barotrauma/BarotraumaShared/Source/Networking/GameServerSettings.cs
@@ -349,9 +349,12 @@ namespace Barotrauma.Networking
{
clientPermissions.Clear();
- if (File.Exists("Data/clientpermissions.txt") && !File.Exists(ClientPermissionsFile))
+ if (!File.Exists(ClientPermissionsFile))
{
- LoadClientPermissionsOld("Data/clientpermissions.txt");
+ if (File.Exists("Data/clientpermissions.txt"))
+ {
+ LoadClientPermissionsOld("Data/clientpermissions.txt");
+ }
return;
}
diff --git a/Barotrauma/BarotraumaShared/Source/PlayerInput.cs b/Barotrauma/BarotraumaShared/Source/PlayerInput.cs
index 93d14d3f2..4b8df2fa1 100644
--- a/Barotrauma/BarotraumaShared/Source/PlayerInput.cs
+++ b/Barotrauma/BarotraumaShared/Source/PlayerInput.cs
@@ -1,4 +1,4 @@
-using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Input;
namespace Barotrauma
{
@@ -94,9 +94,9 @@ namespace Barotrauma
}
}
- class Key
- {
- private bool hit, hitQueue;
+ class Key
+ {
+ private bool hit, hitQueue;
private bool held, heldQueue;
@@ -106,23 +106,23 @@ namespace Barotrauma
//{
// get { return canBeHeld; }
//}
-
- public Key(KeyOrMouse binding)
- {
+
+ public Key(KeyOrMouse binding)
+ {
this.binding = binding;
- }
+ }
- public bool Hit
- {
- get
- {
- return hit;
- }
- set
- {
- hit = value;
- }
- }
+ public bool Hit
+ {
+ get
+ {
+ return hit;
+ }
+ set
+ {
+ hit = value;
+ }
+ }
public bool Held
{
@@ -141,14 +141,14 @@ namespace Barotrauma
get { return binding; }
}
- public void SetState()
- {
- hit = binding.IsHit();
- if (hit) hitQueue = true;
+ public void SetState()
+ {
+ hit = binding.IsHit();
+ if (hit) hitQueue = true;
held = binding.IsDown();
if (held) heldQueue = true;
- }
+ }
public void SetState(bool hit, bool held)
{
@@ -156,12 +156,12 @@ namespace Barotrauma
if (held) heldQueue = true;
}
- public bool DequeueHit()
- {
- bool value = hitQueue;
- hitQueue = false;
- return value;
- }
+ public bool DequeueHit()
+ {
+ bool value = hitQueue;
+ hitQueue = false;
+ return value;
+ }
public bool DequeueHeld()
{
@@ -187,11 +187,11 @@ namespace Barotrauma
held = false;
}
- public void ResetHit()
- {
- hit = false;
- //stateQueue = false;
- }
+ public void ResetHit()
+ {
+ hit = false;
+ //stateQueue = false;
+ }
public void ResetHeld()
@@ -199,5 +199,5 @@ namespace Barotrauma
held = false;
//stateQueue = false;
}
- }
+ }
}
diff --git a/Barotrauma/BarotraumaShared/Source/Utils/MathUtils.cs b/Barotrauma/BarotraumaShared/Source/Utils/MathUtils.cs
index 637afaeef..92e0a1b16 100644
--- a/Barotrauma/BarotraumaShared/Source/Utils/MathUtils.cs
+++ b/Barotrauma/BarotraumaShared/Source/Utils/MathUtils.cs
@@ -508,6 +508,52 @@ namespace Barotrauma
// Return formatted number with suffix
return readable.ToString("0.# ") + suffix;
}
+
+ public static void SplitRectanglesHorizontal(List rects, Vector2 point)
+ {
+ for (int i = 0; i < rects.Count; i++)
+ {
+ if (point.Y > rects[i].Y && point.Y < rects[i].Y + rects[i].Height)
+ {
+ Rectangle rect1 = rects[i];
+ Rectangle rect2 = rects[i];
+
+ rect1.Height = (int)(point.Y - rects[i].Y);
+
+ rect2.Height = rects[i].Height - rect1.Height;
+ rect2.Y = rect1.Y + rect1.Height;
+ rects[i] = rect1;
+ rects.Insert(i + 1, rect2); i++;
+ }
+ }
+ }
+
+ public static void SplitRectanglesVertical(List rects, Vector2 point)
+ {
+ for (int i = 0; i < rects.Count; i++)
+ {
+ if (point.X>rects[i].X && point.X
diff --git a/Barotrauma/BarotraumaShared/libSDL2-2.0.0.dylib b/Barotrauma/BarotraumaShared/libSDL2-2.0.0.dylib
new file mode 100644
index 000000000..11f29935e
Binary files /dev/null and b/Barotrauma/BarotraumaShared/libSDL2-2.0.0.dylib differ
diff --git a/Barotrauma/BarotraumaShared/libopenal.1.dylib b/Barotrauma/BarotraumaShared/libopenal.1.dylib
new file mode 100644
index 000000000..df9570d57
Binary files /dev/null and b/Barotrauma/BarotraumaShared/libopenal.1.dylib differ
diff --git a/Barotrauma/Launcher/Launcher.csproj b/Barotrauma/Launcher/Launcher.csproj
index 7497c06cd..ce8513eb4 100644
--- a/Barotrauma/Launcher/Launcher.csproj
+++ b/Barotrauma/Launcher/Launcher.csproj
@@ -1,7 +1,7 @@
- Debug
+ ReleaseLinux
x86
8.0.30703
2.0
@@ -9,38 +9,54 @@
WinExe
Properties
Launcher
- Barotrauma Launcher
+ Launcher
512
Windows
v4.5
-
-
- x86
- true
- full
- false
- ..\bin\Windows\Debug\
- DEBUG;TRACE;WINDOWS
- prompt
- 4
- false
-
-
- x86
- pdbonly
- true
- ..\bin\Windows\Release\
- TRACE;WINDOWS
- prompt
- 4
- false
+ 0.7.0.1
Icon.ico
+
+ true
+ pdbonly
+ true
+ ..\bin\ReleaseLinux
+ TRACE;LINUX;CLIENT
+ 4
+ x86
+
+
+ true
+ full
+ false
+ ..\bin\DebugLinux
+ TRACE;LINUX;CLIENT;DEBUG
+ 4
+ x86
+
+
+ true
+ pdbonly
+ true
+ ..\bin\ReleaseWindows
+ TRACE;WINDOWS;CLIENT
+ 4
+ x86
+
+
+ true
+ full
+ false
+ ..\bin\DebugWindows
+ TRACE;WINDOWS;CLIENT;DEBUG
+ 4
+ x86
+
diff --git a/Barotrauma_Solution.sln b/Barotrauma_Solution.sln
index 7a68d0beb..4a32e93f9 100644
--- a/Barotrauma_Solution.sln
+++ b/Barotrauma_Solution.sln
@@ -45,429 +45,78 @@ Global
Libraries\SharpFont\Source\SharpFontShared\SharpFontShared.projitems*{c293db32-fa42-486d-b128-5a12522fae4e}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Android|Any CPU = Android|Any CPU
- Android|Mixed Platforms = Android|Mixed Platforms
- Android|x86 = Android|x86
- Debug|Any CPU = Debug|Any CPU
- Debug|Mixed Platforms = Debug|Mixed Platforms
+ DebugLinux|x86 = DebugLinux|x86
+ DebugWindows|x86 = DebugWindows|x86
+ ReleaseLinux|x86 = ReleaseLinux|x86
+ ReleaseWindows|x86 = ReleaseWindows|x86
Debug|x86 = Debug|x86
- iOS|Any CPU = iOS|Any CPU
- iOS|Mixed Platforms = iOS|Mixed Platforms
- iOS|x86 = iOS|x86
- Linux|Any CPU = Linux|Any CPU
- Linux|Mixed Platforms = Linux|Mixed Platforms
- Linux|x86 = Linux|x86
- OSX|Any CPU = OSX|Any CPU
- OSX|Mixed Platforms = OSX|Mixed Platforms
- OSX|x86 = OSX|x86
- PSM|Any CPU = PSM|Any CPU
- PSM|Mixed Platforms = PSM|Mixed Platforms
- PSM|x86 = PSM|x86
- Release|Any CPU = Release|Any CPU
- Release|Mixed Platforms = Release|Mixed Platforms
Release|x86 = Release|x86
- Windows|Any CPU = Windows|Any CPU
- Windows|Mixed Platforms = Windows|Mixed Platforms
- Windows|x86 = Windows|x86
- Windows8|Any CPU = Windows8|Any CPU
- Windows8|Mixed Platforms = Windows8|Mixed Platforms
- Windows8|x86 = Windows8|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {008C0F83-E914-4966-9135-EA885059EDD8}.Android|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Android|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Android|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Android|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Android|x86.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Debug|Any CPU.ActiveCfg = Debug|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Debug|x86.ActiveCfg = Debug|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Debug|x86.Build.0 = Debug|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.iOS|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.iOS|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.iOS|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.iOS|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.iOS|x86.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Linux|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Linux|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Linux|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Linux|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Linux|x86.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.OSX|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.OSX|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.OSX|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.OSX|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.OSX|x86.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.PSM|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.PSM|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.PSM|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.PSM|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.PSM|x86.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Release|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Release|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Release|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Release|x86.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows|x86.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows8|Any CPU.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows8|Mixed Platforms.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows8|Mixed Platforms.Build.0 = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows8|x86.ActiveCfg = Release|x86
- {008C0F83-E914-4966-9135-EA885059EDD8}.Windows8|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Android|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Android|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Android|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Android|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Android|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Debug|Any CPU.ActiveCfg = Debug|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Debug|x86.ActiveCfg = Debug|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Debug|x86.Build.0 = Debug|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.iOS|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.iOS|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.iOS|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.iOS|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.iOS|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Linux|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Linux|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Linux|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Linux|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Linux|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.OSX|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.OSX|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.OSX|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.OSX|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.OSX|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.PSM|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.PSM|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.PSM|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.PSM|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.PSM|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Release|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Release|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Release|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Release|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows|x86.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows8|Any CPU.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows8|Mixed Platforms.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows8|Mixed Platforms.Build.0 = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows8|x86.ActiveCfg = Release|x86
- {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.Windows8|x86.Build.0 = Release|x86
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Android|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Android|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Android|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Android|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Android|x86.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Debug|x86.ActiveCfg = Debug|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.iOS|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.iOS|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.iOS|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.iOS|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.iOS|x86.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Linux|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Linux|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Linux|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Linux|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Linux|x86.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.OSX|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.OSX|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.OSX|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.OSX|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.OSX|x86.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.PSM|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.PSM|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.PSM|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.PSM|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.PSM|x86.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Release|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Release|x86.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows|x86.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows8|Any CPU.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows8|Any CPU.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows8|Mixed Platforms.ActiveCfg = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows8|Mixed Platforms.Build.0 = Release|Any CPU
- {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.Windows8|x86.ActiveCfg = Release|Any CPU
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Android|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Android|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Android|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Android|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Android|x86.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Debug|Any CPU.ActiveCfg = Debug|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Debug|x86.ActiveCfg = Debug|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Debug|x86.Build.0 = Debug|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.iOS|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.iOS|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.iOS|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.iOS|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.iOS|x86.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Linux|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Linux|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Linux|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Linux|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Linux|x86.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.OSX|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.OSX|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.OSX|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.OSX|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.OSX|x86.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.PSM|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.PSM|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.PSM|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.PSM|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.PSM|x86.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Release|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Release|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Release|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Release|x86.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows|x86.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows8|Any CPU.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows8|Mixed Platforms.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows8|Mixed Platforms.Build.0 = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows8|x86.ActiveCfg = Release|x86
- {251AAFE1-F24B-4837-9128-9D04FCBFD528}.Windows8|x86.Build.0 = Release|x86
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Android|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Android|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Android|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Android|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Android|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Android|x86.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Debug|x86.ActiveCfg = Debug|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Debug|x86.Build.0 = Debug|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.iOS|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.iOS|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.iOS|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.iOS|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.iOS|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.iOS|x86.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Linux|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Linux|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Linux|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Linux|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Linux|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Linux|x86.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.OSX|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.OSX|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.OSX|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.OSX|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.OSX|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.OSX|x86.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.PSM|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.PSM|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.PSM|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.PSM|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.PSM|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.PSM|x86.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Release|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Release|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Release|x86.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows|x86.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows8|Any CPU.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows8|Any CPU.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows8|Mixed Platforms.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows8|Mixed Platforms.Build.0 = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows8|x86.ActiveCfg = Release|Any CPU
- {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.Windows8|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Android|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Android|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Android|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Android|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Android|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Android|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Debug|x86.ActiveCfg = Debug|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Debug|x86.Build.0 = Debug|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.iOS|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.iOS|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.iOS|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.iOS|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.iOS|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.iOS|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Linux|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Linux|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Linux|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Linux|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Linux|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Linux|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.OSX|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.OSX|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.OSX|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.OSX|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.OSX|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.OSX|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.PSM|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.PSM|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.PSM|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.PSM|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.PSM|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.PSM|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Release|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Release|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Release|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows|x86.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows8|Any CPU.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows8|Any CPU.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows8|Mixed Platforms.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows8|Mixed Platforms.Build.0 = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows8|x86.ActiveCfg = Release|Any CPU
- {C293DB32-FA42-486D-B128-5A12522FAE4E}.Windows8|x86.Build.0 = Release|Any CPU
- {85232B20-074D-4723-B0C6-91495391E448}.Android|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Android|Any CPU.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Android|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Android|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Android|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Android|x86.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Debug|Any CPU.ActiveCfg = Debug|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Debug|x86.ActiveCfg = Debug|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Debug|x86.Build.0 = Debug|x86
- {85232B20-074D-4723-B0C6-91495391E448}.iOS|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.iOS|Any CPU.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.iOS|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.iOS|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.iOS|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.iOS|x86.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Linux|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Linux|Any CPU.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Linux|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Linux|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Linux|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Linux|x86.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.OSX|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.OSX|Any CPU.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.OSX|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.OSX|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.OSX|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.OSX|x86.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.PSM|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.PSM|Any CPU.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.PSM|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.PSM|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.PSM|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.PSM|x86.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Release|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Release|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Release|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Release|x86.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows|Any CPU.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows|x86.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows8|Any CPU.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows8|Any CPU.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows8|Mixed Platforms.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows8|Mixed Platforms.Build.0 = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows8|x86.ActiveCfg = Release|x86
- {85232B20-074D-4723-B0C6-91495391E448}.Windows8|x86.Build.0 = Release|x86
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Android|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Android|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Android|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Android|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Android|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Android|x86.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Debug|x86.Build.0 = Debug|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.iOS|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.iOS|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.iOS|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.iOS|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.iOS|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.iOS|x86.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Linux|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Linux|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Linux|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Linux|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Linux|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Linux|x86.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.OSX|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.OSX|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.OSX|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.OSX|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.OSX|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.OSX|x86.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.PSM|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.PSM|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.PSM|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.PSM|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.PSM|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.PSM|x86.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Release|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Release|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Release|x86.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows|x86.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows8|Any CPU.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows8|Any CPU.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows8|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows8|Mixed Platforms.Build.0 = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows8|x86.ActiveCfg = Release|Any CPU
- {A4610E4C-DD34-428B-BABB-779CA0B5993A}.Windows8|x86.Build.0 = Release|Any CPU
+ {008C0F83-E914-4966-9135-EA885059EDD8}.DebugLinux|x86.ActiveCfg = DebugLinux|x86
+ {008C0F83-E914-4966-9135-EA885059EDD8}.DebugLinux|x86.Build.0 = DebugLinux|x86
+ {008C0F83-E914-4966-9135-EA885059EDD8}.DebugWindows|x86.ActiveCfg = DebugWindows|x86
+ {008C0F83-E914-4966-9135-EA885059EDD8}.DebugWindows|x86.Build.0 = DebugWindows|x86
+ {008C0F83-E914-4966-9135-EA885059EDD8}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86
+ {008C0F83-E914-4966-9135-EA885059EDD8}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86
+ {008C0F83-E914-4966-9135-EA885059EDD8}.ReleaseWindows|x86.ActiveCfg = ReleaseWindows|x86
+ {008C0F83-E914-4966-9135-EA885059EDD8}.ReleaseWindows|x86.Build.0 = ReleaseWindows|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.DebugLinux|x86.ActiveCfg = DebugLinux|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.DebugLinux|x86.Build.0 = DebugLinux|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.DebugWindows|x86.ActiveCfg = DebugWindows|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.DebugWindows|x86.Build.0 = DebugWindows|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.ReleaseWindows|x86.ActiveCfg = ReleaseWindows|x86
+ {251AAFE1-F24B-4837-9128-9D04FCBFD528}.ReleaseWindows|x86.Build.0 = ReleaseWindows|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.DebugLinux|x86.ActiveCfg = DebugLinux|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.DebugLinux|x86.Build.0 = DebugLinux|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.DebugWindows|x86.ActiveCfg = DebugWindows|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.DebugWindows|x86.Build.0 = DebugWindows|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.ReleaseLinux|x86.Build.0 = ReleaseLinux|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.ReleaseWindows|x86.ActiveCfg = ReleaseWindows|x86
+ {85232B20-074D-4723-B0C6-91495391E448}.ReleaseWindows|x86.Build.0 = ReleaseWindows|x86
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.DebugWindows|x86.ActiveCfg = DebugWindows|Any CPU
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.DebugWindows|x86.Build.0 = DebugWindows|Any CPU
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.ReleaseWindows|x86.ActiveCfg = ReleaseWindows|Any CPU
+ {0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}.ReleaseWindows|x86.Build.0 = ReleaseWindows|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.DebugLinux|x86.ActiveCfg = Debug|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.DebugLinux|x86.Build.0 = Debug|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.DebugWindows|x86.ActiveCfg = Debug|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.DebugWindows|x86.Build.0 = Debug|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.ReleaseLinux|x86.Build.0 = Release|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.ReleaseWindows|x86.ActiveCfg = Release|Any CPU
+ {49BA1C69-6104-41AC-A5D8-B54FA9F696E8}.ReleaseWindows|x86.Build.0 = Release|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.DebugLinux|x86.ActiveCfg = Debug|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.DebugLinux|x86.Build.0 = Debug|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.DebugWindows|x86.ActiveCfg = Debug|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.DebugWindows|x86.Build.0 = Debug|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.ReleaseLinux|x86.Build.0 = Release|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.ReleaseWindows|x86.ActiveCfg = Release|Any CPU
+ {3B8F9EDB-6E5E-450C-ABC2-EC49075D0B50}.ReleaseWindows|x86.Build.0 = Release|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.DebugLinux|x86.ActiveCfg = Debug|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.DebugLinux|x86.Build.0 = Debug|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.DebugWindows|x86.ActiveCfg = Debug|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.DebugWindows|x86.Build.0 = Debug|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.ReleaseLinux|x86.Build.0 = Release|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.ReleaseWindows|x86.ActiveCfg = Release|Any CPU
+ {C293DB32-FA42-486D-B128-5A12522FAE4E}.ReleaseWindows|x86.Build.0 = Release|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.DebugLinux|x86.ActiveCfg = Debug|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.DebugLinux|x86.Build.0 = Debug|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.DebugWindows|x86.ActiveCfg = Debug|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.DebugWindows|x86.Build.0 = Debug|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.ReleaseLinux|x86.Build.0 = Release|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.ReleaseWindows|x86.ActiveCfg = Release|Any CPU
+ {A4610E4C-DD34-428B-BABB-779CA0B5993A}.ReleaseWindows|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -484,4 +133,7 @@ Global
{561357C2-DB28-4E01-B275-6BF545F70491} = {F35DF9BF-0BED-4FEF-A51C-DD83C531882F}
{A4610E4C-DD34-428B-BABB-779CA0B5993A} = {DE36F45F-F09E-4719-B953-00D148F7722A}
EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ version = 0.7.0.1
+ EndGlobalSection
EndGlobal
diff --git a/Libraries/Farseer Physics Engine 3.5/Farseer Physics MonoGame.csproj b/Libraries/Farseer Physics Engine 3.5/Farseer Physics MonoGame.csproj
index eea155a8f..736d70420 100644
--- a/Libraries/Farseer Physics Engine 3.5/Farseer Physics MonoGame.csproj
+++ b/Libraries/Farseer Physics Engine 3.5/Farseer Physics MonoGame.csproj
@@ -1,8 +1,8 @@
- Debug
- x86
+ ReleaseWindows
+ AnyCPU
8.0.30703
2.0
{0AAD36E3-51A5-4A07-AB60-5C8A66BD38B7}
@@ -22,28 +22,7 @@
v4.5
-
-
- x86
- true
- full
- true
- bin\Windows\Debug\
- TRACE;DEBUG;WINDOWS
- prompt
- 4
- false
-
-
- x86
- pdbonly
- true
- bin\WindowsGL\Release\
- TRACE;WINDOWS
- prompt
- 4
- false
- bin\WindowsGL\Release\FarseerPhysics MonoGame.xml
+ 0.7.0.1
@@ -52,6 +31,38 @@
+
+ true
+ pdbonly
+ true
+ ReleaseWindows\
+ TRACE;WINDOWS
+ x86
+
+
+ true
+ pdbonly
+ true
+ ReleaseLinux\
+ TRACE;LINUX
+ x86
+
+
+ true
+ full
+ DebugWindows\
+ TRACE;DEBUG;WINDOWS
+ x86
+
+
+ true
+ full
+ false
+ DebugLinux\
+ TRACE;DEBUG;LINUX
+ 4
+ x86
+
@@ -166,13 +177,20 @@
-
- False
- C:\Program Files (x86)\MonoGame\v3.0\Assemblies\Windows\MonoGame.Framework.dll
-
+
+
+ ..\NuGet\MonoGame.Framework.WindowsDX.3.6.0.1625\lib\net40\MonoGame.Framework.dll
+
+
+ ..\NuGet\SharpDX.4.0.1\lib\net45\SharpDX.dll
+
+
+ ..\NuGet\MonoGame.Framework.DesktopGL.3.6.0.1625\lib\net40\MonoGame.Framework.dll
+
+
-
\ No newline at end of file
+
diff --git a/Libraries/Farseer Physics Engine 3.5/Farseer Physics.csproj b/Libraries/Farseer Physics Engine 3.5/Farseer Physics.csproj
index 9717d5ea3..f855422cc 100644
--- a/Libraries/Farseer Physics Engine 3.5/Farseer Physics.csproj
+++ b/Libraries/Farseer Physics Engine 3.5/Farseer Physics.csproj
@@ -40,6 +40,7 @@
false
true
+ 0.7.0.1
true
@@ -67,7 +68,6 @@
- 3.5
diff --git a/Libraries/Hyper.ComponentModel/Hyper.ComponentModel.csproj b/Libraries/Hyper.ComponentModel/Hyper.ComponentModel.csproj
index b2c9b109b..cbb58e9b2 100644
--- a/Libraries/Hyper.ComponentModel/Hyper.ComponentModel.csproj
+++ b/Libraries/Hyper.ComponentModel/Hyper.ComponentModel.csproj
@@ -12,6 +12,7 @@
v4.5
512
+ 0.7.0.1
true
diff --git a/Libraries/Lidgren.Network/Lidgren.Network.csproj b/Libraries/Lidgren.Network/Lidgren.Network.csproj
index 80fec2436..5d9799eb1 100644
--- a/Libraries/Lidgren.Network/Lidgren.Network.csproj
+++ b/Libraries/Lidgren.Network/Lidgren.Network.csproj
@@ -28,6 +28,7 @@
false
true
+ 0.7.0.1
true
diff --git a/Libraries/SharpFont/Source/SharpFont/SharpFont.csproj b/Libraries/SharpFont/Source/SharpFont/SharpFont.csproj
index 7aef6745f..18e0f2803 100644
--- a/Libraries/SharpFont/Source/SharpFont/SharpFont.csproj
+++ b/Libraries/SharpFont/Source/SharpFont/SharpFont.csproj
@@ -12,6 +12,7 @@
SharpFont
v4.5
512
+ 0.7.0.1
true
diff --git a/Libraries/SharpFont/Source/SharpFontShared/SharpFontShared.shproj b/Libraries/SharpFont/Source/SharpFontShared/SharpFontShared.shproj
index 3aa2efe8c..b88373872 100644
--- a/Libraries/SharpFont/Source/SharpFontShared/SharpFontShared.shproj
+++ b/Libraries/SharpFont/Source/SharpFontShared/SharpFontShared.shproj
@@ -2,6 +2,7 @@
2e4773b7-961a-4328-9d77-9749f9071ca2
+ 0.7.0.1
diff --git a/NuGet.Config b/NuGet.Config
index 0a318d8c6..0fbdba0bf 100644
--- a/NuGet.Config
+++ b/NuGet.Config
@@ -7,6 +7,6 @@
-
+
diff --git a/README.md b/README.md
index 8ba19b46d..f4a97ce5d 100644
--- a/README.md
+++ b/README.md
@@ -13,5 +13,9 @@ Before downloading the source code, please read the [EULA](EULA.txt).
**Wiki:** http://barotrauma.gamepedia.com/Barotrauma_Wiki
## Prerequisities:
+### Windows
- [Visual Studio](https://www.visualstudio.com/vs/community/) with C# 6.0 support (VS 2015 or later recommended)
-- [MonoGame 3.6](http://www.monogame.net/downloads/)
+### Linux
+- [Mono 5.4](www.mono-project.com)
+- [MonoDevelop 6](http://www.monodevelop.com/)
+ - *Note: See http://community.monogame.net/t/installing-monogame-3-6-on-linux/8811 to get this version of MonoDevelop if your distro's package distribution suite is outdated.*