mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
feat: GFM timings
This commit is contained in:
parent
c72581d3bb
commit
d6af533811
1 changed files with 25 additions and 6 deletions
|
|
@ -7,7 +7,7 @@ using System.Text;
|
||||||
|
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
using Dalamud.Interface.Internal;
|
using Dalamud.Interface.Internal;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility.Timing;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Lumina.Data.Files;
|
using Lumina.Data.Files;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
|
@ -49,12 +49,31 @@ namespace Dalamud.Interface.GameFonts
|
||||||
{
|
{
|
||||||
var dataManager = Service<DataManager>.Get();
|
var dataManager = Service<DataManager>.Get();
|
||||||
|
|
||||||
this.fdts = FontNames.Select(fontName =>
|
using (Timings.Start("Load FDTs"))
|
||||||
{
|
{
|
||||||
var file = fontName == null ? null : dataManager.GetFile($"common/font/{fontName}.fdt");
|
this.fdts = FontNames.Select(fontName =>
|
||||||
return file == null ? null : new FdtReader(file!.Data);
|
{
|
||||||
}).ToArray();
|
var fileName = $"common/font/{fontName}.fdt";
|
||||||
this.texturePixels = Enumerable.Range(1, 1 + this.fdts.Where(x => x != null).Select(x => x.Glyphs.Select(x => x.TextureFileIndex).Max()).Max()).Select(x => dataManager.GameData.GetFile<TexFile>($"common/font/font{x}.tex").ImageData).ToList();
|
using (Timings.Start($"Loading FDT: {fileName}"))
|
||||||
|
{
|
||||||
|
var file = fontName == null ? null : dataManager.GetFile(fileName);
|
||||||
|
return file == null ? null : new FdtReader(file!.Data);
|
||||||
|
}
|
||||||
|
}).ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
using (Timings.Start("Getting texture data"))
|
||||||
|
{
|
||||||
|
this.texturePixels = Enumerable.Range(1, 1 + this.fdts.Where(x => x != null).Select(x => x.Glyphs.Select(x => x.TextureFileIndex).Max()).Max()).Select(
|
||||||
|
x =>
|
||||||
|
{
|
||||||
|
var fileName = $"common/font/font{x}.tex";
|
||||||
|
using (Timings.Start($"Get tex: {fileName}"))
|
||||||
|
{
|
||||||
|
return dataManager.GameData.GetFile<TexFile>(fileName)!.ImageData;
|
||||||
|
}
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
this.interfaceManager = Service<InterfaceManager>.Get();
|
this.interfaceManager = Service<InterfaceManager>.Get();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue