From 7ce4c99cb9755ae338a3e518e5934351e88835a9 Mon Sep 17 00:00:00 2001 From: Silent Date: Sat, 13 Apr 2019 18:17:30 +0200 Subject: [PATCH] Disable Z write for muzzleflash rendering --- SilentPatchSA/PedSA.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SilentPatchSA/PedSA.cpp b/SilentPatchSA/PedSA.cpp index d064cb8..af6362b 100644 --- a/SilentPatchSA/PedSA.cpp +++ b/SilentPatchSA/PedSA.cpp @@ -71,6 +71,9 @@ void CPed::RenderWeapon(bool bWeapon, bool bMuzzleFlash, bool bForShadow) if ( bMuzzleFlash && m_pMuzzleFlashFrame != nullptr ) { + RwScopedRenderState zWrite(rwRENDERSTATEZWRITEENABLE); + RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE); + SetGunFlashAlpha(false); RpAtomic* atomic = reinterpret_cast(GetFirstObject(m_pMuzzleFlashFrame)); RpAtomicRender( atomic ); @@ -99,6 +102,9 @@ void CPed::RenderWeapon(bool bWeapon, bool bMuzzleFlash, bool bForShadow) if ( bMuzzleFlash && m_pMuzzleFlashFrame != nullptr ) { + RwScopedRenderState zWrite(rwRENDERSTATEZWRITEENABLE); + RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE); + SetGunFlashAlpha(true); RpAtomic* atomic = reinterpret_cast(GetFirstObject(m_pMuzzleFlashFrame)); RpAtomicRender( atomic );