From ca423c0dcf3d10d31bebf7951a95371d0305a9d9 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 8 Jul 2023 02:45:08 +0200 Subject: [PATCH] CMDLCache: light cleanup --- r5dev/datacache/mdlcache.cpp | 4 ++-- r5dev/datacache/mdlcache.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/r5dev/datacache/mdlcache.cpp b/r5dev/datacache/mdlcache.cpp index ede87af7..d649d758 100644 --- a/r5dev/datacache/mdlcache.cpp +++ b/r5dev/datacache/mdlcache.cpp @@ -285,11 +285,11 @@ studiohwdata_t* CMDLCache::GetHardwareData(CMDLCache* cache, MDLHandle_t handle) void* pAnimData = (void*)*((_QWORD*)dataCache + 1); - AcquireSRWLockExclusive(reinterpret_cast(&*g_pMDLLock)); + AcquireSRWLockExclusive(g_pMDLLock); #if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) && !defined (GAMEDLL_S2) v_CStudioHWDataRef__SetFlags(reinterpret_cast(pAnimData), 1i64); // !!! DECLARED INLINE IN < S3 !!! #endif - ReleaseSRWLockExclusive(reinterpret_cast(&*g_pMDLLock)); + ReleaseSRWLockExclusive(g_pMDLLock); } if ((pStudioData->m_nFlags & STUDIODATA_FLAGS_STUDIOMESH_LOADED)) return &pStudioData->m_pHardwareRef->m_HardwareData; diff --git a/r5dev/datacache/mdlcache.h b/r5dev/datacache/mdlcache.h index 1686a04e..4eb5f7b9 100644 --- a/r5dev/datacache/mdlcache.h +++ b/r5dev/datacache/mdlcache.h @@ -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(); - g_pMDLLock = p_CMDLCache__GetHardwareData.Offset(0x35).FindPatternSelf("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast(); + g_pMDLLock = p_CMDLCache__GetHardwareData.Offset(0x35).FindPatternSelf("48 8D 0D").ResolveRelativeAddressSelf(0x3, 0x7).RCast(); } virtual void GetCon(void) const { } virtual void Attach(void) const;