diff options
| author | 2026-10-21 16:13:13 -0400 | |
|---|---|---|
| committer | 2026-10-21 16:13:13 -0400 | |
| commit | a83f8f9368e7a94b82df4abd1bd90801c9472932 (patch) | |
| tree | 0573b6d8b17c11f03e90da9ce02818c726066861 /LUT.cs | |
| parent | 6621a5333d0d6b68f1152abe69f3d64269b1ab79 (diff) | |
| download | WorldTuningTool-a83f8f9368e7a94b82df4abd1bd90801c9472932.tar.gz WorldTuningTool-a83f8f9368e7a94b82df4abd1bd90801c9472932.tar.bz2 WorldTuningTool-a83f8f9368e7a94b82df4abd1bd90801c9472932.zip | |
Cleanup MemoryUtil usage, use header for overrides
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'LUT.cs')
| -rw-r--r-- | LUT.cs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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<float>(lightingObject + 0x1D4) = MemoryUtil.GetRef<float>(lightingObject + 0x1D0) + 1.0f; + GetRef<float>(lightingObject, 0x1D4) = GetRef<float>(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<sbyte>(texture, 0xC)); ImGui.Text($"LUT {i}: {lutPath}"); #if TEXTURE_FEATURE if (ImGui.Button("Reset")) |