From a83f8f9368e7a94b82df4abd1bd90801c9472932 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Wed, 21 Oct 2026 16:13:13 -0400 Subject: Cleanup MemoryUtil usage, use header for overrides Signed-off-by: Andrew Opalach --- LUT.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'LUT.cs') diff --git a/LUT.cs b/LUT.cs index 1018745..b56657c 100644 --- a/LUT.cs +++ b/LUT.cs @@ -15,7 +15,7 @@ namespace WorldTuningTool { using static Plugin; - public static class WorldLUTs + internal static class WorldLUTs { private const string addPath = "nativePC/plugins/CSharp/LUT"; @@ -160,7 +160,7 @@ namespace WorldTuningTool #endif } - private static unsafe bool overwriteFromFile(nint texture, string path) + private static bool overwriteFromFile(nint texture, string path) { string ext = path.Split('.').Last().ToLower(); using (FileStream stream = File.Open(path, FileMode.Open)) @@ -169,7 +169,7 @@ namespace WorldTuningTool } } - private static unsafe bool overwriteFromMtFile(nint texture, string path) + private static bool overwriteFromMtFile(nint texture, string path) { MtFileStream? file = MtFileStream.FromPath(path, OpenMode.Read, false); bool success = false; @@ -183,7 +183,7 @@ namespace WorldTuningTool private static void reloadBlendLUT(nint lightingObject) { - MemoryUtil.GetRef(lightingObject + 0x1D4) = MemoryUtil.GetRef(lightingObject + 0x1D0) + 1.0f; + GetRef(lightingObject, 0x1D4) = GetRef(lightingObject, 0x1D0) + 1.0f; } private static string[] fileList = []; @@ -191,10 +191,10 @@ namespace WorldTuningTool private static bool[] selectionStarted = [ false, false ]; private static bool[] selectedInvalid = [ false, false ]; - public static void DrawUI(nint texture, nint lightingObject, int i, float width) + internal static unsafe void drawUI(nint texture, nint lightingObject, int i, float width) { ImGui.PushID(i); - string lutPath = Marshal.PtrToStringAnsi(texture + 0xC)!; + string lutPath = new(GetPtrInline(texture, 0xC)); ImGui.Text($"LUT {i}: {lutPath}"); #if TEXTURE_FEATURE if (ImGui.Button("Reset")) -- cgit v1.2.3-101-g0448