mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 03:49:19 +01:00
update UldWrapper
This commit is contained in:
parent
e12563d20f
commit
aa35052a15
1 changed files with 6 additions and 4 deletions
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
|
||||
using Dalamud.Data;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility;
|
||||
using Lumina.Data.Files;
|
||||
using Lumina.Data.Parsing.Uld;
|
||||
|
|
@ -14,16 +15,17 @@ namespace Dalamud.Interface;
|
|||
public class UldWrapper : IDisposable
|
||||
{
|
||||
private readonly DataManager data;
|
||||
private readonly UiBuilder uiBuilder;
|
||||
private readonly TextureManager textureManager;
|
||||
private readonly Dictionary<string, (uint Id, int Width, int Height, bool HD, byte[] RgbaData)> textures = new();
|
||||
|
||||
/// <summary> Initializes a new instance of the <see cref="UldWrapper"/> class, wrapping an ULD file. </summary>
|
||||
/// <param name="uiBuilder">The UiBuilder used to load textures.</param>
|
||||
/// <param name="uldPath">The requested ULD file.</param>
|
||||
internal UldWrapper(UiBuilder uiBuilder, string uldPath)
|
||||
internal UldWrapper(UiBuilder? uiBuilder, string uldPath)
|
||||
{
|
||||
this.uiBuilder = uiBuilder;
|
||||
_ = uiBuilder;
|
||||
this.data = Service<DataManager>.Get();
|
||||
this.textureManager = Service<TextureManager>.Get();
|
||||
this.Uld = this.data.GetFile<UldFile>(uldPath);
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +125,7 @@ public class UldWrapper : IDisposable
|
|||
inputSlice.CopyTo(outputSlice);
|
||||
}
|
||||
|
||||
return this.uiBuilder.LoadImageRaw(imageData, part.W, part.H, 4);
|
||||
return this.textureManager.GetFromRaw(RawImageSpecification.Rgba32(part.W, part.H), imageData);
|
||||
}
|
||||
|
||||
private (uint Id, int Width, int Height, bool HD, byte[] RgbaData)? GetTexture(string texturePath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue