v1.7.7.0 (Winter Update 2024)

This commit is contained in:
Regalis11
2024-12-11 13:26:13 +02:00
parent 7d5b7a310a
commit f6349b2175
256 changed files with 4794 additions and 1653 deletions
@@ -1,10 +1,7 @@
using Barotrauma.Extensions;
using FarseerPhysics;
using FarseerPhysics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Barotrauma
{
@@ -26,22 +23,29 @@ namespace Barotrauma
Matrix.CreateTranslation(new Vector3(ConvertUnits.ToDisplayUnits(Body.Position), 0.0f));
}
public void SetWallVertices(VertexPositionTexture[] wallVertices, VertexPositionTexture[] wallEdgeVertices, Texture2D wallTexture, Texture2D edgeTexture, Color color)
public void SetWallVertices(
VertexPositionColorTexture[] wallVertices, VertexPositionColorTexture[] wallEdgeVertices,
Texture2D wallTexture, Texture2D edgeTexture)
{
if (VertexBuffer != null && !VertexBuffer.IsDisposed) { VertexBuffer.Dispose(); }
VertexBuffer = new LevelWallVertexBuffer(wallVertices, wallEdgeVertices, wallTexture, edgeTexture, color);
VertexBuffer = new LevelWallVertexBuffer(wallVertices, wallEdgeVertices, wallInnerVertices: null, wallTexture, edgeTexture);
}
public void GenerateVertices()
{
float zCoord = this is DestructibleLevelWall ? Rand.Range(0.9f, 1.0f) : 0.9f;
List<VertexPositionTexture> wallVertices = CaveGenerator.GenerateWallVertices(triangles, level.GenerationParams, zCoord);
var nonTexturedWallVerts =
CaveGenerator.GenerateWallVertices(triangles, color, zCoord: 0.9f).ToArray();
var wallVerts = CaveGenerator.ConvertToTextured(nonTexturedWallVerts, level.GenerationParams.WallTextureSize);
SetWallVertices(
wallVertices.ToArray(),
CaveGenerator.GenerateWallEdgeVertices(Cells, level, zCoord).ToArray(),
wallVertices: wallVerts,
wallEdgeVertices: CaveGenerator.GenerateWallEdgeVertices(Cells,
level.GenerationParams.WallEdgeExpandOutwardsAmount, level.GenerationParams.WallEdgeExpandInwardsAmount,
outerColor: color, innerColor: color,
level, zCoord)
.ToArray(),
level.GenerationParams.WallSprite.Texture,
level.GenerationParams.WallEdgeSprite.Texture,
color);
level.GenerationParams.WallEdgeSprite.Texture);
}
public bool IsVisible(Rectangle worldView)