Optimization: FindHull spatial hashing, itemcomponent sounds in a dictionary, got rid of Item.Updated, rendering fixes, disposing shadow vertex buffers
This commit is contained in:
@@ -15,9 +15,7 @@ namespace Barotrauma
|
||||
|
||||
public const float WallWidth = 20000.0f;
|
||||
|
||||
public VertexPositionTexture[] WallVertices;
|
||||
|
||||
public VertexPositionColor[] BodyVertices;
|
||||
private VertexBuffer wallVertices, bodyVertices;
|
||||
|
||||
private Vector2 midPos;
|
||||
private int slot;
|
||||
@@ -26,6 +24,16 @@ namespace Barotrauma
|
||||
|
||||
private List<VoronoiCell> cells;
|
||||
|
||||
public VertexBuffer WallVertices
|
||||
{
|
||||
get { return wallVertices; }
|
||||
}
|
||||
|
||||
public VertexBuffer BodyVertices
|
||||
{
|
||||
get { return bodyVertices; }
|
||||
}
|
||||
|
||||
public Vector2 Offset
|
||||
{
|
||||
get { return offset; }
|
||||
@@ -116,6 +124,18 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public void SetWallVertices(VertexPositionTexture[] vertices)
|
||||
{
|
||||
wallVertices = new VertexBuffer(GameMain.CurrGraphicsDevice, VertexPositionTexture.VertexDeclaration, vertices.Length, BufferUsage.WriteOnly);
|
||||
wallVertices.SetData(vertices);
|
||||
}
|
||||
|
||||
public void SetBodyVertices(VertexPositionColor[] vertices)
|
||||
{
|
||||
bodyVertices = new VertexBuffer(GameMain.CurrGraphicsDevice, VertexPositionColor.VertexDeclaration, vertices.Length, BufferUsage.WriteOnly);
|
||||
bodyVertices.SetData(vertices);
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateWallShift(Vector2 pos, WrappingWall[,] walls)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user