summaryrefslogtreecommitdiff
path: root/Plugin.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Plugin.cs')
-rw-r--r--Plugin.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/Plugin.cs b/Plugin.cs
index 7ae5c2e..a2d0f19 100644
--- a/Plugin.cs
+++ b/Plugin.cs
@@ -613,7 +613,6 @@ namespace WorldTuningTool
}
// Start of Parameter Definitions.
-
private delegate void OnAreaChange(nint sMhArea);
private Hook<OnAreaChange>? onAreaChange;
@@ -931,10 +930,11 @@ namespace WorldTuningTool
private Hook<DestroyBloomObject>? destroyBloomObject;
private nint bloomObject = 0x0;
private static Parameter[] bloomParameters = {
- // Disabling 'Draw' is a bad way to disable bloom. It breaks the filter on initial load which
- // can be seen when returning to title or opening a guild card for the first time. Setting 'Bloom Renormalize'
- // to 0.0 or 'Bloom Reduction Resolution' to -1 can both effectively disable bloom without that issue.
- //newFlag<byte>("Bloom Enabled", 0x14, ParameterType.FLAG, (1 << 1)), // Draw
+ // Disabling "Draw" is a bad way to disable bloom as it breaks the filter on initialization.
+ // It can be seen when returning to title or opening a guild card for the first time.
+ // Setting "Bloom Renormalize" to 0.0 or "Bloom Reduction Resolution" to -1 can both
+ // effectively disable bloom without that issue.
+ //M<byte>("Bloom Enabled", 0x14, ParameterType.FLAG, (1 << 1)), // Draw
P<float>("Bloom Threshold", 0x204, ParameterType.FLOAT, pStep(0.001f)),
P<float>("Bloom Renormalize", 0x208, ParameterType.FLOAT, pMin(0.0f)),
P<int>("Bloom Color", 0x200, ParameterType.COLOR),
@@ -2283,6 +2283,9 @@ namespace WorldTuningTool
sslrEnvMapIntensity.Update(sMhScene!.Instance, true);
}
+ // Any CreateObject() can be called many times consecutively before it's associated DestroyObject().
+ // For this to be correct, the most recent CreateObject() needs to be the object that is used.
+ // This is why we cannot, for example, Assert(toneMapObject == 0x0) in CreateToneMapObjectHook().
private nint CreateToneMapObjectHook()
{
toneMapObject = createToneMapObject!.Original();
@@ -2290,6 +2293,7 @@ namespace WorldTuningTool
{
param.Update(toneMapObject);
}
+ Lut.clearState();
return toneMapObject;
}
@@ -2303,7 +2307,6 @@ namespace WorldTuningTool
{
param.Update(toneMapObject);
}
- Lut.clearState();
}
return destroyToneMapObject!.Original(toneMapObjectInternal, unknownInt);
}