summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/render/Coronas.cpp6
-rw-r--r--src/render/Shadows.cpp8
-rw-r--r--src/render/Skidmarks.cpp4
-rw-r--r--src/render/SpecialFX.cpp1
-rw-r--r--src/render/SpecialFX.h2
-rw-r--r--src/render/Timecycle.cpp2
-rw-r--r--src/render/Timecycle.h2
-rw-r--r--src/render/Weather.cpp6
8 files changed, 18 insertions, 13 deletions
diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp
index 8e832ab1..efe486fe 100644
--- a/src/render/Coronas.cpp
+++ b/src/render/Coronas.cpp
@@ -509,18 +509,18 @@ CCoronas::DoSunAndMoon(void)
{
// yeah, moon is done somewhere else....
- CVector sunCoors = CTimeCycle::GetSunPosition();
+ CVector sunCoors = CTimeCycle::GetSunDirection();
sunCoors *= 150.0f;
sunCoors += TheCamera.GetPosition();
- if(CTimeCycle::GetSunPosition().z > -0.2f){
+ if(CTimeCycle::GetSunDirection().z > -0.2f){
float size = ((CGeneral::GetRandomNumber()&0xFF) * 0.005f + 10.0f) * CTimeCycle::GetSunSize();
RegisterCorona(SUN_CORE,
CTimeCycle::GetSunCoreRed(), CTimeCycle::GetSunCoreGreen(), CTimeCycle::GetSunCoreBlue(),
255, sunCoors, size,
999999.88f, TYPE_STAR, FLARE_NONE, REFLECTION_OFF, LOSCHECK_OFF, STREAK_OFF, 0.0f);
- if(CTimeCycle::GetSunPosition().z > 0.0f)
+ if(CTimeCycle::GetSunDirection().z > 0.0f)
RegisterCorona(SUN_CORONA,
CTimeCycle::GetSunCoronaRed(), CTimeCycle::GetSunCoronaGreen(), CTimeCycle::GetSunCoronaBlue(),
255, sunCoors, 25.0f * CTimeCycle::GetSunSize(),
diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp
index c512f35c..fac35aeb 100644
--- a/src/render/Shadows.cpp
+++ b/src/render/Shadows.cpp
@@ -643,12 +643,12 @@ CShadows::StoreShadowForPole(CEntity *pPole, float fOffsetX, float fOffsetY, flo
PolePos.y += fOffsetX * pPole->GetRight().y + fOffsetY * pPole->GetForward().y;
PolePos.z += fOffsetZ;
- PolePos.x += -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2);
- PolePos.y += -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2);
+ PolePos.x += -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2);
+ PolePos.y += -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2);
StoreStaticShadow((uintptr)pPole + nID + _TODOCONST(51), SHADOWTYPE_DARK, gpPostShadowTex, &PolePos,
- -CTimeCycle::GetSunPosition().x * (fPoleHeight / 2),
- -CTimeCycle::GetSunPosition().y * (fPoleHeight / 2),
+ -CTimeCycle::GetSunDirection().x * (fPoleHeight / 2),
+ -CTimeCycle::GetSunDirection().y * (fPoleHeight / 2),
CTimeCycle::GetShadowSideX() * fPoleWidth,
CTimeCycle::GetShadowSideY() * fPoleWidth,
2 * (int32)((pPole->GetUp().z - 0.5f) * CTimeCycle::GetShadowStrength() * 2.0f) / 3,
diff --git a/src/render/Skidmarks.cpp b/src/render/Skidmarks.cpp
index 7f057319..961c38a6 100644
--- a/src/render/Skidmarks.cpp
+++ b/src/render/Skidmarks.cpp
@@ -199,8 +199,8 @@ CSkidmarks::RegisterOne(uintptr id, CVector pos, float fwdX, float fwdY, bool *i
aSkidmarks[i].m_pos[aSkidmarks[i].m_last] = pos;
CVector2D dist = aSkidmarks[i].m_pos[aSkidmarks[i].m_last] - aSkidmarks[i].m_pos[aSkidmarks[i].m_last-1];
- dist.NormaliseSafe();
- fwd.NormaliseSafe();
+ dist.Normalise();
+ fwd.Normalise();
CVector2D right(dist.y, -dist.x);
float turn = DotProduct2D(fwd, right);
turn = Abs(turn) + 1.0f;
diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp
index 7e08fbad..79ae21a5 100644
--- a/src/render/SpecialFX.cpp
+++ b/src/render/SpecialFX.cpp
@@ -28,6 +28,7 @@ RwImVertexIndex StreakIndexList[12];
RwIm3DVertex TraceVertices[6];
RwImVertexIndex TraceIndexList[12];
+bool CSpecialFX::bSnapShotActive;
void
CSpecialFX::Init(void)
diff --git a/src/render/SpecialFX.h b/src/render/SpecialFX.h
index 2d9f18b1..7bc3750a 100644
--- a/src/render/SpecialFX.h
+++ b/src/render/SpecialFX.h
@@ -3,6 +3,8 @@
class CSpecialFX
{
public:
+ static bool bSnapShotActive;
+
static void Render(void);
static void Update(void);
static void Init(void);
diff --git a/src/render/Timecycle.cpp b/src/render/Timecycle.cpp
index c120c003..ab94f874 100644
--- a/src/render/Timecycle.cpp
+++ b/src/render/Timecycle.cpp
@@ -350,7 +350,7 @@ CTimeCycle::Update(void)
m_CurrentStoredValue = (m_CurrentStoredValue+1)&0xF;
float sunAngle = 2*PI*(CClock::GetSeconds()/60.0f + CClock::GetMinutes() + CClock::GetHours()*60)/(24*60);
- CVector &sunPos = GetSunPosition();
+ CVector &sunPos = GetSunDirection();
sunPos.x = Sin(sunAngle);
sunPos.y = 1.0f;
sunPos.z = 0.2f - Cos(sunAngle);
diff --git a/src/render/Timecycle.h b/src/render/Timecycle.h
index 2d873e6d..60c9e29f 100644
--- a/src/render/Timecycle.h
+++ b/src/render/Timecycle.h
@@ -180,7 +180,7 @@ public:
static void Initialise(void);
static void Update(void);
- static CVector &GetSunPosition(void) { return m_VectorToSun[m_CurrentStoredValue]; }
+ static CVector &GetSunDirection(void) { return m_VectorToSun[m_CurrentStoredValue]; }
static float GetShadowFrontX(void) { return m_fShadowFrontX[m_CurrentStoredValue]; }
static float GetShadowFrontY(void) { return m_fShadowFrontY[m_CurrentStoredValue]; }
static float GetShadowSideX(void) { return m_fShadowSideX[m_CurrentStoredValue]; }
diff --git a/src/render/Weather.cpp b/src/render/Weather.cpp
index fc3e0d61..324c63ea 100644
--- a/src/render/Weather.cpp
+++ b/src/render/Weather.cpp
@@ -18,6 +18,7 @@
#include "Vehicle.h"
#include "World.h"
#include "ZoneCull.h"
+#include "SpecialFX.h"
int32 CWeather::SoundHandle = -1;
@@ -271,9 +272,10 @@ void CWeather::Update(void)
SunGlare += InterpolationValue;
if (SunGlare > 0.0f) {
- SunGlare *= Min(1.0f, 7.0 * CTimeCycle::GetSunPosition().z);
+ SunGlare *= Min(1.0f, 7.0 * CTimeCycle::GetSunDirection().z);
SunGlare = clamp(SunGlare, 0.0f, 1.0f);
- // TODO(MIAMI): if (CSpecialFX::bSnapShotActive)...
+ if (!CSpecialFX::bSnapShotActive)
+ SunGlare *= (1.0f - (CGeneral::GetRandomNumber()&0x1F)*0.007f);
}
Wind = InterpolationValue * Windiness[NewWeatherType] + (1.0f - InterpolationValue) * Windiness[OldWeatherType];