mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 21:07:21 +01:00
add format for textures in analysis
This commit is contained in:
parent
71c510b0f4
commit
9023aa8006
2 changed files with 37 additions and 1 deletions
|
|
@ -5,6 +5,8 @@ using MareSynchronos.Services.Mediator;
|
|||
using MareSynchronos.UI;
|
||||
using MareSynchronos.Utils;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Lumina.Data;
|
||||
using Lumina.Data.Files;
|
||||
|
||||
namespace MareSynchronos.Services;
|
||||
|
||||
|
|
@ -176,5 +178,31 @@ public sealed class CharacterAnalyzer : MediatorSubscriberBase, IDisposable
|
|||
}
|
||||
public long OriginalSize { get; private set; } = OriginalSize;
|
||||
public long CompressedSize { get; private set; } = CompressedSize;
|
||||
|
||||
private string? _format;
|
||||
|
||||
public string? Format
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_format != null) return _format;
|
||||
|
||||
switch (FileType)
|
||||
{
|
||||
case "tex":
|
||||
{
|
||||
using var stream = new FileStream(FilePaths[0], FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
using var reader = new BinaryReader(stream);
|
||||
reader.BaseStream.Position = 4;
|
||||
var format = (TexFile.TextureFormat) reader.ReadInt32();
|
||||
_format = format.ToString();
|
||||
return _format;
|
||||
}
|
||||
default:
|
||||
_format = string.Empty;
|
||||
return _format;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue