mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-19 14:27:50 +01:00
Update for API 9
This commit is contained in:
parent
50f6de7809
commit
21d503a8cd
61 changed files with 210 additions and 192 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Dalamud.Hooking;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Penumbra.String;
|
||||
using Penumbra.String.Classes;
|
||||
using Penumbra.String.Functions;
|
||||
|
|
@ -14,9 +15,9 @@ public unsafe class CreateFileWHook : IDisposable
|
|||
{
|
||||
public const int RequiredSize = 28;
|
||||
|
||||
public CreateFileWHook()
|
||||
public CreateFileWHook(IGameInteropProvider interop)
|
||||
{
|
||||
_createFileWHook = Hook<CreateFileWDelegate>.FromImport(null, "KERNEL32.dll", "CreateFileW", 0, CreateFileWDetour);
|
||||
_createFileWHook = interop.HookFromImport<CreateFileWDelegate>(null, "KERNEL32.dll", "CreateFileW", 0, CreateFileWDetour);
|
||||
_createFileWHook.Enable();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Dalamud.Hooking;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.Interop.Structs;
|
||||
|
|
@ -8,11 +9,11 @@ namespace Penumbra.Interop.ResourceLoading;
|
|||
|
||||
public unsafe class FileReadService : IDisposable
|
||||
{
|
||||
public FileReadService(PerformanceTracker performance, ResourceManagerService resourceManager)
|
||||
public FileReadService(PerformanceTracker performance, ResourceManagerService resourceManager, IGameInteropProvider interop)
|
||||
{
|
||||
_resourceManager = resourceManager;
|
||||
_performance = performance;
|
||||
SignatureHelper.Initialise(this);
|
||||
interop.InitializeFromAttributes(this);
|
||||
_readSqPackHook.Enable();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||
|
|
@ -10,8 +11,8 @@ namespace Penumbra.Interop.ResourceLoading;
|
|||
|
||||
public unsafe class ResourceManagerService
|
||||
{
|
||||
public ResourceManagerService()
|
||||
=> SignatureHelper.Initialise(this);
|
||||
public ResourceManagerService(IGameInteropProvider interop)
|
||||
=> interop.InitializeFromAttributes(this);
|
||||
|
||||
/// <summary> The SE Resource Manager as pointer. </summary>
|
||||
public ResourceManager* ResourceManager
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
using Dalamud.Hooking;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.String;
|
||||
|
|
@ -16,19 +16,19 @@ public unsafe class ResourceService : IDisposable
|
|||
private readonly PerformanceTracker _performance;
|
||||
private readonly ResourceManagerService _resourceManager;
|
||||
|
||||
public ResourceService(PerformanceTracker performance, ResourceManagerService resourceManager)
|
||||
public ResourceService(PerformanceTracker performance, ResourceManagerService resourceManager, IGameInteropProvider interop)
|
||||
{
|
||||
_performance = performance;
|
||||
_resourceManager = resourceManager;
|
||||
SignatureHelper.Initialise(this);
|
||||
interop.InitializeFromAttributes(this);
|
||||
_getResourceSyncHook.Enable();
|
||||
_getResourceAsyncHook.Enable();
|
||||
_resourceHandleDestructorHook.Enable();
|
||||
_incRefHook = Hook<ResourceHandlePrototype>.FromAddress(
|
||||
_incRefHook = interop.HookFromAddress<ResourceHandlePrototype>(
|
||||
(nint)FFXIVClientStructs.FFXIV.Client.System.Resource.Handle.ResourceHandle.MemberFunctionPointers.IncRef,
|
||||
ResourceHandleIncRefDetour);
|
||||
_incRefHook.Enable();
|
||||
_decRefHook = Hook<ResourceHandleDecRefPrototype>.FromAddress(
|
||||
_decRefHook = interop.HookFromAddress<ResourceHandleDecRefPrototype>(
|
||||
(nint)FFXIVClientStructs.FFXIV.Client.System.Resource.Handle.ResourceHandle.MemberFunctionPointers.DecRef,
|
||||
ResourceHandleDecRefDetour);
|
||||
_decRefHook.Enable();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Dalamud.Hooking;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||
using Penumbra.Api.Enums;
|
||||
|
|
@ -19,9 +20,9 @@ public unsafe class TexMdlService
|
|||
public IReadOnlySet<ulong> CustomFileCrc
|
||||
=> _customFileCrc;
|
||||
|
||||
public TexMdlService()
|
||||
public TexMdlService(IGameInteropProvider interop)
|
||||
{
|
||||
SignatureHelper.Initialise(this);
|
||||
interop.InitializeFromAttributes(this);
|
||||
_checkFileStateHook.Enable();
|
||||
_loadTexFileExternHook.Enable();
|
||||
_loadMdlFileExternHook.Enable();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue