CMDLCache: light cleanup

This commit is contained in:
Kawe Mazidjatari 2023-07-08 02:45:08 +02:00
parent 2afec89c2f
commit ca423c0dcf
2 changed files with 4 additions and 4 deletions

View File

@ -285,11 +285,11 @@ studiohwdata_t* CMDLCache::GetHardwareData(CMDLCache* cache, MDLHandle_t handle)
void* pAnimData = (void*)*((_QWORD*)dataCache + 1);
AcquireSRWLockExclusive(reinterpret_cast<PSRWLOCK>(&*g_pMDLLock));
AcquireSRWLockExclusive(g_pMDLLock);
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) && !defined (GAMEDLL_S2)
v_CStudioHWDataRef__SetFlags(reinterpret_cast<CStudioHWDataRef*>(pAnimData), 1i64); // !!! DECLARED INLINE IN < S3 !!!
#endif
ReleaseSRWLockExclusive(reinterpret_cast<PSRWLOCK>(&*g_pMDLLock));
ReleaseSRWLockExclusive(g_pMDLLock);
}
if ((pStudioData->m_nFlags & STUDIODATA_FLAGS_STUDIOMESH_LOADED))
return &pStudioData->m_pHardwareRef->m_HardwareData;

View File

@ -127,7 +127,7 @@ inline CMemory p_CStudioHWDataRef__SetFlags; // Probably incorrect.
inline bool(*v_CStudioHWDataRef__SetFlags)(CStudioHWDataRef* ref, int64_t flags);
#endif
inline CMDLCache* g_pMDLCache = nullptr;
inline PSRWLOCK* g_pMDLLock = nullptr; // Possibly a member? research required.
inline PSRWLOCK g_pMDLLock = nullptr; // Possibly a member? research required.
///////////////////////////////////////////////////////////////////////////////
class VMDLCache : public IDetour
@ -189,7 +189,7 @@ class VMDLCache : public IDetour
g_pMDLCache = g_GameDll.FindPatternSIMD("48 83 EC 28 48 8B 05 ?? ?? ?? ?? 48 8D 0D ?? ?? ?? ?? 48 85 C0 48 0F 45 C8 FF 05 ?? ?? ?? ?? 48 83 3D ?? ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ??")
.FindPatternSelf("48 8D 05").ResolveRelativeAddressSelf(0x3, 0x7).RCast<CMDLCache*>();
g_pMDLLock = p_CMDLCache__GetHardwareData.Offset(0x35).FindPatternSelf("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<PSRWLOCK*>();
g_pMDLLock = p_CMDLCache__GetHardwareData.Offset(0x35).FindPatternSelf("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast<PSRWLOCK>();
}
virtual void GetCon(void) const { }
virtual void Attach(void) const;