Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Feb 20, 2025
1 parent e5c568b commit 45e7f16
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 58 deletions.
4 changes: 0 additions & 4 deletions OpenDreamClient/Rendering/ClientDreamParticlesSystem.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
using JetBrains.Annotations;
using OpenDreamShared.Rendering;
using Pidgin;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.GameStates;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using static OpenDreamShared.Rendering.DreamParticlesComponent;
using Vector3 = Robust.Shared.Maths.Vector3;

namespace OpenDreamClient.Rendering;
Expand Down
2 changes: 0 additions & 2 deletions OpenDreamRuntime/Objects/Types/DreamList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -858,8 +858,6 @@ public override int GetLength() {
}
}



// atom.filters list
// Operates on an object's appearance
public sealed class DreamFilterList : DreamList {
Expand Down
2 changes: 2 additions & 0 deletions OpenDreamRuntime/Objects/Types/DreamObjectAtom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class DreamObjectAtom : DreamObject {
public readonly DreamVisContentsList VisContents;
public readonly DreamFilterList Filters;
public DreamList? VisLocs; // TODO: Implement

public DreamObjectAtom(DreamObjectDefinition objectDefinition) : base(objectDefinition) {
Overlays = new(ObjectTree.List.ObjectDefinition, this, AppearanceSystem, false);
Underlays = new(ObjectTree.List.ObjectDefinition, this, AppearanceSystem, true);
Expand Down Expand Up @@ -72,6 +73,7 @@ protected override bool TryGetVar(string varName, out DreamValue value) {
case "vis_contents":
value = new(VisContents);
return true;

default:
if (AtomManager.IsValidAppearanceVar(varName)) {
var appearance = AtomManager.MustGetAppearance(this);
Expand Down
3 changes: 0 additions & 3 deletions OpenDreamRuntime/Objects/Types/DreamObjectParticles.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using OpenDreamRuntime.Procs;
using OpenDreamRuntime.Rendering;
using OpenDreamRuntime.Resources;
using OpenDreamShared.Dream;
using OpenDreamShared.Rendering;
using Robust.Shared.Map;
using Vector3 = Robust.Shared.Maths.Vector3;

namespace OpenDreamRuntime.Objects.Types;
Expand Down
35 changes: 1 addition & 34 deletions OpenDreamShared/Dream/ImmutableAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public sealed class ImmutableAppearance : IEquatable<ImmutableAppearance> {
[ViewVariables] public readonly ImmutableAppearance[] Overlays;
[ViewVariables] public readonly ImmutableAppearance[] Underlays;
[ViewVariables] public readonly Robust.Shared.GameObjects.NetEntity[] VisContents;
[ViewVariables] public readonly Robust.Shared.GameObjects.NetEntity[] Particles;
[ViewVariables] public readonly DreamFilter[] Filters;
[ViewVariables] public readonly int[] Verbs;
[ViewVariables] public readonly ColorMatrix ColorMatrix = ColorMatrix.Identity;
Expand Down Expand Up @@ -107,7 +106,6 @@ public ImmutableAppearance(MutableAppearance appearance, SharedAppearanceSystem?
Underlays = appearance.Underlays.ToArray();

VisContents = appearance.VisContents.ToArray();
Particles = appearance.Particles.ToArray();
Filters = appearance.Filters.ToArray();
Verbs = appearance.Verbs.ToArray();
Override = appearance.Override;
Expand Down Expand Up @@ -170,7 +168,6 @@ public bool Equals(ImmutableAppearance? immutableAppearance) {
if (immutableAppearance.Overlays.Length != Overlays.Length) return false;
if (immutableAppearance.Underlays.Length != Underlays.Length) return false;
if (immutableAppearance.VisContents.Length != VisContents.Length) return false;
if (immutableAppearance.Particles.Length != Particles.Length) return false;
if (immutableAppearance.Filters.Length != Filters.Length) return false;
if (immutableAppearance.Verbs.Length != Verbs.Length) return false;
if (immutableAppearance.Override != Override) return false;
Expand Down Expand Up @@ -198,10 +195,6 @@ public bool Equals(ImmutableAppearance? immutableAppearance) {
if (immutableAppearance.Verbs[i] != Verbs[i]) return false;
}

for (int i = 0; i < Particles.Length; i++) {
if (immutableAppearance.Particles[i] != Particles[i]) return false;
}

for (int i = 0; i < 6; i++) {
if (!immutableAppearance.Transform[i].Equals(Transform[i])) return false;
}
Expand Down Expand Up @@ -265,10 +258,6 @@ public override int GetHashCode() {
hashCode.Add(visContent);
}

foreach (int particlesObject in Particles) {
hashCode.Add(particlesObject);
}

foreach (DreamFilter filter in Filters) {
hashCode.Add(filter);
}
Expand All @@ -290,8 +279,7 @@ public ImmutableAppearance(NetIncomingMessage buffer, IRobustSerializer serializ
Underlays = [];
VisContents = [];
Filters = [];
Verbs = [];
Particles = [];
Verbs =[];

var property = (IconAppearanceProperty)buffer.ReadByte();
while (property != IconAppearanceProperty.End) {
Expand Down Expand Up @@ -404,16 +392,6 @@ public ImmutableAppearance(NetIncomingMessage buffer, IRobustSerializer serializ

break;
}
case IconAppearanceProperty.Particles: {
var particlesCount = buffer.ReadVariableInt32();

Particles = new Robust.Shared.GameObjects.NetEntity[particlesCount];
for (int particlesI = 0; particlesI < particlesCount; particlesI++) {
Particles[particlesI] = buffer.ReadNetEntity();
}

break;
}
case IconAppearanceProperty.Filters: {
var filtersCount = buffer.ReadInt32();

Expand Down Expand Up @@ -507,13 +485,11 @@ public MutableAppearance ToMutable() {
result.VisContents.EnsureCapacity(VisContents.Length);
result.Filters.EnsureCapacity(Filters.Length);
result.Verbs.EnsureCapacity(Verbs.Length);
result.Particles.EnsureCapacity(Particles.Length);
result.Overlays.AddRange(Overlays);
result.Underlays.AddRange(Underlays);
result.VisContents.AddRange(VisContents);
result.Filters.AddRange(Filters);
result.Verbs.AddRange(Verbs);
result.Particles.AddRange(Particles);
Array.Copy(Transform, result.Transform, 6);

return result;
Expand Down Expand Up @@ -663,15 +639,6 @@ public void WriteToBuffer(NetOutgoingMessage buffer, IRobustSerializer serialize
}
}

if (Particles.Length != 0) {
buffer.Write((byte)IconAppearanceProperty.Particles);

buffer.WriteVariableInt32(Particles.Length);
foreach (var item in Particles) {
buffer.Write(item);
}
}

if (Filters.Length != 0) {
buffer.Write((byte)IconAppearanceProperty.Filters);

Expand Down
14 changes: 0 additions & 14 deletions OpenDreamShared/Dream/MutableAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public sealed class MutableAppearance : IEquatable<MutableAppearance>, IDisposab
[ViewVariables] public List<ImmutableAppearance> Overlays;
[ViewVariables] public List<ImmutableAppearance> Underlays;
[ViewVariables] public List<Robust.Shared.GameObjects.NetEntity> VisContents;
[ViewVariables] public List<Robust.Shared.GameObjects.NetEntity> Particles;
[ViewVariables] public List<DreamFilter> Filters;
[ViewVariables] public List<int> Verbs;
[ViewVariables] public Vector2i MaptextSize = new(32,32);
Expand Down Expand Up @@ -85,7 +84,6 @@ private MutableAppearance() {
VisContents = [];
Filters = [];
Verbs = [];
Particles = [];
}

public void Dispose() {
Expand Down Expand Up @@ -139,13 +137,11 @@ public void CopyFrom(MutableAppearance appearance) {
VisContents.Clear();
Filters.Clear();
Verbs.Clear();
Particles.Clear();
Overlays.AddRange(appearance.Overlays);
Underlays.AddRange(appearance.Underlays);
VisContents.AddRange(appearance.VisContents);
Filters.AddRange(appearance.Filters);
Verbs.AddRange(appearance.Verbs);
Particles.AddRange(appearance.Particles);
Array.Copy(appearance.Transform, Transform, 6);
}

Expand Down Expand Up @@ -180,7 +176,6 @@ public bool Equals(MutableAppearance? appearance) {
if (appearance.VisContents.Count != VisContents.Count) return false;
if (appearance.Filters.Count != Filters.Count) return false;
if (appearance.Verbs.Count != Verbs.Count) return false;
if (appearance.Particles.Count != Particles.Count) return false;
if (appearance.Override != Override) return false;
if (appearance.Maptext != Maptext) return false;
if (appearance.MaptextSize != MaptextSize) return false;
Expand All @@ -206,10 +201,6 @@ public bool Equals(MutableAppearance? appearance) {
if (appearance.Verbs[i] != Verbs[i]) return false;
}

for (int i = 0; i < Particles.Count; i++) {
if (appearance.Particles[i] != Particles[i]) return false;
}

for (int i = 0; i < 6; i++) {
if (!appearance.Transform[i].Equals(Transform[i])) return false;
}
Expand Down Expand Up @@ -291,10 +282,6 @@ public override int GetHashCode() {
hashCode.Add(visContent);
}

foreach (int particlesObject in Particles) {
hashCode.Add(particlesObject);
}

foreach (DreamFilter filter in Filters) {
hashCode.Add(filter);
}
Expand Down Expand Up @@ -417,7 +404,6 @@ public enum IconAppearanceProperty : byte {
Overlays,
Underlays,
VisContents,
Particles,
Filters,
Verbs,
Transform,
Expand Down

0 comments on commit 45e7f16

Please sign in to comment.