diff options
author | aap <aap@papnet.eu> | 2020-10-29 19:11:47 +0100 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-10-29 19:11:47 +0100 |
commit | e97366c023ee81d0feefa131ed38c77131d29f40 (patch) | |
tree | ec7f378fbb88e855caa8764da2f6186946bf60dd /src/rw/RwHelper.cpp | |
parent | Merge branch 'master' of github.com:GTAmodding/re3 (diff) | |
download | re3-e97366c023ee81d0feefa131ed38c77131d29f40.tar re3-e97366c023ee81d0feefa131ed38c77131d29f40.tar.gz re3-e97366c023ee81d0feefa131ed38c77131d29f40.tar.bz2 re3-e97366c023ee81d0feefa131ed38c77131d29f40.tar.lz re3-e97366c023ee81d0feefa131ed38c77131d29f40.tar.xz re3-e97366c023ee81d0feefa131ed38c77131d29f40.tar.zst re3-e97366c023ee81d0feefa131ed38c77131d29f40.zip |
Diffstat (limited to '')
-rw-r--r-- | src/rw/RwHelper.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/rw/RwHelper.cpp b/src/rw/RwHelper.cpp index 4b598e9b..6a7010e2 100644 --- a/src/rw/RwHelper.cpp +++ b/src/rw/RwHelper.cpp @@ -3,6 +3,7 @@ #endif #include "common.h" +#include "RwHelper.h" #include "Timecycle.h" #include "skeleton.h" #include "Debug.h" @@ -16,6 +17,7 @@ bool gPS2alphaTest = true; #else bool gPS2alphaTest = false; #endif +bool gBackfaceCulling = true; #ifndef FINAL static bool charsetOpen; @@ -121,14 +123,32 @@ DefinedState(void) #ifdef LIBRW rw::SetRenderState(rw::ALPHATESTFUNC, rw::ALPHAGREATEREQUAL); - rw::SetRenderState(rw::ALPHATESTREF, 3); rw::SetRenderState(rw::GSALPHATEST, gPS2alphaTest); #else // D3D stuff RwD3D8SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER); - RwD3D8SetRenderState(D3DRS_ALPHAREF, 2); #endif + SetAlphaRef(2); +} + +void +SetAlphaRef(int ref) +{ +#ifdef LIBRW + rw::SetRenderState(rw::ALPHATESTREF, ref+1); +#else + RwD3D8SetRenderState(D3DRS_ALPHAREF, ref); +#endif +} + +void +SetCullMode(uint32 mode) +{ + if(gBackfaceCulling) + RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)mode); + else + RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); } RwFrame* |