diff options
Diffstat (limited to 'NorthstarDLL/filesystem.cpp')
-rw-r--r-- | NorthstarDLL/filesystem.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/NorthstarDLL/filesystem.cpp b/NorthstarDLL/filesystem.cpp index 9fba160f..e6c6f49a 100644 --- a/NorthstarDLL/filesystem.cpp +++ b/NorthstarDLL/filesystem.cpp @@ -51,8 +51,10 @@ namespace R2 } } // namespace R2 +// clang-format off HOOK(AddSearchPathHook, AddSearchPath, -void,, (IFileSystem* fileSystem, const char* pPath, const char* pathID, SearchPathAdd_t addType)) +void, __fastcall, (IFileSystem * fileSystem, const char* pPath, const char* pathID, SearchPathAdd_t addType)) +// clang-format on { AddSearchPath(fileSystem, pPath, pathID, addType); @@ -104,8 +106,10 @@ bool TryReplaceFile(const char* pPath, bool shouldCompile) } // force modded files to be read from mods, not cache +// clang-format off HOOK(ReadFromCacheHook, ReadFromCache, -bool,, (IFileSystem* filesystem, char* pPath, void* result)) +bool, __fastcall, (IFileSystem * filesystem, char* pPath, void* result)) +// clang-format off { if (TryReplaceFile(pPath, true)) return false; @@ -114,8 +118,10 @@ bool,, (IFileSystem* filesystem, char* pPath, void* result)) } // force modded files to be read from mods, not vpk +// clang-format off AUTOHOOK(ReadFileFromVPK, filesystem_stdio.dll + 0x5CBA0, -FileHandle_t,, (VPKData* vpkInfo, uint64_t* b, char* filename)) +FileHandle_t, __fastcall, (VPKData* vpkInfo, uint64_t* b, char* filename)) +// clang-format on { // don't compile here because this is only ever called from OpenEx, which already compiles if (TryReplaceFile(filename, false)) @@ -127,15 +133,16 @@ FileHandle_t,, (VPKData* vpkInfo, uint64_t* b, char* filename)) return ReadFileFromVPK(vpkInfo, b, filename); } +// clang-format off AUTOHOOK(CBaseFileSystem__OpenEx, filesystem_stdio.dll + 0x15F50, -FileHandle_t,, (IFileSystem* filesystem, const char* pPath, const char* pOptions, uint32_t flags, const char* pPathID, char **ppszResolvedFilename)) +FileHandle_t, __fastcall, (IFileSystem* filesystem, const char* pPath, const char* pOptions, uint32_t flags, const char* pPathID, char **ppszResolvedFilename)) +// clang-format on { TryReplaceFile(pPath, true); return CBaseFileSystem__OpenEx(filesystem, pPath, pOptions, flags, pPathID, ppszResolvedFilename); } -HOOK(MountVPKHook, MountVPK, -VPKData*,, (IFileSystem* fileSystem, const char* pVpkPath)) +HOOK(MountVPKHook, MountVPK, VPKData*, , (IFileSystem * fileSystem, const char* pVpkPath)) { spdlog::info("MountVPK {}", pVpkPath); VPKData* ret = MountVPK(fileSystem, pVpkPath); |