Disable Z write for muzzleflash rendering

This commit is contained in:
Silent 2019-04-13 18:17:30 +02:00
parent 6fc792ed2d
commit 7ce4c99cb9
No known key found for this signature in database
GPG key ID: AE53149BB0C45AF1

View file

@ -71,6 +71,9 @@ void CPed::RenderWeapon(bool bWeapon, bool bMuzzleFlash, bool bForShadow)
if ( bMuzzleFlash && m_pMuzzleFlashFrame != nullptr ) if ( bMuzzleFlash && m_pMuzzleFlashFrame != nullptr )
{ {
RwScopedRenderState zWrite(rwRENDERSTATEZWRITEENABLE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
SetGunFlashAlpha(false); SetGunFlashAlpha(false);
RpAtomic* atomic = reinterpret_cast<RpAtomic*>(GetFirstObject(m_pMuzzleFlashFrame)); RpAtomic* atomic = reinterpret_cast<RpAtomic*>(GetFirstObject(m_pMuzzleFlashFrame));
RpAtomicRender( atomic ); RpAtomicRender( atomic );
@ -99,6 +102,9 @@ void CPed::RenderWeapon(bool bWeapon, bool bMuzzleFlash, bool bForShadow)
if ( bMuzzleFlash && m_pMuzzleFlashFrame != nullptr ) if ( bMuzzleFlash && m_pMuzzleFlashFrame != nullptr )
{ {
RwScopedRenderState zWrite(rwRENDERSTATEZWRITEENABLE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
SetGunFlashAlpha(true); SetGunFlashAlpha(true);
RpAtomic* atomic = reinterpret_cast<RpAtomic*>(GetFirstObject(m_pMuzzleFlashFrame)); RpAtomic* atomic = reinterpret_cast<RpAtomic*>(GetFirstObject(m_pMuzzleFlashFrame));
RpAtomicRender( atomic ); RpAtomicRender( atomic );