Merge pull request #176 from Fire-Head/master

restore original shadows fading
This commit is contained in:
aap 2019-07-29 19:18:03 +02:00 committed by GitHub
commit 56ccb113f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 17 deletions

View File

@ -545,11 +545,7 @@ CShadows::StoreCarLightShadow(CAutomobile *pCar, int32 nID, RwTexture *pTexture,
{ {
float fDistToCam = Sqrt(fDistToCamSqr); float fDistToCam = Sqrt(fDistToCamSqr);
#ifndef FIX_BUGS if ( fDistToCam >= (fDrawDistance*(1.0f-(1.0f/4.0f))) && !bSpecialCam ) // BUG? must be 3.0?
if ( fDistToCam >= (fDrawDistance*(1.0f-(1.0f/4.0f))) && !bSpecialCam ) // BUG: must be 3.0
#else
if ( fDistToCam >= (fDrawDistance*(1.0f-(1.0f/3.0f))) && !bSpecialCam )
#endif
{ {
//fDistToCam == 0 -> 3 //fDistToCam == 0 -> 3
//fDistToCam == fDrawDistance -> 0 //fDistToCam == fDrawDistance -> 0
@ -607,22 +603,12 @@ CShadows::StoreShadowForPedObject(CEntity *pPedObject, float fDisplacementX, flo
{ {
float fDistToCam = Sqrt(fDistToCamSqr); float fDistToCam = Sqrt(fDistToCamSqr);
#ifndef FIX_BUGS
//fDistToCam == 0 -> 2 //fDistToCam == 0 -> 2
//fDistToCam == fDrawDistance -> -2 //fDistToCam == fDrawDistance -> -2
float fMult = 1.0f - (4.0f / fDrawDistance) * (fDistToCam - (fDrawDistance*(1.0f/4.0f))); // BUG: negative float fMult = 1.0f - (4.0f / fDrawDistance) * (fDistToCam - (fDrawDistance*(1.0f/4.0f))); // BUG ? negative
#else
//fDistToCam == 0 -> 4
//fDistToCam == fDrawDistance -> 0
float fMult = 1.0f - (4.0f / fDrawDistance) * (fDistToCam - (fDrawDistance*(1.0f-(1.0f/4.0f))) );
#endif
int32 nColorStrength; int32 nColorStrength;
#ifndef FIX_BUGS if ( fDistToCam >= (fDrawDistance*(1.0f/4.0f)) ) // BUG ? negative
if ( fDistToCam >= (fDrawDistance*(1.0f/4.0f)) ) // BUG: negative
#else
if ( fDistToCam >= (fDrawDistance*(1.0f-(1.0f/4.0f))) )
#endif
nColorStrength = (int32)(CTimeCycle::GetShadowStrength() * fMult); nColorStrength = (int32)(CTimeCycle::GetShadowStrength() * fMult);
else else
nColorStrength = CTimeCycle::GetShadowStrength(); nColorStrength = CTimeCycle::GetShadowStrength();