more accurate submarine body generation, multiplayer fixes, saving takes HiddenSubPosition into account, fire coordinate fixes, editscreen fixes, checking item triggers in AIObjectiveGoto, netlobbyscreen sync fixes, re-enabled level start/end positions, water edit fixed

This commit is contained in:
Regalis
2015-12-17 18:26:40 +02:00
parent 859be53d28
commit af470eab2e
53 changed files with 1065 additions and 427 deletions

View File

@@ -25,7 +25,7 @@ namespace Barotrauma
private LevelRenderer renderer;
//how close the sub has to be to start/endposition to exit
const float ExitDistance = 6000.0f;
public const float ExitDistance = 6000.0f;
private string seed;
@@ -56,12 +56,6 @@ namespace Barotrauma
get { return startPosition; }
}
public bool AtStartPosition
{
get;
private set;
}
public Vector2 Size
{
get { return new Vector2(borders.Width, borders.Height); }
@@ -71,13 +65,7 @@ namespace Barotrauma
{
get { return endPosition; }
}
public bool AtEndPosition
{
get;
private set;
}
public List<Vector2> PositionsOfInterest
{
get { return positionsOfInterest; }
@@ -380,6 +368,8 @@ namespace Barotrauma
endPosition = temp;
}
renderer.PlaceSprites(100);
Debug.WriteLine("**********************************************************************************");
Debug.WriteLine("Generated a map with " + sites.Count + " sites in " + sw.ElapsedMilliseconds + " ms");
Debug.WriteLine("Seed: "+seed);
@@ -967,7 +957,7 @@ namespace Barotrauma
renderer.Draw(spriteBatch);
}
public void DrawBack(SpriteBatch spriteBatch, Camera cam, BackgroundSpriteManager backgroundSpriteManager = null)
public void DrawBack(SpriteBatch spriteBatch, Camera cam, BackgroundCreatureManager backgroundSpriteManager = null)
{
if (renderer == null) return;
renderer.DrawBackground(spriteBatch, cam, backgroundSpriteManager);

View File

@@ -16,6 +16,8 @@ namespace Barotrauma
private static Texture2D dustParticles;
private static Texture2D shaftTexture;
private static BackgroundSpriteManager backgroundSpriteManager;
Vector2 dustOffset;
private Level level;
@@ -43,16 +45,25 @@ namespace Barotrauma
basicEffect.Texture = TextureLoader.FromFile("Content/Map/iceWall.png");
}
if (backgroundSpriteManager==null)
{
backgroundSpriteManager = new BackgroundSpriteManager("Content/BackgroundSprites/BackgroundSpritePrefabs.xml");
}
this.level = level;
}
public void PlaceSprites(int amount)
{
backgroundSpriteManager.PlaceSprites(level, amount);
}
public void Update(float deltaTime)
{
dustOffset -= Vector2.UnitY * 10.0f * (float)deltaTime;
}
public void DrawBackground(SpriteBatch spriteBatch, Camera cam, BackgroundSpriteManager backgroundSpriteManager = null)
public void DrawBackground(SpriteBatch spriteBatch, Camera cam, BackgroundCreatureManager backgroundCreatureManager = null)
{
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearWrap);
@@ -87,7 +98,9 @@ namespace Barotrauma
SamplerState.LinearWrap, DepthStencilState.Default, null, null,
cam.Transform);
if (backgroundSpriteManager!=null) backgroundSpriteManager.Draw(spriteBatch);
backgroundSpriteManager.DrawSprites(spriteBatch);
if (backgroundCreatureManager!=null) backgroundCreatureManager.Draw(spriteBatch);
spriteBatch.End();
@@ -118,12 +131,10 @@ namespace Barotrauma
public void Draw(SpriteBatch spriteBatch)
{
Vector2 pos = new Vector2(0.0f, -level.StartPosition.Y);// level.EndPosition;
//pos.Y = -pos.Y - level.Position.Y;
if (GameMain.GameScreen.Cam.WorldView.Y < -pos.Y - 512) return;
pos.X = GameMain.GameScreen.Cam.WorldView.X -512.0f;
//pos.X += Position.X % 512;
int width = (int)(Math.Ceiling(GameMain.GameScreen.Cam.WorldView.Width / 512.0f + 2.0f) * 512.0f);