mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Rename 'MOD_' to 'Mod_'
The engine names these functions as 'Mod_'.
This commit is contained in:
parent
8dc12644be
commit
c24e8a9f21
@ -29,7 +29,7 @@ KeyValues* s_pLevelSetKV = nullptr;
|
||||
// Input : *pszLevelName -
|
||||
// Output : true if level name deviates from previous level
|
||||
//-----------------------------------------------------------------------------
|
||||
bool MOD_LevelHasChanged(const char* pszLevelName)
|
||||
bool Mod_LevelHasChanged(const char* pszLevelName)
|
||||
{
|
||||
return (s_svLevelName.compare(pszLevelName) != 0);
|
||||
}
|
||||
@ -37,7 +37,7 @@ bool MOD_LevelHasChanged(const char* pszLevelName)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: gets all installed maps
|
||||
//-----------------------------------------------------------------------------
|
||||
void MOD_GetAllInstalledMaps()
|
||||
void Mod_GetAllInstalledMaps()
|
||||
{
|
||||
std::lock_guard<std::mutex> l(g_MapVecMutex);
|
||||
g_vAllMaps.clear(); // Clear current list.
|
||||
@ -75,7 +75,7 @@ void MOD_GetAllInstalledMaps()
|
||||
// a3 -
|
||||
// Output : __int64
|
||||
//-----------------------------------------------------------------------------
|
||||
__int64 __fastcall MOD_GetQueuedPakHandle(char* a1, char* a2, __int64 a3)
|
||||
__int64 __fastcall Mod_GetQueuedPakHandle(char* a1, char* a2, __int64 a3)
|
||||
{
|
||||
char v3; // al
|
||||
signed int v4; // er11
|
||||
@ -129,7 +129,7 @@ __int64 __fastcall MOD_GetQueuedPakHandle(char* a1, char* a2, __int64 a3)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: processes queued pak files
|
||||
//-----------------------------------------------------------------------------
|
||||
void MOD_ProcessPakQueue()
|
||||
void Mod_ProcessPakQueue()
|
||||
{
|
||||
char v0; // bl
|
||||
char** v1; // r10
|
||||
@ -242,7 +242,7 @@ void MOD_ProcessPakQueue()
|
||||
}
|
||||
|
||||
g_pakLoadApi->UnloadPak(*(RPakHandle_t*)v10);
|
||||
MOD_UnloadPakFile(); // Unload mod pak files.
|
||||
Mod_UnloadPakFile(); // Unload mod pak files.
|
||||
|
||||
s_pLevelSetKV->DeleteThis(); // Delete current level settings if we drop all paks..
|
||||
s_pLevelSetKV = nullptr;
|
||||
@ -273,7 +273,7 @@ void MOD_ProcessPakQueue()
|
||||
} while (v19);
|
||||
if (!v20)
|
||||
goto LABEL_37;
|
||||
MOD_GetQueuedPakHandle(v17, *((char**)v15 + 34), 260i64);
|
||||
Mod_GetQueuedPakHandle(v17, *((char**)v15 + 34), 260i64);
|
||||
if (v15[5])
|
||||
break;
|
||||
*(_DWORD*)v15 = -1;
|
||||
@ -321,7 +321,7 @@ void MOD_ProcessPakQueue()
|
||||
if (s_bBasePaksInitialized && !s_bLevelResourceInitialized)
|
||||
{
|
||||
s_bLevelResourceInitialized = true;
|
||||
MOD_PreloadLevelPaks(g_pHostState->m_levelName);
|
||||
Mod_PreloadLevelPaks(g_pHostState->m_levelName);
|
||||
}
|
||||
*(_DWORD*)v15 = g_pakLoadApi->LoadAsync(v17, g_pMallocPool.GetPtr(), 4, 0);
|
||||
|
||||
@ -353,13 +353,13 @@ void MOD_ProcessPakQueue()
|
||||
// Input : *szLevelName -
|
||||
// Output : true on success, false on failure
|
||||
//-----------------------------------------------------------------------------
|
||||
bool MOD_LoadPakForMap(const char* szLevelName)
|
||||
bool Mod_LoadPakForMap(const char* szLevelName)
|
||||
{
|
||||
if (MOD_LevelHasChanged(szLevelName))
|
||||
if (Mod_LevelHasChanged(szLevelName))
|
||||
s_bLevelResourceInitialized = false;
|
||||
|
||||
s_svLevelName = szLevelName;
|
||||
return v_MOD_LoadPakForMap(szLevelName);
|
||||
return v_Mod_LoadPakForMap(szLevelName);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -367,11 +367,11 @@ bool MOD_LoadPakForMap(const char* szLevelName)
|
||||
// Input : *pszLevelName -
|
||||
// Output : KeyValues*
|
||||
//-----------------------------------------------------------------------------
|
||||
KeyValues* MOD_GetLevelSettings(const char* pszLevelName)
|
||||
KeyValues* Mod_GetLevelSettings(const char* pszLevelName)
|
||||
{
|
||||
if (s_pLevelSetKV)
|
||||
{
|
||||
if (!MOD_LevelHasChanged(pszLevelName))
|
||||
if (!Mod_LevelHasChanged(pszLevelName))
|
||||
{
|
||||
return s_pLevelSetKV;
|
||||
}
|
||||
@ -390,9 +390,9 @@ KeyValues* MOD_GetLevelSettings(const char* pszLevelName)
|
||||
// Purpose: loads required pakfile assets for specified BSP level
|
||||
// Input : &svSetFile -
|
||||
//-----------------------------------------------------------------------------
|
||||
void MOD_PreloadLevelPaks(const char* pszLevelName)
|
||||
void Mod_PreloadLevelPaks(const char* pszLevelName)
|
||||
{
|
||||
KeyValues* pSettingsKV = MOD_GetLevelSettings(pszLevelName);
|
||||
KeyValues* pSettingsKV = Mod_GetLevelSettings(pszLevelName);
|
||||
|
||||
if (!pSettingsKV)
|
||||
return;
|
||||
@ -422,7 +422,7 @@ void MOD_PreloadLevelPaks(const char* pszLevelName)
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: unloads all pakfiles loaded by the SDK
|
||||
//-----------------------------------------------------------------------------
|
||||
void MOD_UnloadPakFile(void)
|
||||
void Mod_UnloadPakFile(void)
|
||||
{
|
||||
for (const RPakHandle_t& it : g_vLoadedPakHandle)
|
||||
{
|
||||
@ -437,12 +437,12 @@ void MOD_UnloadPakFile(void)
|
||||
|
||||
void CModelBsp_Attach()
|
||||
{
|
||||
DetourAttach((LPVOID*)&v_MOD_LoadPakForMap, &MOD_LoadPakForMap);
|
||||
DetourAttach((LPVOID*)&v_MOD_ProcessPakQueue, &MOD_ProcessPakQueue);
|
||||
DetourAttach((LPVOID*)&v_Mod_LoadPakForMap, &Mod_LoadPakForMap);
|
||||
DetourAttach((LPVOID*)&v_Mod_ProcessPakQueue, &Mod_ProcessPakQueue);
|
||||
}
|
||||
|
||||
void CModelBsp_Detach()
|
||||
{
|
||||
DetourDetach((LPVOID*)&v_MOD_LoadPakForMap, &MOD_LoadPakForMap);
|
||||
DetourDetach((LPVOID*)&v_MOD_ProcessPakQueue, &MOD_ProcessPakQueue);
|
||||
DetourDetach((LPVOID*)&v_Mod_LoadPakForMap, &Mod_LoadPakForMap);
|
||||
DetourDetach((LPVOID*)&v_Mod_ProcessPakQueue, &Mod_ProcessPakQueue);
|
||||
}
|
@ -6,11 +6,11 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
class KeyValues;
|
||||
|
||||
inline CMemory p_MOD_LoadPakForMap;
|
||||
inline auto v_MOD_LoadPakForMap = p_MOD_LoadPakForMap.RCast<bool(*)(const char* szLevelName)>();
|
||||
inline CMemory p_Mod_LoadPakForMap;
|
||||
inline auto v_Mod_LoadPakForMap = p_Mod_LoadPakForMap.RCast<bool(*)(const char* szLevelName)>();
|
||||
|
||||
inline CMemory p_MOD_ProcessPakQueue;
|
||||
inline auto v_MOD_ProcessPakQueue = p_MOD_ProcessPakQueue.RCast<void(*)(void)>();
|
||||
inline CMemory p_Mod_ProcessPakQueue;
|
||||
inline auto v_Mod_ProcessPakQueue = p_Mod_ProcessPakQueue.RCast<void(*)(void)>();
|
||||
|
||||
inline float* dword_14B383420;
|
||||
inline int32_t * dword_1634F445C;
|
||||
@ -24,18 +24,18 @@ inline void** unk_141874550;
|
||||
inline int64_t* qword_167ED7BC0;
|
||||
inline int64_t* qword_167ED7C68;
|
||||
|
||||
inline auto sub_14045BAC0 = p_MOD_ProcessPakQueue.RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4)>();
|
||||
inline auto sub_14045A1D0 = p_MOD_ProcessPakQueue.RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>();
|
||||
inline auto sub_140441220 = p_MOD_ProcessPakQueue.RCast<void(*)(__int64 a1, __int64 a2)>();
|
||||
inline auto sub_14045BAC0 = p_Mod_ProcessPakQueue.RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4)>();
|
||||
inline auto sub_14045A1D0 = p_Mod_ProcessPakQueue.RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>();
|
||||
inline auto sub_140441220 = p_Mod_ProcessPakQueue.RCast<void(*)(__int64 a1, __int64 a2)>();
|
||||
|
||||
extern bool s_bBasePaksInitialized;
|
||||
extern vector<string> g_vAllMaps;
|
||||
|
||||
bool MOD_LevelHasChanged(const char* pszLevelName);
|
||||
void MOD_GetAllInstalledMaps();
|
||||
KeyValues* MOD_GetLevelSettings(const char* pszLevelName);
|
||||
void MOD_PreloadLevelPaks(const char* pszLevelName);
|
||||
void MOD_UnloadPakFile(void);
|
||||
bool Mod_LevelHasChanged(const char* pszLevelName);
|
||||
void Mod_GetAllInstalledMaps();
|
||||
KeyValues* Mod_GetLevelSettings(const char* pszLevelName);
|
||||
void Mod_PreloadLevelPaks(const char* pszLevelName);
|
||||
void Mod_UnloadPakFile(void);
|
||||
|
||||
void CModelBsp_Attach();
|
||||
void CModelBsp_Detach();
|
||||
@ -44,8 +44,8 @@ class VModel_BSP : public IDetour
|
||||
{
|
||||
virtual void GetAdr(void) const
|
||||
{
|
||||
spdlog::debug("| FUN: MOD_LoadPakForMap : {:#18x} |\n", p_MOD_LoadPakForMap.GetPtr());
|
||||
spdlog::debug("| FUN: MOD_ProcessPakQueue : {:#18x} |\n", p_MOD_ProcessPakQueue.GetPtr());
|
||||
spdlog::debug("| FUN: Mod_LoadPakForMap : {:#18x} |\n", p_Mod_LoadPakForMap.GetPtr());
|
||||
spdlog::debug("| FUN: Mod_ProcessPakQueue : {:#18x} |\n", p_Mod_ProcessPakQueue.GetPtr());
|
||||
spdlog::debug("+----------------------------------------------------------------+\n");
|
||||
spdlog::debug("| FUN: sub_14045BAC0 : {:#18x} |\n", reinterpret_cast<uintptr_t>(sub_14045BAC0));
|
||||
spdlog::debug("| FUN: sub_14045A1D0 : {:#18x} |\n", reinterpret_cast<uintptr_t>(sub_14045A1D0));
|
||||
@ -69,11 +69,11 @@ class VModel_BSP : public IDetour
|
||||
p_MOD_LoadPakForMap = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\x4C\x8B\xC1\x48\x8D\x15\x00\x00\x00\x00\x48\x8D\x4C\x24\x00\xE8\x00\x00\x00\x00\x4C\x8D\x0D\x00\x00\x00\x00"), "xxx????xxxxxx????xxxx?x????xxx????");
|
||||
v_MOD_LoadPakForMap = p_MOD_LoadPakForMap.RCast<bool(*)(const char*)>(); /*48 81 EC ? ? ? ? 4C 8B C1 48 8D 15 ? ? ? ? 48 8D 4C 24 ? E8 ? ? ? ? 4C 8D 0D ? ? ? ?*/
|
||||
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
||||
p_MOD_LoadPakForMap = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\x0F\xB6\x05\x00\x00\x00\x00\x4C\x8D\x05\x00\x00\x00\x00\x84\xC0"), "xxx????xxx????xxx????xx");
|
||||
v_MOD_LoadPakForMap = p_MOD_LoadPakForMap.RCast<bool(*)(const char*)>(); /*48 81 EC ? ? ? ? 0F B6 05 ? ? ? ? 4C 8D 05 ? ? ? ? 84 C0*/
|
||||
p_Mod_LoadPakForMap = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x81\xEC\x00\x00\x00\x00\x0F\xB6\x05\x00\x00\x00\x00\x4C\x8D\x05\x00\x00\x00\x00\x84\xC0"), "xxx????xxx????xxx????xx");
|
||||
v_Mod_LoadPakForMap = p_Mod_LoadPakForMap.RCast<bool(*)(const char*)>(); /*48 81 EC ? ? ? ? 0F B6 05 ? ? ? ? 4C 8D 05 ? ? ? ? 84 C0*/
|
||||
#endif
|
||||
p_MOD_ProcessPakQueue = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x00\xF3\x0F\x10\x05\x00\x00\x00\x00\x32\xDB"), "xxxxx?xxxx????xx");
|
||||
v_MOD_ProcessPakQueue = p_MOD_ProcessPakQueue.RCast<void(*)(void)>(); /*40 53 48 83 EC ?? F3 0F 10 05 ? ? ? ? 32 DB*/
|
||||
p_Mod_ProcessPakQueue = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x00\xF3\x0F\x10\x05\x00\x00\x00\x00\x32\xDB"), "xxxxx?xxxx????xx");
|
||||
v_Mod_ProcessPakQueue = p_Mod_ProcessPakQueue.RCast<void(*)(void)>(); /*40 53 48 83 EC ?? F3 0F 10 05 ? ? ? ? 32 DB*/
|
||||
|
||||
sub_14045BAC0 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x4C\x89\x4C\x24\x00\x4C\x89\x44\x24\x00\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x60"), "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxx").RCast<__int64(*)(__int64(__fastcall* a1)(__int64, _DWORD*, __int64, _QWORD*), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4)>();
|
||||
sub_14045A1D0 = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x4C\x89\x4C\x24\x00\x4C\x89\x44\x24\x00\x48\x89\x54\x24\x00\x48\x89\x4C\x24\x00\x55\x53\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\x6C\x24\x00"), "xxxx?xxxx?xxxx?xxxx?xxxxxxxxxxxxxxxx?").RCast<__int64(*)(unsigned __int8(__fastcall* a1)(_QWORD), JobFifoLock_s* pFifoLock, __int64 a3, __int64 a4, volatile signed __int64* a5, char a6)>();
|
||||
@ -85,17 +85,17 @@ class VModel_BSP : public IDetour
|
||||
}
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
dword_14B383420 = p_MOD_ProcessPakQueue.FindPattern("F3 0F 10").ResolveRelativeAddressSelf(0x4, 0x8).RCast<float*>();
|
||||
dword_1634F445C = p_MOD_ProcessPakQueue.FindPattern("8B 05").ResolveRelativeAddressSelf(0x2, 0x6).RCast<int32_t*>();
|
||||
qword_167ED7BB8 = p_MOD_ProcessPakQueue.Offset(0x10).FindPatternSelf("48 83").ResolveRelativeAddressSelf(0x3, 0x8).RCast<void**>();
|
||||
qword_14180A098 = p_MOD_ProcessPakQueue.Offset(0x20).FindPatternSelf("83 3D").ResolveRelativeAddressSelf(0x2, 0x7).RCast<void**>();
|
||||
byte_16709DDDF = p_MOD_ProcessPakQueue.Offset(0x20).FindPatternSelf("88 1D").ResolveRelativeAddressSelf(0x2, 0x6).RCast<bool*>();
|
||||
off_141874660 = p_MOD_ProcessPakQueue.Offset(0x40).FindPatternSelf("4C 8D 15").ResolveRelativeAddressSelf(0x3, 0x7).RCast<char**>();
|
||||
unk_141874555 = p_MOD_ProcessPakQueue.Offset(0x40).FindPatternSelf("4C 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_1418749B0 = p_MOD_ProcessPakQueue.Offset(0xA0).FindPatternSelf("48 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_141874550 = p_MOD_ProcessPakQueue.Offset(0x150).FindPatternSelf("48 8D 2D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
qword_167ED7BC0 = p_MOD_ProcessPakQueue.Offset(0x200).FindPatternSelf("48 83 3D").ResolveRelativeAddressSelf(0x3, 0x8).RCast<int64_t*>();
|
||||
qword_167ED7C68 = p_MOD_ProcessPakQueue.Offset(0x200).FindPatternSelf("0F B7 05").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||
dword_14B383420 = p_Mod_ProcessPakQueue.FindPattern("F3 0F 10").ResolveRelativeAddressSelf(0x4, 0x8).RCast<float*>();
|
||||
dword_1634F445C = p_Mod_ProcessPakQueue.FindPattern("8B 05").ResolveRelativeAddressSelf(0x2, 0x6).RCast<int32_t*>();
|
||||
qword_167ED7BB8 = p_Mod_ProcessPakQueue.Offset(0x10).FindPatternSelf("48 83").ResolveRelativeAddressSelf(0x3, 0x8).RCast<void**>();
|
||||
qword_14180A098 = p_Mod_ProcessPakQueue.Offset(0x20).FindPatternSelf("83 3D").ResolveRelativeAddressSelf(0x2, 0x7).RCast<void**>();
|
||||
byte_16709DDDF = p_Mod_ProcessPakQueue.Offset(0x20).FindPatternSelf("88 1D").ResolveRelativeAddressSelf(0x2, 0x6).RCast<bool*>();
|
||||
off_141874660 = p_Mod_ProcessPakQueue.Offset(0x40).FindPatternSelf("4C 8D 15").ResolveRelativeAddressSelf(0x3, 0x7).RCast<char**>();
|
||||
unk_141874555 = p_Mod_ProcessPakQueue.Offset(0x40).FindPatternSelf("4C 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_1418749B0 = p_Mod_ProcessPakQueue.Offset(0xA0).FindPatternSelf("48 8D 1D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
unk_141874550 = p_Mod_ProcessPakQueue.Offset(0x150).FindPatternSelf("48 8D 2D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<void**>();
|
||||
qword_167ED7BC0 = p_Mod_ProcessPakQueue.Offset(0x200).FindPatternSelf("48 83 3D").ResolveRelativeAddressSelf(0x3, 0x8).RCast<int64_t*>();
|
||||
qword_167ED7C68 = p_Mod_ProcessPakQueue.Offset(0x200).FindPatternSelf("0F B7 05").ResolveRelativeAddressSelf(0x3, 0x7).RCast<int64_t*>();
|
||||
|
||||
(*((char**)(&qword_167ED7C68))) -= 6;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
//---------------------------------------------------------------------------------
|
||||
void StreamDB_Init(const char* pszLevelName)
|
||||
{
|
||||
KeyValues* pSettingsKV = MOD_GetLevelSettings(pszLevelName);
|
||||
KeyValues* pSettingsKV = Mod_GetLevelSettings(pszLevelName);
|
||||
|
||||
if (pSettingsKV)
|
||||
{
|
||||
|
@ -1269,7 +1269,7 @@ void KeyValues::InitPlaylists(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
MOD_GetAllInstalledMaps(); // Parse all installed maps.
|
||||
Mod_GetAllInstalledMaps(); // Parse all installed maps.
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user