summaryrefslogtreecommitdiff
path: root/LUT.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LUT.cs')
-rw-r--r--LUT.cs12
1 files changed, 6 insertions, 6 deletions
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<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"))