Skip to content

Commit

Permalink
Update RT to v206.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wixoaGit committed Jan 17, 2024
1 parent 545e3af commit 8eca51e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions OpenDreamRuntime/Objects/DreamIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using OpenDreamShared.Dream;
using OpenDreamShared.Resources;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Formats.Png.Chunks;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Color = Robust.Shared.Maths.Color;
Expand Down Expand Up @@ -116,22 +116,21 @@ public IconResource GenerateDMI() {
}
}

Image<Rgba32> dmiImage = Image.LoadPixelData(pixels, span, frameHeight);
Image<Rgba32> dmiImage = Image.LoadPixelData<Rgba32>(pixels, span, frameHeight);
ParsedDMIDescription newDescription = new() {Width = frameWidth, Height = frameHeight, States = dmiStates};

PixelArrayPool.Return(pixels, clearArray: true);

using (MemoryStream dmiImageStream = new MemoryStream()) {
var pngTextData = new PngTextData("Description", newDescription.ExportAsText(), null, null);
var pngMetadata = dmiImage.Metadata.GetPngMetadata();
pngMetadata.TextData.Add(pngTextData);
using var dmiImageStream = new MemoryStream();
var pngTextData = new PngTextData("Description", newDescription.ExportAsText(), null, null);
var pngMetadata = dmiImage.Metadata.GetPngMetadata();
pngMetadata.TextData.Add(pngTextData);

dmiImage.SaveAsPng(dmiImageStream);
dmiImage.SaveAsPng(dmiImageStream);

IconResource newResource = _resourceManager.CreateIconResource(dmiImageStream.GetBuffer(), dmiImage, newDescription);
_cachedDMI = newResource;
return _cachedDMI;
}
IconResource newResource = _resourceManager.CreateIconResource(dmiImageStream.GetBuffer(), dmiImage, newDescription);
_cachedDMI = newResource;
return _cachedDMI;
}

public void ApplyOperation(IDreamIconOperation operation) {
Expand Down
2 changes: 1 addition & 1 deletion RobustToolbox
Submodule RobustToolbox updated 191 files

0 comments on commit 8eca51e

Please sign in to comment.