Added randomly generated ocean floors. Atm the bottom is too deep to reach in most levels and there's not much to explore down there, but the plan is to have some levels where the bottom or some of the bottom formations are reachable (because we need hydrothermal vents!).
Ice walls also use vertex colors now, could be used to add some cosmetic variety to the levels.
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
partial class LevelWall : IDisposable
|
||||
{
|
||||
private VertexBuffer wallVertices, bodyVertices;
|
||||
|
||||
public VertexBuffer WallVertices
|
||||
{
|
||||
get { return wallVertices; }
|
||||
}
|
||||
|
||||
public VertexBuffer BodyVertices
|
||||
{
|
||||
get { return bodyVertices; }
|
||||
}
|
||||
|
||||
public void SetWallVertices(VertexPositionTexture[] vertices, Color color)
|
||||
{
|
||||
wallVertices = new VertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionColorTexture.VertexDeclaration, vertices.Length, BufferUsage.WriteOnly);
|
||||
wallVertices.SetData(LevelRenderer.GetColoredVertices(vertices, color));
|
||||
}
|
||||
|
||||
public void SetBodyVertices(VertexPositionTexture[] vertices, Color color)
|
||||
{
|
||||
bodyVertices = new VertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionColorTexture.VertexDeclaration, vertices.Length, BufferUsage.WriteOnly);
|
||||
bodyVertices.SetData(LevelRenderer.GetColoredVertices(vertices, color));
|
||||
}
|
||||
|
||||
public void SetWallVertices(VertexPositionColorTexture[] vertices)
|
||||
{
|
||||
if (wallVertices != null && !wallVertices.IsDisposed) wallVertices.Dispose();
|
||||
wallVertices = new VertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionColorTexture.VertexDeclaration, vertices.Length, BufferUsage.WriteOnly);
|
||||
wallVertices.SetData(vertices);
|
||||
}
|
||||
|
||||
public void SetBodyVertices(VertexPositionColorTexture[] vertices)
|
||||
{
|
||||
if (bodyVertices != null && !bodyVertices.IsDisposed) bodyVertices.Dispose();
|
||||
bodyVertices = new VertexBuffer(GameMain.Instance.GraphicsDevice, VertexPositionColorTexture.VertexDeclaration, vertices.Length, BufferUsage.WriteOnly);
|
||||
bodyVertices.SetData(vertices);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user