Decal system cleanup (#13493)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2023-01-16 13:46:22 +13:00
committed by GitHub
parent 3cfd814503
commit dbe99f9fa6
7 changed files with 141 additions and 283 deletions

View File

@@ -15,11 +15,20 @@ namespace Content.Shared.Decals
[DataField("chunkCollection", serverOnly: true)]
public DecalGridChunkCollection ChunkCollection = new(new ());
/// <summary>
/// Dictionary mapping decals to their corresponding grid chunks.
/// </summary>
public readonly Dictionary<uint, Vector2i> DecalIndex = new();
/// <summary>
/// Tick at which PVS was last toggled. Ensures that all players receive a full update when toggling PVS.
/// </summary>
public GameTick ForceTick { get; set; }
// client-side data. I CBF creating a separate client-side comp for this. The server can survive with some empty dictionaries.
public readonly Dictionary<uint, int> DecalZIndexIndex = new();
public readonly SortedDictionary<int, SortedDictionary<uint, Decal>> DecalRenderIndex = new();
[DataDefinition]
[Serializable, NetSerializable]
public sealed class DecalChunk
@@ -51,7 +60,7 @@ namespace Content.Shared.Decals
[DataRecord, Serializable, NetSerializable]
public record DecalGridChunkCollection(Dictionary<Vector2i, DecalChunk> ChunkCollection)
{
public uint NextUid;
public uint NextDecalId;
}
}