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
@@ -270,7 +270,7 @@ namespace Barotrauma
wallCenterEffect.CurrentTechnique.Passes[0].Apply(); wallCenterEffect.CurrentTechnique.Passes[0].Apply();
if (GameMain.GameScreen.Cam.WorldView.Y - GameMain.GameScreen.Cam.WorldView.Height < level.SeaFloorTopPos + 1024) 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.SetVertexBuffer(wall.BodyVertices);
graphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, (int)Math.Floor(wall.BodyVertices.VertexCount / 3.0f)); 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) 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.SetVertexBuffer(wall.WallVertices);
graphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, (int)Math.Floor(wall.WallVertices.VertexCount / 3.0f)); graphicsDevice.DrawPrimitives(PrimitiveType.TriangleList, 0, (int)Math.Floor(wall.WallVertices.VertexCount / 3.0f));
@@ -3,16 +3,19 @@
<Biomes> <Biomes>
<Biome <Biome
name ="Cold Caverns" name = "Cold Caverns"
description="asdgfdfg"/> description= "asdgfdfg"/>
<Biome <Biome
name ="Volcanic Ridge" name = "Volcanic Ridge"
description="asdgfdfg"/> description= "asdgfdfg"/>
<Biome <Biome
name ="Great Sea" name = "Hydrothermal Wastes"
description="asdgfdfg"/> description= "asdgfdfg"/>
<Biome
name = "Great Sea"
description= "asdgfdfg"/>
</Biomes> </Biomes>
<Default <Default
@@ -107,4 +110,25 @@
MountainHeightMin="10000" MountainHeightMin="10000"
MountainHeightMax="20000" 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> </LevelGenerationParameters>
@@ -107,7 +107,7 @@ namespace Barotrauma
get { return ruins; } get { return ruins; }
} }
public LevelWall[] WrappingWalls public LevelWall[] ExtraWalls
{ {
get { return extraWalls; } get { return extraWalls; }
} }
@@ -907,23 +907,21 @@ namespace Barotrauma
} }
} }
/* if (extraWalls != null)
if (wrappingWalls == null) return cells;
for (int side = 0; side < 2; side++)
{ {
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; foreach (VoronoiCell cell in extraWalls[0].Cells)
if (Vector2.Distance(wrappingWalls[side, n].MidPos, pos) > WrappingWall.WallWidth) continue;
foreach (VoronoiCell cell in wrappingWalls[side, n].Cells)
{ {
cells.Add(cell); if (Math.Abs(cell.Center.X - pos.X) < searchDepth * GridCellSize)
{
cells.Add(cell);
}
} }
} }
}*/ }
return cells; return cells;
} }
@@ -931,7 +929,7 @@ namespace Barotrauma
private void Unload() private void Unload()
{ {
#if CLIENT #if CLIENT
if (renderer!=null) if (renderer != null)
{ {
renderer.Dispose(); renderer.Dispose();
renderer = null; renderer = null;