Atmos device performance improvements (#26493)

* Atmos device performance improvements

* AtmosDirection perf improvements

* Fix errors

* Add GasTileOverlayComponent arguments

* Make excite no longer invalidate a tile
This commit is contained in:
Leon Friedrich
2024-03-30 17:17:53 +13:00
committed by GitHub
parent aa96baeb5f
commit 888a3bda51
51 changed files with 373 additions and 324 deletions

View File

@@ -1,4 +1,5 @@
using Content.Server.Atmos.Components;
using Content.Shared.Atmos.Components;
namespace Content.Server.Atmos.Piping.Components;
@@ -46,18 +47,25 @@ public sealed partial class AtmosDeviceComponent : Component
/// Use this for atmos devices instead of <see cref="EntitySystem.Update"/>.
/// </summary>
[ByRefEvent]
public readonly struct AtmosDeviceUpdateEvent
public readonly struct AtmosDeviceUpdateEvent(float dt, Entity<GridAtmosphereComponent, GasTileOverlayComponent>? grid, Entity<MapAtmosphereComponent?>? map)
{
/// <summary>
/// Time elapsed since last update, in seconds. Multiply values used in the update handler
/// by this number to make them tickrate-invariant. Use this number instead of AtmosphereSystem.AtmosTime.
/// </summary>
public readonly float dt;
public readonly float dt = dt;
public AtmosDeviceUpdateEvent(float dt)
{
this.dt = dt;
}
/// <summary>
/// The grid that this device is currently on.
/// </summary>
public readonly Entity<GridAtmosphereComponent?, GasTileOverlayComponent?>? Grid = grid == null
? null
: (grid.Value, grid.Value, grid.Value);
/// <summary>
/// The map that the device & grid is on.
/// </summary>
public readonly Entity<MapAtmosphereComponent?>? Map = map;
}
/// <summary>