Skip to content

Commit

Permalink
interface: make swapchain hooking mode into a console command instead
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats committed Jul 23, 2024
1 parent 22eea4b commit 7e709d9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Dalamud/Interface/Internal/DalamudInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,28 @@ private DalamudInterface(

this.creditsDarkeningAnimation.Point1 = Vector2.Zero;
this.creditsDarkeningAnimation.Point2 = new Vector2(CreditsDarkeningMaxAlpha);

// This is temporary, until we know the repercussions of vtable hooking mode
consoleManager.AddCommand(
"dalamud.interface.swapchain_mode",
"Set swapchain hooking mode",
(string mode) =>
{
switch (mode)
{
case "vtable":
this.configuration.SwapChainHookMode = SwapChainHelper.HookMode.VTable;
break;
case "bytecode":
this.configuration.SwapChainHookMode = SwapChainHelper.HookMode.ByteCode;
break;
default:
Log.Error("Unknown swapchain mode: {Mode}", mode);
break;
}
this.configuration.QueueSave();
});
}

private delegate nint CrashDebugDelegate(nint self);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public class SettingsTabExperimental : SettingsTab
},
},

/* // Making this a console command instead, for now
new GapSettingsEntry(5, true),
new EnumSettingsEntry<SwapChainHelper.HookMode>(
Expand All @@ -119,6 +120,7 @@ public class SettingsTabExperimental : SettingsTab
c => c.SwapChainHookMode,
(v, c) => c.SwapChainHookMode = v,
fallbackValue: SwapChainHelper.HookMode.ByteCode),
*/

/* Disabling profiles after they've been enabled doesn't make much sense, at least not if the user has already created profiles.
new GapSettingsEntry(5, true),
Expand Down

0 comments on commit 7e709d9

Please sign in to comment.