mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-31 06:57:28 +05:00
% switch Z writing later to narrow down var scope more
This commit is contained in:
parent
9236463f88
commit
07776b44cb
1 changed files with 5 additions and 3 deletions
|
@ -405,11 +405,9 @@ RpAtomic* TwoPassAlphaRender_Silent(RpAtomic* atomic)
|
||||||
return AtomicDefaultRenderCallBack(atomic);
|
return AtomicDefaultRenderCallBack(atomic);
|
||||||
|
|
||||||
int nPushedAlpha, nAlphaFunction;
|
int nPushedAlpha, nAlphaFunction;
|
||||||
int nZWrite;
|
|
||||||
int nAlphaBlending;
|
int nAlphaBlending;
|
||||||
|
|
||||||
RwRenderStateGet(rwRENDERSTATEALPHATESTFUNCTIONREF, &nPushedAlpha);
|
RwRenderStateGet(rwRENDERSTATEALPHATESTFUNCTIONREF, &nPushedAlpha);
|
||||||
RwRenderStateGet(rwRENDERSTATEZWRITEENABLE, &nZWrite);
|
|
||||||
RwRenderStateGet(rwRENDERSTATEVERTEXALPHAENABLE, &nAlphaBlending);
|
RwRenderStateGet(rwRENDERSTATEVERTEXALPHAENABLE, &nAlphaBlending);
|
||||||
RwRenderStateGet(rwRENDERSTATEALPHATESTFUNCTION, &nAlphaFunction);
|
RwRenderStateGet(rwRENDERSTATEALPHATESTFUNCTION, &nAlphaFunction);
|
||||||
|
|
||||||
|
@ -422,17 +420,21 @@ RpAtomic* TwoPassAlphaRender_Silent(RpAtomic* atomic)
|
||||||
|
|
||||||
if ( atomic != nullptr )
|
if ( atomic != nullptr )
|
||||||
{
|
{
|
||||||
|
int nZWrite;
|
||||||
|
RwRenderStateGet(rwRENDERSTATEZWRITEENABLE, &nZWrite);
|
||||||
|
|
||||||
// 2nd pass
|
// 2nd pass
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(TRUE));
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(TRUE));
|
||||||
RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTION, reinterpret_cast<void*>(rwALPHATESTFUNCTIONLESS));
|
RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTION, reinterpret_cast<void*>(rwALPHATESTFUNCTIONLESS));
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
|
||||||
|
|
||||||
atomic = AtomicDefaultRenderCallBack(atomic);
|
atomic = AtomicDefaultRenderCallBack(atomic);
|
||||||
|
|
||||||
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, reinterpret_cast<void*>(nZWrite));
|
||||||
}
|
}
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTIONREF, reinterpret_cast<void*>(nPushedAlpha));
|
RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTIONREF, reinterpret_cast<void*>(nPushedAlpha));
|
||||||
RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTION, reinterpret_cast<void*>(nAlphaFunction));
|
RwRenderStateSet(rwRENDERSTATEALPHATESTFUNCTION, reinterpret_cast<void*>(nAlphaFunction));
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, reinterpret_cast<void*>(nZWrite));
|
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(nAlphaBlending));
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, reinterpret_cast<void*>(nAlphaBlending));
|
||||||
|
|
||||||
return atomic;
|
return atomic;
|
||||||
|
|
Loading…
Reference in a new issue