From d2c311fb708524894b28a07d4394656b6998563c Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 17 Mar 2026 14:51:35 -0400 Subject: New API Signed-off-by: Andrew Opalach --- Plugin.cs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Plugin.cs b/Plugin.cs index b382df7..c647785 100755 --- a/Plugin.cs +++ b/Plugin.cs @@ -47,6 +47,7 @@ namespace WorldTuningTool return dofDisabled; } + /* public PluginData Initialize() { PluginData data = new PluginData(); @@ -54,6 +55,7 @@ namespace WorldTuningTool data.ExportedFunctions.Add(("GetDofDisabled", GetDofDisabled)); return data; } + */ public void OnPreMain() { @@ -80,8 +82,8 @@ namespace WorldTuningTool Log.Error($"Failed to read: {path}."); return false; } - info->NewSourceLength = shaderData.Length; - info->NewSource = (byte *)Marshal.UnsafeAddrOfPinnedArrayElement(shaderData, 0); + info->Replacement.Length = shaderData.Length; + info->Replacement.Source = (byte *)Marshal.UnsafeAddrOfPinnedArrayElement(shaderData, 0); return true; } @@ -93,14 +95,14 @@ namespace WorldTuningTool if (!shadersLoadedOnce && hash == "2e4e18fd-6ea5eeae-2de3d65c-26ab36dd") { if (replaceShaderFromFile(info, $"{shaderPath}/volume_upsample.shdr")) { - info->NewSourceType = ShaderSourceType.BINARY; + info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("Volume upsample shader 1 replaced."); } } else if (!shadersLoadedOnce && hash == "e2c8c13e-45bc99b2-4c3d7699-3d66188e") { if (replaceShaderFromFile(info, $"{shaderPath}/volume_upsample2.shdr")) { - info->NewSourceType = ShaderSourceType.BINARY; + info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("Volume upsample shader 2 replaced."); } // This allows us to A/B using the volume rendering value 2 switch. @@ -109,35 +111,35 @@ namespace WorldTuningTool else if (hash == "8cf2a107-ecde214b-9939b350-7b2af1a7") { if (replaceShaderFromFile(info, $"{shaderPath}/cube_only.shdr")) { - info->NewSourceType = ShaderSourceType.BINARY; + info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("Cube Only shader replaced."); } } else if (hash == "b21dd223-98ab56ae-918264e6-eb6e8ee4") { - info->NewSourceType = ShaderSourceType.BINARY; if (replaceShaderFromFile(info, $"{shaderPath}/sslr.shdr")) { + info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("SSLR shader replaced."); } } else if (hash == "9ff245fb-4fd555e0-04d0ef15-84609fe1") { if (replaceShaderFromFile(info, $"{shaderPath}/fxaa_max_quality.hlsl")) { - info->NewSourceType = ShaderSourceType.HLSL; + info->Replacement.Type = ShaderSourceType.HLSL; Log.Info("FXAA shader replaced."); } } else if (hash == "2eed1f00-e24d1b19-9d521064-17b9a586") { if (replaceShaderFromFile(info, $"{shaderPath}/body_skin.shdr")) { - info->NewSourceType = ShaderSourceType.BINARY; + info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("Body skin shader replaced."); } } else if (hash == "8e5e3c09-ebe77ee4-ba1cb659-d25bc7bf") { if (replaceShaderFromFile(info, $"{shaderPath}/face.shdr")) { - info->NewSourceType = ShaderSourceType.BINARY; + info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("Face shader replaced."); } } @@ -145,7 +147,7 @@ namespace WorldTuningTool else if (hash == "d7e47ffe-82572c64-795c4698-341e5b91") { if (replaceShaderFromFile(info, $"{shaderPath}/sslr_mips.shdr")) { - info->NewSourceType = ShaderSourceType.BINARY; + info->Replacement.Type = ShaderSourceType.BINARY; Log.Info("SSLR mips shader replaced."); } } -- cgit v1.2.3-101-g0448