diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/audio/oal/stream.cpp | 7 | ||||
-rw-r--r-- | src/core/re3.cpp | 2 | ||||
-rw-r--r-- | src/render/Shadows.cpp | 59 | ||||
-rw-r--r-- | src/render/Shadows.h | 11 |
4 files changed, 32 insertions, 47 deletions
diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 34080514..eeaaafb0 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -8,13 +8,8 @@ #include <opusfile.h> #else #ifdef _WIN32 - -// TODO: This is due to version difference of 32-bit libmpg123 and 64-bit libmpg123, fix it -#ifndef _WIN64 -typedef long ssize_t; -#endif #pragma comment( lib, "libsndfile-1.lib" ) -#pragma comment( lib, "libmpg123.lib" ) +#pragma comment( lib, "libmpg123-0.lib" ) #else #include "crossplatform.h" #endif diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 8c0020d0..f9be4b51 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -457,9 +457,7 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); }); DebugMenuAddVarBool8("Render", "Draw hud", &CHud::m_Wants_To_Draw_Hud, nil); -#ifdef LIBRW DebugMenuAddVarBool8("Render", "PS2 Alpha test Emu", &gPS2alphaTest, nil); -#endif DebugMenuAddVarBool8("Render", "Frame limiter", &FrontEndMenuManager.m_PrefsFrameLimiter, nil); DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil); DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil); diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp index 9980d678..8c892be3 100644 --- a/src/render/Shadows.cpp +++ b/src/render/Shadows.cpp @@ -458,7 +458,7 @@ CShadows::StoreShadowForCar(CAutomobile *pCar) if ( CTimeCycle::GetShadowStrength() != 0 ) { CVector CarPos = pCar->GetPosition(); - float fDistToCamSqr = (CarPos - TheCamera.GetPosition()).MagnitudeSqr(); + float fDistToCamSqr = (CarPos - TheCamera.GetPosition()).MagnitudeSqr2D(); if ( CCutsceneMgr::IsRunning() ) fDistToCamSqr /= SQR(TheCamera.LODDistMultiplier) * 4.0f; @@ -1580,40 +1580,41 @@ CStaticShadow::Free(void) void CShadows::CalcPedShadowValues(CVector vecLightDir, - float *pfDisplacementX, float *pfDisplacementY, float *pfFrontX, float *pfFrontY, - float *pfSideX, float *pfSideY) + float *pfSideX, float *pfSideY, + float *pfDisplacementX, float *pfDisplacementY) { - ASSERT(pfDisplacementX != NULL); - ASSERT(pfDisplacementY != NULL); - ASSERT(pfFrontX != NULL); - ASSERT(pfFrontY != NULL); - ASSERT(pfSideX != NULL); - ASSERT(pfSideY != NULL); + ASSERT(pfFrontX != nil); + ASSERT(pfFrontY != nil); + ASSERT(pfSideX != nil); + ASSERT(pfSideY != nil); + ASSERT(pfDisplacementX != nil); + ASSERT(pfDisplacementY != nil); - *pfDisplacementX = -vecLightDir.x; - *pfDisplacementY = -vecLightDir.y; + *pfFrontX = -vecLightDir.x; + *pfFrontY = -vecLightDir.y; - float fDist = Sqrt(*pfDisplacementY * *pfDisplacementY + *pfDisplacementX * *pfDisplacementX); + float fDist = Sqrt(*pfFrontY * *pfFrontY + *pfFrontX * *pfFrontX); float fMult = (fDist + 1.0f) / fDist; - *pfDisplacementX *= fMult; - *pfDisplacementY *= fMult; - - *pfFrontX = -vecLightDir.y / fDist; - *pfFrontY = vecLightDir.x / fDist; + *pfFrontX *= fMult; + *pfFrontY *= fMult; - *pfSideX = -vecLightDir.x; - *pfSideY = -vecLightDir.y; + *pfSideX = -vecLightDir.y / fDist; + *pfSideY = vecLightDir.x / fDist; - *pfDisplacementX /= 2; - *pfDisplacementY /= 2; + *pfDisplacementX = -vecLightDir.x; + *pfDisplacementY = -vecLightDir.y; *pfFrontX /= 2; *pfFrontY /= 2; *pfSideX /= 2; *pfSideY /= 2; + + *pfDisplacementX /= 2; + *pfDisplacementY /= 2; + } void @@ -1658,22 +1659,22 @@ CShadows::RenderExtraPlayerShadows(void) vecLight.y *= fInv; vecLight.z *= fInv; - float fDisplacementX, fDisplacementY, fFrontX, fFrontY, fSideX, fSideY; + float fFrontX, fFrontY, fSideX, fSideY, fDisplacementX, fDisplacementY; CalcPedShadowValues(vecLight, - &fDisplacementX, &fDisplacementY, - &fFrontX, &fFrontY, - &fSideX, &fSideY); + &fFrontX, &fFrontY, + &fSideX, &fSideY, + &fDisplacementX, &fDisplacementY); CVector shadowPos = FindPlayerCoors(); - shadowPos.x += fSideX; - shadowPos.y += fSideY; + shadowPos.x += fDisplacementX; + shadowPos.y += fDisplacementY; StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowPedTex, &shadowPos, - fDisplacementX, fDisplacementY, fFrontX, fFrontY, + fSideX, fSideY, nColorStrength, 0, 0, 0, 4.0f, false, 1.0f); } @@ -1770,7 +1771,7 @@ CShadows::RenderIndicatorShadow(uint32 nID, uint8 ShadowType, RwTexture *pTextur { ASSERT(pPosn != NULL); - C3dMarkers::PlaceMarkerSet(nID, _TODOCONST(4), *pPosn, Max(fFrontX, -fSideY), + C3dMarkers::PlaceMarkerSet(nID, MARKERTYPE_CYLINDER, *pPosn, Max(fFrontX, -fSideY), 0, 128, 255, 128, 2048, 0.2f, 0); } diff --git a/src/render/Shadows.h b/src/render/Shadows.h index 63aaaaf2..8c909df3 100644 --- a/src/render/Shadows.h +++ b/src/render/Shadows.h @@ -128,21 +128,12 @@ class CPed; class CShadows { public: -#if 1 static int16 ShadowsStoredToBeRendered; static CStoredShadow asShadowsStored [MAX_STOREDSHADOWS]; static CPolyBunch aPolyBunches [MAX_POLYBUNCHES]; static CStaticShadow aStaticShadows [MAX_STATICSHADOWS]; static CPolyBunch *pEmptyBunchList; static CPermanentShadow aPermanentShadows[MAX_PERMAMENTSHADOWS]; -#else - static int16 &ShadowsStoredToBeRendered; - static CStoredShadow (&asShadowsStored) [MAX_STOREDSHADOWS]; - static CPolyBunch (&aPolyBunches) [MAX_POLYBUNCHES]; - static CStaticShadow (&aStaticShadows) [MAX_STATICSHADOWS]; - static CPolyBunch *&pEmptyBunchList; - static CPermanentShadow (&aPermanentShadows)[MAX_PERMAMENTSHADOWS]; -#endif static void Init (void); static void Shutdown (void); @@ -166,7 +157,7 @@ public: CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue, float fZDistance, float fScale, CPolyBunch **ppPolyBunch); static void UpdateStaticShadows (void); static void UpdatePermanentShadows (void); - static void CalcPedShadowValues (CVector vecLightDir, float *pfDisplacementX, float *pfDisplacementY, float *pfFrontX, float *pfFrontY, float *pfSideX, float *pfSideY); + static void CalcPedShadowValues (CVector vecLightDir, float *pfFrontX, float *pfFrontY, float *pfSideX, float *pfSideY, float *pfDisplacementX, float *pfDisplacementY); static void RenderExtraPlayerShadows (void); static void TidyUpShadows (void); static void RenderIndicatorShadow (uint32 nID, uint8 ShadowType, RwTexture *pTexture, CVector *pPosn, float fFrontX, float fFrontY, float fSideX, float fSideY, int16 nIntensity); |