From 60510b1d7d57d9520de2046ab043a28a0aca1d8e Mon Sep 17 00:00:00 2001 From: Boris Nikolaev Date: Sun, 15 Feb 2026 22:49:55 +0300 Subject: [PATCH] fix: error logging --- dq8chr2glb/Core/MDSFormat/Reader.cs | 2 +- dq8chr2glb/TM2Format/TM2Format.cs | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dq8chr2glb/Core/MDSFormat/Reader.cs b/dq8chr2glb/Core/MDSFormat/Reader.cs index b3361dc..276701c 100644 --- a/dq8chr2glb/Core/MDSFormat/Reader.cs +++ b/dq8chr2glb/Core/MDSFormat/Reader.cs @@ -116,7 +116,7 @@ public class Reader if (triangleGroupHeader.headerSize == 32 && triangleGroupHeader.toNext != 0) { // This might be weird. - Log.Line($"Skip 32-bit triangle group header on {triangleGroupOffset}"); + // Log.Line($"Skip 32-bit triangle group header on {triangleGroupOffset}"); continue; } diff --git a/dq8chr2glb/TM2Format/TM2Format.cs b/dq8chr2glb/TM2Format/TM2Format.cs index 13a53c1..caf4f9f 100644 --- a/dq8chr2glb/TM2Format/TM2Format.cs +++ b/dq8chr2glb/TM2Format/TM2Format.cs @@ -1,4 +1,6 @@ using System; +using dq8chr2glb.Container; +using dq8chr2glb.Converter; using dq8chr2glb.Logger; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; @@ -8,8 +10,12 @@ namespace dq8chr2glb.TM2Format; // Взято из https://github.com/Souzooka/TM2Unswizzler public static class TM2Format { - public static Texture GetImage(byte[] data, string name) + public static IncludedFile currentFile; + + public static Texture GetImage(IncludedFile file, string name) { + currentFile = file; + var data = file.data; var header = TM2Header.GetHeader(data); var image = GetImageBuffer(header, data); @@ -67,7 +73,7 @@ public static class TM2Format } catch (Exception e) { - Log.Error(e); + Context.current.errors.Add(new Error(currentFile.name, "Error then import texture", e)); palette = null; }