Ocean floor is visible on sonar

This commit is contained in:
Joonas Rikkonen
2017-08-16 19:09:51 +03:00
parent 52a52cdfc7
commit 8e71b4b828
3 changed files with 44 additions and 22 deletions

View File

@@ -270,7 +270,7 @@ namespace Barotrauma
wallCenterEffect.CurrentTechnique.Passes[0].Apply();
if (GameMain.GameScreen.Cam.WorldView.Y - GameMain.GameScreen.Cam.WorldView.Height < level.SeaFloorTopPos + 1024)
{
foreach (LevelWall wall in level.WrappingWalls)
foreach (LevelWall wall in level.ExtraWalls)
{
graphicsDevice.SetVertexBuffer(wall.BodyVertices);
graphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, (int)Math.Floor(wall.BodyVertices.VertexCount / 3.0f));
@@ -287,7 +287,7 @@ namespace Barotrauma
if (GameMain.GameScreen.Cam.WorldView.Y - GameMain.GameScreen.Cam.WorldView.Height < level.SeaFloorTopPos + 1024)
{
foreach (LevelWall wall in level.WrappingWalls)
foreach (LevelWall wall in level.ExtraWalls)
{
graphicsDevice.SetVertexBuffer(wall.WallVertices);
graphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, (int)Math.Floor(wall.WallVertices.VertexCount / 3.0f));

View File

@@ -3,16 +3,19 @@
<Biomes>
<Biome
name ="Cold Caverns"
description="asdgfdfg"/>
name = "Cold Caverns"
description= "asdgfdfg"/>
<Biome
name ="Volcanic Ridge"
description="asdgfdfg"/>
name = "Volcanic Ridge"
description= "asdgfdfg"/>
<Biome
name ="Great Sea"
description="asdgfdfg"/>
name = "Hydrothermal Wastes"
description= "asdgfdfg"/>
<Biome
name = "Great Sea"
description= "asdgfdfg"/>
</Biomes>
<Default
@@ -107,4 +110,25 @@
MountainHeightMin="10000"
MountainHeightMax="20000"
/>
<Wastes
biomes="Hydrothermal Wastes"
width="100000"
height="50000"
VoronoiSiteInterval="1500,1500"
VoronoiSiteVariance="700,700"
MainPathNodeIntervalRange="6000,10000"
BackgroundColor="25,23,10"
SmallTunnelCount="10"
SmallTunnelLengthRange="5000,50000"
RuinCount="3"
BottomHoleProbability="0.5"
BackgroundSpriteAmount="1000"
MountainCountMin="2"
MountainCountMax="3"
SeaFloorDepth="-100000.0"
SeaFloorVariance="2000"
MountainHeightMin="50000"
MountainHeightMax="60000"
/>
</LevelGenerationParameters>

View File

@@ -107,7 +107,7 @@ namespace Barotrauma
get { return ruins; }
}
public LevelWall[] WrappingWalls
public LevelWall[] ExtraWalls
{
get { return extraWalls; }
}
@@ -907,31 +907,29 @@ namespace Barotrauma
}
}
/*
if (wrappingWalls == null) return cells;
for (int side = 0; side < 2; side++)
if (extraWalls != null)
{
for (int n = 0; n < 2; n++)
Debug.Assert(extraWalls.Count() == 1, "Level.GetCells may need to be updated to support extra walls other than the ocean floor.");
if (pos.Y - searchDepth * GridCellSize < SeaFloorTopPos)
{
if (wrappingWalls[side, n] == null) continue;
if (Vector2.Distance(wrappingWalls[side, n].MidPos, pos) > WrappingWall.WallWidth) continue;
foreach (VoronoiCell cell in wrappingWalls[side, n].Cells)
foreach (VoronoiCell cell in extraWalls[0].Cells)
{
cells.Add(cell);
if (Math.Abs(cell.Center.X - pos.X) < searchDepth * GridCellSize)
{
cells.Add(cell);
}
}
}
}*/
}
return cells;
}
private void Unload()
{
#if CLIENT
if (renderer!=null)
if (renderer != null)
{
renderer.Dispose();
renderer = null;