mirror of
https://github.com/Caraxi/mare.client.git
synced 2026-02-16 12:37:42 +01:00
fix contextmenu etc
This commit is contained in:
parent
b9cf7eb6fa
commit
bfafcad8e8
16 changed files with 101 additions and 78 deletions
|
|
@ -186,17 +186,25 @@ public sealed class XivDataAnalyzer
|
|||
|
||||
var filePath = path.ResolvedFilepath;
|
||||
|
||||
_logger.LogDebug("Detected Model File {path}, calculating Tris", filePath);
|
||||
var file = _luminaGameData.GetFileFromDisk<MdlFile>(filePath);
|
||||
if (file.FileHeader.LodCount <= 0)
|
||||
return Task.FromResult((long)0);
|
||||
var meshIdx = file.Lods[0].MeshIndex;
|
||||
var meshCnt = file.Lods[0].MeshCount;
|
||||
var tris = file.Meshes.Skip(meshIdx).Take(meshCnt).Sum(p => p.IndexCount) / 3;
|
||||
try
|
||||
{
|
||||
_logger.LogDebug("Detected Model File {path}, calculating Tris", filePath);
|
||||
var file = _luminaGameData.GetFileFromDisk<MdlFile>(filePath);
|
||||
if (file.FileHeader.LodCount <= 0)
|
||||
return Task.FromResult((long)0);
|
||||
var meshIdx = file.Lods[0].MeshIndex;
|
||||
var meshCnt = file.Lods[0].MeshCount;
|
||||
var tris = file.Meshes.Skip(meshIdx).Take(meshCnt).Sum(p => p.IndexCount) / 3;
|
||||
|
||||
_logger.LogDebug("{filePath} => {tris} triangles", filePath, tris);
|
||||
_configService.Current.TriangleDictionary[hash] = tris;
|
||||
_configService.Save();
|
||||
return Task.FromResult(tris);
|
||||
_logger.LogDebug("{filePath} => {tris} triangles", filePath, tris);
|
||||
_configService.Current.TriangleDictionary[hash] = tris;
|
||||
_configService.Save();
|
||||
return Task.FromResult(tris);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogWarning(e, "Could not parse file {file}", filePath);
|
||||
return Task.FromResult((long)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue