mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
139b6f796c | ||
|
|
2ee7c35fd3 | ||
|
|
56eae5ad08 | ||
|
|
0662cae224 | ||
|
|
0e2b00edd0 | ||
|
|
d48f7ecb5b |
@@ -55,7 +55,7 @@
|
||||
<PackageVersion Include="Serilog" Version="4.2.0" />
|
||||
<PackageVersion Include="Serilog.Sinks.Loki" Version="4.0.0-beta3" />
|
||||
<PackageVersion Include="SharpZstd.Interop" Version="1.5.2-beta2" />
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.6" />
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.7" />
|
||||
<PackageVersion Include="SpaceWizards.HttpListener" Version="0.1.1" />
|
||||
<PackageVersion Include="SpaceWizards.NFluidsynth" Version="0.1.1" />
|
||||
<PackageVersion Include="SpaceWizards.SharpFont" Version="1.0.2" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project>
|
||||
|
||||
<!-- This file automatically reset by Tools/version.py -->
|
||||
<!-- This file automatically reset by Tools/version.py -->
|
||||
|
||||
|
||||
@@ -54,6 +54,25 @@ END TEMPLATE-->
|
||||
*None yet*
|
||||
|
||||
|
||||
## 248.0.2
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Don't throw in overlay rendering if MapUid not found.
|
||||
|
||||
### Internal
|
||||
|
||||
* Reduce EntityManager.IsDefault allocations.
|
||||
|
||||
|
||||
## 248.0.1
|
||||
|
||||
### Bugfixes
|
||||
|
||||
* Bump ImageSharp version.
|
||||
* Fix instances of NaN gain for audio where a negative-infinity value is being used for volume.
|
||||
|
||||
|
||||
## 248.0.0
|
||||
|
||||
### Breaking changes
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Robust.Client.Graphics.Clyde
|
||||
DebugTools.Assert(space != OverlaySpace.ScreenSpaceBelowWorld && space != OverlaySpace.ScreenSpace);
|
||||
|
||||
var mapId = vp.Eye!.Position.MapId;
|
||||
var args = new OverlayDrawArgs(space, null, vp, _renderHandle, new UIBox2i((0, 0), vp.Size), _mapManager.GetMapEntityIdOrThrow(mapId), mapId, worldBox, worldBounds);
|
||||
var args = new OverlayDrawArgs(space, null, vp, _renderHandle, new UIBox2i((0, 0), vp.Size), _mapSystem.GetMapOrInvalid(mapId), mapId, worldBox, worldBounds);
|
||||
|
||||
if (!overlay.BeforeDraw(args))
|
||||
return;
|
||||
@@ -178,7 +178,7 @@ namespace Robust.Client.Graphics.Clyde
|
||||
var worldAABB = worldBounds.CalcBoundingBox();
|
||||
var mapId = vp.Eye!.Position.MapId;
|
||||
|
||||
var args = new OverlayDrawArgs(space, vpControl, vp, handle, bounds, _mapManager.GetMapEntityIdOrThrow(mapId), mapId, worldAABB, worldBounds);
|
||||
var args = new OverlayDrawArgs(space, vpControl, vp, handle, bounds, _mapSystem.GetMapOrInvalid(mapId), mapId, worldAABB, worldBounds);
|
||||
|
||||
foreach (var overlay in list)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,9 @@ using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Serialization.Manager;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Robust.Shared.Audio
|
||||
{
|
||||
@@ -29,11 +32,25 @@ namespace Robust.Shared.Audio
|
||||
[DataDefinition]
|
||||
public partial struct AudioParams
|
||||
{
|
||||
private float _volume = Default.Volume;
|
||||
|
||||
/// <summary>
|
||||
/// Base volume to play the audio at, in dB.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Volume { get; set; } = Default.Volume;
|
||||
public float Volume
|
||||
{
|
||||
get => _volume;
|
||||
set
|
||||
{
|
||||
if (float.IsNaN(value))
|
||||
{
|
||||
value = float.NegativeInfinity;
|
||||
}
|
||||
|
||||
_volume = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scale for the audio pitch.
|
||||
|
||||
@@ -412,6 +412,13 @@ public abstract partial class SharedAudioSystem : EntitySystem
|
||||
if (component.Params.Volume.Equals(value))
|
||||
return;
|
||||
|
||||
// Not a log error for now because if something has a negative infinity volume (i.e. 0 gain) then subtracting from it can
|
||||
// easily cause this and making callers deal with it everywhere is quite annoying.
|
||||
if (float.IsNaN(value))
|
||||
{
|
||||
value = float.NegativeInfinity;
|
||||
}
|
||||
|
||||
component.Params.Volume = value;
|
||||
component.Volume = value;
|
||||
DirtyField(entity.Value, component, nameof(AudioComponent.Params));
|
||||
|
||||
@@ -189,10 +189,12 @@ namespace Robust.Shared.GameObjects
|
||||
return false;
|
||||
|
||||
var compType = component.GetType();
|
||||
var compName = _componentFactory.GetComponentName(compType);
|
||||
if (compName == _xformName || compName == _metaReg.Name)
|
||||
|
||||
if (compType == typeof(TransformComponent) || compType == typeof(MetaDataComponent))
|
||||
continue;
|
||||
|
||||
var compName = _componentFactory.GetComponentName(compType);
|
||||
|
||||
// If the component isn't on the prototype then it's custom.
|
||||
if (!protoData.TryGetValue(compName, out var protoMapping))
|
||||
return false;
|
||||
@@ -208,9 +210,7 @@ namespace Robust.Shared.GameObjects
|
||||
return false;
|
||||
}
|
||||
|
||||
var diff = compMapping.Except(protoMapping);
|
||||
|
||||
if (diff != null && diff.Children.Count != 0)
|
||||
if (compMapping.AnyExcept(protoMapping))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
@@ -352,6 +353,29 @@ namespace Robust.Shared.Serialization.Markdown.Mapping
|
||||
return mappingNode._children.Count == 0 ? null : mappingNode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if there are any nodes on this node that aren't in the other node.
|
||||
/// </summary>
|
||||
[Pure]
|
||||
public bool AnyExcept(MappingDataNode node)
|
||||
{
|
||||
foreach (var (key, val) in _list)
|
||||
{
|
||||
var other = node._list.FirstOrNull(p => p.Key.Equals(key));
|
||||
|
||||
if (other == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// We only keep the entry if the values are not equal
|
||||
if (!val.Equals(other.Value.Value))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj is not MappingDataNode other)
|
||||
|
||||
Reference in New Issue
Block a user