fix: error logging

This commit is contained in:
Boris Nikolaev
2026-02-15 22:49:55 +03:00
parent ae99c946c5
commit 60510b1d7d
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -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;
}
+8 -2
View File
@@ -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;
}