Merge branch 'master' into miami

# Conflicts:
#	src/animation/RpAnimBlend.cpp
#	src/audio/oal/stream.cpp
#	src/audio/sampman.h
#	src/control/Pickups.cpp
#	src/core/Collision.cpp
#	src/core/Collision.h
#	src/core/FileLoader.cpp
#	src/core/FileMgr.cpp
#	src/core/FileMgr.h
#	src/core/Streaming.cpp
#	src/core/Streaming.h
#	src/core/SurfaceTable.h
#	src/modelinfo/VehicleModelInfo.h
#	src/peds/Ped.cpp
#	src/rw/RwHelper.cpp
#	src/rw/RwHelper.h
#	src/skel/glfw/glfw.cpp
#	src/skel/platform.h
#	src/text/Text.cpp
#	src/text/Text.h
#	src/vehicles/CarGen.cpp
#	src/vehicles/Heli.cpp
This commit is contained in:
Sergeanur 2020-07-29 15:34:57 +03:00
commit acdc52116e
14 changed files with 377 additions and 41 deletions

View file

@ -11,7 +11,11 @@
RtCharset *debugCharset;
#endif
bool gPS2alphaTest = 1;
#ifdef DUAL_PASS_RENDERING
bool gPS2alphaTest = true;
#else
bool gPS2alphaTest = false;
#endif
bool gBackfaceCulling;
#ifndef FINAL
@ -688,3 +692,37 @@ ConvertPlatformAtomic(RpAtomic *atomic, void *data)
return atomic;
}
#endif
#if defined(FIX_BUGS) && defined(GTA_PC)
RwUInt32 saved_alphafunc, saved_alpharef;
void
SetAlphaTest(RwUInt32 alpharef)
{
#ifdef LIBRW
saved_alphafunc = rw::GetRenderState(rw::ALPHATESTFUNC);
saved_alpharef = rw::GetRenderState(rw::ALPHATESTREF);
rw::SetRenderState(rw::ALPHATESTFUNC, rw::ALPHAGREATEREQUAL);
rw::SetRenderState(rw::ALPHATESTREF, 0);
#else
RwD3D8GetRenderState(D3DRS_ALPHAFUNC, &saved_alphafunc);
RwD3D8GetRenderState(D3DRS_ALPHAREF, &saved_alpharef);
RwD3D8SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
RwD3D8SetRenderState(D3DRS_ALPHAREF, alpharef);
#endif
}
void
RestoreAlphaTest()
{
#ifdef LIBRW
rw::SetRenderState(rw::ALPHATESTFUNC, saved_alphafunc);
rw::SetRenderState(rw::ALPHATESTREF, saved_alpharef);
#else
RwD3D8SetRenderState(D3DRS_ALPHAFUNC, saved_alphafunc);
RwD3D8SetRenderState(D3DRS_ALPHAREF, saved_alpharef);
#endif
}
#endif